@alextheman/eslint-plugin 2.6.0 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3761,7 +3761,7 @@ var import_eslint_plugin_package_json = __toESM(require("eslint-plugin-package-j
3761
3761
 
3762
3762
  // package.json
3763
3763
  var name = "@alextheman/eslint-plugin";
3764
- var version = "2.6.0";
3764
+ var version = "2.6.2";
3765
3765
 
3766
3766
  // src/configs/personal/testsBase.ts
3767
3767
  var import_globals = __toESM(require_globals2(), 1);
@@ -4265,7 +4265,6 @@ var import_parser2 = __toESM(require("@typescript-eslint/parser"), 1);
4265
4265
  var import_typescript_eslint2 = __toESM(require("typescript-eslint"), 1);
4266
4266
  function createPersonalTypeScriptBaseConfig(plugin) {
4267
4267
  return [
4268
- ...import_typescript_eslint2.default.configs.recommended,
4269
4268
  {
4270
4269
  files: ["**/*.ts", "**/*.tsx"],
4271
4270
  languageOptions: {
@@ -4278,7 +4277,8 @@ function createPersonalTypeScriptBaseConfig(plugin) {
4278
4277
  }
4279
4278
  },
4280
4279
  plugins: {
4281
- "@alextheman": plugin
4280
+ "@alextheman": plugin,
4281
+ "@typescript-eslint": import_typescript_eslint2.default.plugin
4282
4282
  },
4283
4283
  rules: {
4284
4284
  "@alextheman/standardise-error-messages": "error",
@@ -4295,6 +4295,20 @@ function createPersonalTypeScriptBaseConfig(plugin) {
4295
4295
  }
4296
4296
  var typeScriptBase_default2 = createPersonalTypeScriptBaseConfig;
4297
4297
 
4298
+ // src/configs/personal/utility.ts
4299
+ var import_typescript_eslint3 = __toESM(require("typescript-eslint"), 1);
4300
+ var utilityConfig = [
4301
+ {
4302
+ plugins: {
4303
+ "@typescript-eslint": import_typescript_eslint3.default.plugin
4304
+ },
4305
+ rules: {
4306
+ "@typescript-eslint/explicit-module-boundary-types": "error"
4307
+ }
4308
+ }
4309
+ ];
4310
+ var utility_default = utilityConfig;
4311
+
4298
4312
  // src/configs/combined/typeScriptBase.ts
4299
4313
  function createCombinedTypeScriptBaseConfig(plugin) {
4300
4314
  return [
@@ -4895,9 +4909,9 @@ var rules_default = {
4895
4909
  };
4896
4910
 
4897
4911
  // src/utility/camelToKebab.ts
4898
- var import_utility = require("@alextheman/utility");
4912
+ var import_utility2 = require("@alextheman/utility");
4899
4913
  function camelToKebab(string) {
4900
- return (0, import_utility.camelToKebab)(
4914
+ return (0, import_utility2.camelToKebab)(
4901
4915
  string.replace(/[Tt]ypeScript/, "typescript").replace(/[Jj]avaScript/, "javascript")
4902
4916
  );
4903
4917
  }
@@ -4950,7 +4964,8 @@ alexPlugin.configs = createPluginConfigs_default({
4950
4964
  tests: testsBase_default,
4951
4965
  eslintPlugin: eslintPlugin_default(alexPlugin),
4952
4966
  neurosongsBackEnd: neurosongsBackEnd_default,
4953
- neursongsFrontEnd: neurosongsFrontEnd_default
4967
+ neurosongsFrontEnd: neurosongsFrontEnd_default,
4968
+ utility: utility_default
4954
4969
  },
4955
4970
  combined: {
4956
4971
  javaScript: [
package/dist/index.d.cts CHANGED
@@ -1,39 +1,27 @@
1
1
  import { Linter } from 'eslint';
2
+ import { IgnoreCase } from '@alextheman/utility';
2
3
  import z from 'zod';
3
4
  import { Config } from 'prettier';
4
5
 
5
6
  var name = "@alextheman/eslint-plugin";
6
- var version = "2.6.0";
7
+ var version = "2.6.2";
7
8
 
9
+ type ToKebabCase<S extends string> = S extends `${IgnoreCase<"J">}avaScript${infer Rest}` ? Rest extends "" ? "javascript" : `javascript${ToKebabCase<Rest>}` : S extends `${IgnoreCase<"T">}ypeScript${infer Rest}` ? Rest extends "" ? "typescript" : `typescript${ToKebabCase<Rest>}` : S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${ToKebabCase<Tail>}` : `-${Lowercase<Head>}${ToKebabCase<Tail>}` : S;
10
+
11
+ type GeneralConfigs = "javaScript" | "typeScript" | "react";
12
+ type PluginConfigs = "base" | "tests";
13
+ type PersonalConfigs = "javaScript" | "typeScript" | "react" | "tests" | "eslintPlugin" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utility";
14
+ type CombinedConfigs = "javaScript" | "typeScript" | "react" | "tests" | "typeScriptReact" | "javaScriptReact";
8
15
  interface AlexPluginConfigs {
9
- general: {
10
- javaScript: Linter.Config[];
11
- typeScript: Linter.Config[];
12
- react: Linter.Config[];
13
- };
14
- plugin: {
15
- base: Linter.Config[];
16
- tests: Linter.Config[];
17
- };
18
- personal: {
19
- javaScript: Linter.Config[];
20
- typeScript: Linter.Config[];
21
- react: Linter.Config[];
22
- tests: Linter.Config[];
23
- eslintPlugin: Linter.Config[];
24
- neurosongsBackEnd: Linter.Config[];
25
- neursongsFrontEnd: Linter.Config[];
26
- };
27
- combined: {
28
- javaScript: Linter.Config[];
29
- typeScript: Linter.Config[];
30
- react: Linter.Config[];
31
- tests: Linter.Config[];
32
- typeScriptReact: Linter.Config[];
33
- javaScriptReact: Linter.Config[];
34
- };
16
+ general: Record<GeneralConfigs, Linter.Config[]>;
17
+ plugin: Record<PluginConfigs, Linter.Config[]>;
18
+ personal: Record<PersonalConfigs, Linter.Config[]>;
19
+ combined: Record<CombinedConfigs, Linter.Config[]>;
35
20
  }
36
- declare function createPluginConfigs(config: AlexPluginConfigs): Record<`${string}/${string}`, Linter.Config[]>;
21
+ type ConfigKey = {
22
+ [G in keyof AlexPluginConfigs & string]: `${ToKebabCase<G>}/${ToKebabCase<keyof AlexPluginConfigs[G] & string>}`;
23
+ }[keyof AlexPluginConfigs & string];
24
+ declare function createPluginConfigs(config: AlexPluginConfigs): Record<ConfigKey, Linter.Config[]>;
37
25
 
38
26
  interface AlexPlugin {
39
27
  meta: {
package/dist/index.d.ts CHANGED
@@ -1,39 +1,27 @@
1
1
  import { Linter } from 'eslint';
2
+ import { IgnoreCase } from '@alextheman/utility';
2
3
  import z from 'zod';
3
4
  import { Config } from 'prettier';
4
5
 
5
6
  var name = "@alextheman/eslint-plugin";
6
- var version = "2.6.0";
7
+ var version = "2.6.2";
7
8
 
9
+ type ToKebabCase<S extends string> = S extends `${IgnoreCase<"J">}avaScript${infer Rest}` ? Rest extends "" ? "javascript" : `javascript${ToKebabCase<Rest>}` : S extends `${IgnoreCase<"T">}ypeScript${infer Rest}` ? Rest extends "" ? "typescript" : `typescript${ToKebabCase<Rest>}` : S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${ToKebabCase<Tail>}` : `-${Lowercase<Head>}${ToKebabCase<Tail>}` : S;
10
+
11
+ type GeneralConfigs = "javaScript" | "typeScript" | "react";
12
+ type PluginConfigs = "base" | "tests";
13
+ type PersonalConfigs = "javaScript" | "typeScript" | "react" | "tests" | "eslintPlugin" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utility";
14
+ type CombinedConfigs = "javaScript" | "typeScript" | "react" | "tests" | "typeScriptReact" | "javaScriptReact";
8
15
  interface AlexPluginConfigs {
9
- general: {
10
- javaScript: Linter.Config[];
11
- typeScript: Linter.Config[];
12
- react: Linter.Config[];
13
- };
14
- plugin: {
15
- base: Linter.Config[];
16
- tests: Linter.Config[];
17
- };
18
- personal: {
19
- javaScript: Linter.Config[];
20
- typeScript: Linter.Config[];
21
- react: Linter.Config[];
22
- tests: Linter.Config[];
23
- eslintPlugin: Linter.Config[];
24
- neurosongsBackEnd: Linter.Config[];
25
- neursongsFrontEnd: Linter.Config[];
26
- };
27
- combined: {
28
- javaScript: Linter.Config[];
29
- typeScript: Linter.Config[];
30
- react: Linter.Config[];
31
- tests: Linter.Config[];
32
- typeScriptReact: Linter.Config[];
33
- javaScriptReact: Linter.Config[];
34
- };
16
+ general: Record<GeneralConfigs, Linter.Config[]>;
17
+ plugin: Record<PluginConfigs, Linter.Config[]>;
18
+ personal: Record<PersonalConfigs, Linter.Config[]>;
19
+ combined: Record<CombinedConfigs, Linter.Config[]>;
35
20
  }
36
- declare function createPluginConfigs(config: AlexPluginConfigs): Record<`${string}/${string}`, Linter.Config[]>;
21
+ type ConfigKey = {
22
+ [G in keyof AlexPluginConfigs & string]: `${ToKebabCase<G>}/${ToKebabCase<keyof AlexPluginConfigs[G] & string>}`;
23
+ }[keyof AlexPluginConfigs & string];
24
+ declare function createPluginConfigs(config: AlexPluginConfigs): Record<ConfigKey, Linter.Config[]>;
37
25
 
38
26
  interface AlexPlugin {
39
27
  meta: {
package/dist/index.js CHANGED
@@ -3746,7 +3746,7 @@ import packageJson from "eslint-plugin-package-json";
3746
3746
 
3747
3747
  // package.json
3748
3748
  var name = "@alextheman/eslint-plugin";
3749
- var version = "2.6.0";
3749
+ var version = "2.6.2";
3750
3750
 
3751
3751
  // src/configs/personal/testsBase.ts
3752
3752
  var import_globals = __toESM(require_globals2(), 1);
@@ -4250,7 +4250,6 @@ import tsparser2 from "@typescript-eslint/parser";
4250
4250
  import tseslint2 from "typescript-eslint";
4251
4251
  function createPersonalTypeScriptBaseConfig(plugin) {
4252
4252
  return [
4253
- ...tseslint2.configs.recommended,
4254
4253
  {
4255
4254
  files: ["**/*.ts", "**/*.tsx"],
4256
4255
  languageOptions: {
@@ -4263,7 +4262,8 @@ function createPersonalTypeScriptBaseConfig(plugin) {
4263
4262
  }
4264
4263
  },
4265
4264
  plugins: {
4266
- "@alextheman": plugin
4265
+ "@alextheman": plugin,
4266
+ "@typescript-eslint": tseslint2.plugin
4267
4267
  },
4268
4268
  rules: {
4269
4269
  "@alextheman/standardise-error-messages": "error",
@@ -4280,6 +4280,20 @@ function createPersonalTypeScriptBaseConfig(plugin) {
4280
4280
  }
4281
4281
  var typeScriptBase_default2 = createPersonalTypeScriptBaseConfig;
4282
4282
 
4283
+ // src/configs/personal/utility.ts
4284
+ import tseslint3 from "typescript-eslint";
4285
+ var utilityConfig = [
4286
+ {
4287
+ plugins: {
4288
+ "@typescript-eslint": tseslint3.plugin
4289
+ },
4290
+ rules: {
4291
+ "@typescript-eslint/explicit-module-boundary-types": "error"
4292
+ }
4293
+ }
4294
+ ];
4295
+ var utility_default = utilityConfig;
4296
+
4283
4297
  // src/configs/combined/typeScriptBase.ts
4284
4298
  function createCombinedTypeScriptBaseConfig(plugin) {
4285
4299
  return [
@@ -4935,7 +4949,8 @@ alexPlugin.configs = createPluginConfigs_default({
4935
4949
  tests: testsBase_default,
4936
4950
  eslintPlugin: eslintPlugin_default(alexPlugin),
4937
4951
  neurosongsBackEnd: neurosongsBackEnd_default,
4938
- neursongsFrontEnd: neurosongsFrontEnd_default
4952
+ neurosongsFrontEnd: neurosongsFrontEnd_default,
4953
+ utility: utility_default
4939
4954
  },
4940
4955
  combined: {
4941
4956
  javaScript: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "description": "A package to provide custom ESLint rules and configs",
5
5
  "license": "ISC",
6
6
  "author": "alextheman",
@@ -33,7 +33,7 @@
33
33
  "update-dependencies": "bash -c 'npx npm-check-updates -u \"$@\" && npm install' --"
34
34
  },
35
35
  "dependencies": {
36
- "@alextheman/utility": "^2.12.1",
36
+ "@alextheman/utility": "^2.14.0",
37
37
  "common-tags": "^1.8.2",
38
38
  "eslint-plugin-package-json": "^0.64.0",
39
39
  "zod": "^4.1.12"