@alextheman/eslint-plugin 2.5.0 → 2.6.1

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.d.cts CHANGED
@@ -1,30 +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.5.0";
7
+ var version = "2.6.1";
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";
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
- combined: {
19
- javaScript: Linter.Config[];
20
- typeScript: Linter.Config[];
21
- react: Linter.Config[];
22
- tests: Linter.Config[];
23
- typeScriptReact: Linter.Config[];
24
- javaScriptReact: Linter.Config[];
25
- };
16
+ general: Record<GeneralConfigs, Linter.Config[]>;
17
+ plugin: Record<PluginConfigs, Linter.Config[]>;
18
+ personal: Record<PersonalConfigs, Linter.Config[]>;
19
+ combined: Record<CombinedConfigs, Linter.Config[]>;
26
20
  }
27
- 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[]>;
28
25
 
29
26
  interface AlexPlugin {
30
27
  meta: {
package/dist/index.d.ts CHANGED
@@ -1,30 +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.5.0";
7
+ var version = "2.6.1";
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";
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
- combined: {
19
- javaScript: Linter.Config[];
20
- typeScript: Linter.Config[];
21
- react: Linter.Config[];
22
- tests: Linter.Config[];
23
- typeScriptReact: Linter.Config[];
24
- javaScriptReact: Linter.Config[];
25
- };
16
+ general: Record<GeneralConfigs, Linter.Config[]>;
17
+ plugin: Record<PluginConfigs, Linter.Config[]>;
18
+ personal: Record<PersonalConfigs, Linter.Config[]>;
19
+ combined: Record<CombinedConfigs, Linter.Config[]>;
26
20
  }
27
- 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[]>;
28
25
 
29
26
  interface AlexPlugin {
30
27
  meta: {