@kasoa/eslint-config 0.0.18 → 0.0.19

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.
@@ -9,7 +9,7 @@ export const eslintConfig = defineConfig(eslint.configs.recommended, {
9
9
  "logical-assignment-operators": ["error", "always"],
10
10
  "max-params": "warn",
11
11
  "no-alert": "error",
12
- "no-console": ["warn", { allow: ["warn", "error"] }],
12
+ "no-console": ["warn", { allow: ["info", "warn", "error"] }],
13
13
  "no-constructor-return": "error",
14
14
  "no-else-return": ["error", { allowElseIf: false }],
15
15
  "no-param-reassign": ["error", { props: false }],
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,IAAI,kCAehB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,IAAI,kCAchB,CAAC"}
@@ -3,7 +3,6 @@ import eslintConfigPrettier from "eslint-config-prettier/flat";
3
3
  import { defineConfig, globalIgnores } from "eslint/config";
4
4
  import { eslintConfig } from "./eslint.js";
5
5
  import { importLiteConfig } from "./import-lite.js";
6
- import { jsonConfig } from "./json.js";
7
6
  import { noBarrelFilesConfig } from "./no-barrel-files.js";
8
7
  import { perfectionistConfig } from "./perfectionist.js";
9
8
  import { regexpConfig } from "./regexp.js";
@@ -12,4 +11,4 @@ import { typescriptEslintConfig } from "./typescript-eslint.js";
12
11
  import { unicornXConfig } from "./unicorn-x.js";
13
12
  import { unusedImportsConfig } from "./unused-imports.js";
14
13
  import { vitestConfig } from "./vitest.js";
15
- export const base = defineConfig(gitignore(), globalIgnores(["**/*.d.ts"]), jsonConfig, eslintConfig, typescriptEslintConfig, noBarrelFilesConfig, unicornXConfig, vitestConfig, importLiteConfig, unusedImportsConfig, perfectionistConfig, sonarjsConfig, regexpConfig, eslintConfigPrettier);
14
+ export const base = defineConfig(gitignore(), globalIgnores(["**/*.d.ts"]), eslintConfig, typescriptEslintConfig, noBarrelFilesConfig, unicornXConfig, vitestConfig, importLiteConfig, unusedImportsConfig, perfectionistConfig, sonarjsConfig, regexpConfig, eslintConfigPrettier);
@@ -1 +1 @@
1
- {"version":3,"file":"perfectionist.d.ts","sourceRoot":"","sources":["../../src/base/perfectionist.ts"],"names":[],"mappings":"AAuEA,eAAO,MAAM,mBAAmB,kCAqE9B,CAAC;AAEH,eAAO,MAAM,sBAAsB,kCAcjC,CAAC"}
1
+ {"version":3,"file":"perfectionist.d.ts","sourceRoot":"","sources":["../../src/base/perfectionist.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,kCAwB9B,CAAC;AAEH,eAAO,MAAM,sBAAsB,kCAoBjC,CAAC"}
@@ -1,96 +1,12 @@
1
1
  import perfectionist from "eslint-plugin-perfectionist";
2
2
  import { defineConfig } from "eslint/config";
3
- const unifiedCustomGroups = [
4
- {
5
- elementNamePattern: "^id$",
6
- groupName: "id",
7
- },
8
- {
9
- elementNamePattern: "(?:^_id$|^uuid$|Id$)",
10
- groupName: "suffixId",
11
- },
12
- {
13
- elementNamePattern: "^key$",
14
- groupName: "key",
15
- },
16
- {
17
- elementNamePattern: "(?:At$|_at$)",
18
- groupName: "timestamp",
19
- },
20
- {
21
- elementNamePattern: "(?:^ref$|Ref$)",
22
- groupName: "ref",
23
- },
24
- {
25
- elementNamePattern: "^on[A-Z]",
26
- groupName: "callback",
27
- },
28
- {
29
- elementNamePattern: "(?:^style$|Style$)",
30
- groupName: "style",
31
- },
32
- {
33
- elementNamePattern: "(?:^className$|ClassName$)",
34
- groupName: "className",
35
- },
36
- ];
37
- const unifiedGroups = [
38
- "id",
39
- "suffixId",
40
- "key",
41
- "ref",
42
- "unknown",
43
- "multiline-member",
44
- "timestamp",
45
- "method",
46
- "callback",
47
- "style",
48
- "className",
49
- ];
50
- const jsxGroups = [
51
- "id",
52
- "suffixId",
53
- "key",
54
- "ref",
55
- "shorthand-prop",
56
- "unknown",
57
- "multiline-prop",
58
- "timestamp",
59
- "callback",
60
- "style",
61
- "className",
62
- ];
63
3
  const baseConfig = {
64
4
  order: "asc",
65
5
  type: "natural",
66
6
  };
67
7
  export const perfectionistConfig = defineConfig({
68
- plugins: {
69
- perfectionist,
70
- },
8
+ plugins: { perfectionist },
71
9
  rules: {
72
- "perfectionist/sort-enums": ["error", baseConfig],
73
- "perfectionist/sort-export-attributes": ["error", baseConfig],
74
- "perfectionist/sort-import-attributes": ["error", baseConfig],
75
- "perfectionist/sort-intersection-types": ["error", baseConfig],
76
- "perfectionist/sort-named-exports": ["error", baseConfig],
77
- "perfectionist/sort-named-imports": ["error", baseConfig],
78
- "perfectionist/sort-switch-case": ["error", baseConfig],
79
- "perfectionist/sort-union-types": ["error", baseConfig],
80
- "perfectionist/sort-classes": [
81
- "error",
82
- {
83
- ...baseConfig,
84
- newlinesBetween: 1,
85
- },
86
- ],
87
- "perfectionist/sort-exports": [
88
- "error",
89
- {
90
- ...baseConfig,
91
- groups: ["type-export", "wildcard-export", "value-export"],
92
- },
93
- ],
94
10
  "perfectionist/sort-imports": [
95
11
  "error",
96
12
  {
@@ -108,43 +24,28 @@ export const perfectionistConfig = defineConfig({
108
24
  ],
109
25
  },
110
26
  ],
111
- "perfectionist/sort-interfaces": [
112
- "error",
113
- {
114
- ...baseConfig,
115
- customGroups: unifiedCustomGroups,
116
- groups: unifiedGroups,
117
- },
118
- ],
119
- "perfectionist/sort-object-types": [
120
- "error",
121
- {
122
- ...baseConfig,
123
- customGroups: unifiedCustomGroups,
124
- groups: unifiedGroups,
125
- },
126
- ],
127
- "perfectionist/sort-objects": [
128
- "error",
129
- {
130
- ...baseConfig,
131
- customGroups: unifiedCustomGroups,
132
- groups: unifiedGroups,
133
- },
134
- ],
27
+ "perfectionist/sort-named-imports": ["error", baseConfig],
28
+ "perfectionist/sort-interfaces": ["error", baseConfig],
29
+ "perfectionist/sort-object-types": ["error", baseConfig],
135
30
  },
136
31
  });
137
32
  export const perfectionistJsxConfig = defineConfig({
138
- plugins: {
139
- perfectionist,
140
- },
33
+ plugins: { perfectionist },
141
34
  rules: {
142
35
  "perfectionist/sort-jsx-props": [
143
36
  "error",
144
37
  {
145
38
  ...baseConfig,
146
- customGroups: unifiedCustomGroups,
147
- groups: jsxGroups,
39
+ customGroups: [
40
+ { elementNamePattern: "^key$", groupName: "key" },
41
+ { elementNamePattern: "^ref$", groupName: "ref" },
42
+ { elementNamePattern: "^on[A-Z]", groupName: "callback" },
43
+ {
44
+ elementNamePattern: "(?:^className$|ClassName$)",
45
+ groupName: "className",
46
+ },
47
+ ],
48
+ groups: ["key", "ref", "unknown", "callback", "className"],
148
49
  },
149
50
  ],
150
51
  },
@@ -1 +1 @@
1
- {"version":3,"file":"sonarjs.d.ts","sourceRoot":"","sources":["../../src/base/sonarjs.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,kCAIxB,CAAC"}
1
+ {"version":3,"file":"sonarjs.d.ts","sourceRoot":"","sources":["../../src/base/sonarjs.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,kCAKxB,CAAC"}
@@ -4,5 +4,6 @@ const COGNITIVE_COMPLEXITY_THRESHOLD = 15;
4
4
  export const sonarjsConfig = defineConfig(sonarjs.configs.recommended, {
5
5
  rules: {
6
6
  "sonarjs/cognitive-complexity": ["warn", COGNITIVE_COMPLEXITY_THRESHOLD],
7
+ "sonarjs/deprecation": "off",
7
8
  },
8
9
  });
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-eslint.d.ts","sourceRoot":"","sources":["../../src/base/typescript-eslint.ts"],"names":[],"mappings":"AA8EA,eAAO,MAAM,sBAAsB,kCAwBlC,CAAC"}
1
+ {"version":3,"file":"typescript-eslint.d.ts","sourceRoot":"","sources":["../../src/base/typescript-eslint.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,sBAAsB,kCAwBlC,CAAC"}
@@ -22,55 +22,6 @@ const sharedConfig = {
22
22
  "error",
23
23
  { fixMixedExportsWithInlineTypeSpecifier: true },
24
24
  ],
25
- "@typescript-eslint/naming-convention": [
26
- "warn",
27
- {
28
- format: ["camelCase"],
29
- leadingUnderscore: "allow",
30
- selector: "default",
31
- trailingUnderscore: "allow",
32
- },
33
- {
34
- format: ["camelCase", "UPPER_CASE", "PascalCase"],
35
- selector: "variable",
36
- },
37
- {
38
- format: ["camelCase", "PascalCase"],
39
- selector: "function",
40
- },
41
- {
42
- format: ["camelCase"],
43
- leadingUnderscore: "allow",
44
- selector: "parameter",
45
- },
46
- {
47
- format: ["PascalCase"],
48
- selector: "typeLike",
49
- },
50
- {
51
- format: ["PascalCase", "UPPER_CASE"],
52
- selector: "enumMember",
53
- },
54
- {
55
- format: ["camelCase", "UPPER_CASE"],
56
- leadingUnderscore: "allow",
57
- selector: "property",
58
- },
59
- {
60
- format: ["camelCase", "UPPER_CASE"],
61
- selector: "classProperty",
62
- },
63
- {
64
- format: ["camelCase"],
65
- selector: "classMethod",
66
- },
67
- {
68
- // eslint-disable-next-line unicorn-x/no-null -- format: null is required by @typescript-eslint/naming-convention to disable format checking
69
- format: null,
70
- modifiers: ["requiresQuotes"],
71
- selector: "objectLiteralProperty",
72
- },
73
- ],
74
25
  },
75
26
  };
76
27
  export const typescriptEslintConfig = defineConfig({
@@ -1 +1 @@
1
- {"version":3,"file":"unicorn-x.d.ts","sourceRoot":"","sources":["../../src/base/unicorn-x.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,kCAMzB,CAAC"}
1
+ {"version":3,"file":"unicorn-x.d.ts","sourceRoot":"","sources":["../../src/base/unicorn-x.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,kCAOzB,CAAC"}
@@ -5,5 +5,6 @@ export const unicornXConfig = defineConfig(unicornX.configs.recommended, {
5
5
  "unicorn-x/better-regex": "error",
6
6
  "unicorn-x/prefer-import-meta-properties": "error",
7
7
  "unicorn-x/prevent-abbreviations": "off",
8
+ "unicorn-x/no-array-for-each": "error",
8
9
  },
9
10
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kasoa/eslint-config",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Kasoa's ESLint config",
@@ -43,7 +43,6 @@
43
43
  "eslint-config-flat-gitignore": "^2.1.0",
44
44
  "eslint-config-prettier": "^10.1.8",
45
45
  "eslint-plugin-import-lite": "^0.5.0",
46
- "eslint-plugin-json-schema-validator": "^6.0.0",
47
46
  "eslint-plugin-jsx-a11y": "^6.10.2",
48
47
  "eslint-plugin-jsx-a11y-x": "^0.1.1",
49
48
  "eslint-plugin-n": "^17.23.2",
@@ -76,8 +75,8 @@
76
75
  "scripts": {
77
76
  "dev": "tsgo --watch",
78
77
  "build": "tsgo",
79
- "lint": "eslint --fix --cache .",
80
- "format": "prettier --write --cache .",
78
+ "lint": "eslint --fix --cache --concurrency=auto .",
79
+ "format": "prettier --write --cache --experimental-cli .",
81
80
  "typecheck": "tsgo --noEmit",
82
81
  "test": "echo 'No tests'"
83
82
  }
@@ -10,7 +10,7 @@ export const eslintConfig = defineConfig(eslint.configs.recommended, {
10
10
  "logical-assignment-operators": ["error", "always"],
11
11
  "max-params": "warn",
12
12
  "no-alert": "error",
13
- "no-console": ["warn", { allow: ["warn", "error"] }],
13
+ "no-console": ["warn", { allow: ["info", "warn", "error"] }],
14
14
  "no-constructor-return": "error",
15
15
  "no-else-return": ["error", { allowElseIf: false }],
16
16
  "no-param-reassign": ["error", { props: false }],
package/src/base/index.ts CHANGED
@@ -3,7 +3,6 @@ import eslintConfigPrettier from "eslint-config-prettier/flat";
3
3
  import { defineConfig, globalIgnores } from "eslint/config";
4
4
  import { eslintConfig } from "./eslint.js";
5
5
  import { importLiteConfig } from "./import-lite.js";
6
- import { jsonConfig } from "./json.js";
7
6
  import { noBarrelFilesConfig } from "./no-barrel-files.js";
8
7
  import { perfectionistConfig } from "./perfectionist.js";
9
8
  import { regexpConfig } from "./regexp.js";
@@ -16,7 +15,6 @@ import { vitestConfig } from "./vitest.js";
16
15
  export const base = defineConfig(
17
16
  gitignore(),
18
17
  globalIgnores(["**/*.d.ts"]),
19
- jsonConfig,
20
18
  eslintConfig,
21
19
  typescriptEslintConfig,
22
20
  noBarrelFilesConfig,
@@ -1,101 +1,14 @@
1
1
  import perfectionist from "eslint-plugin-perfectionist";
2
2
  import { defineConfig } from "eslint/config";
3
3
 
4
- const unifiedCustomGroups = [
5
- {
6
- elementNamePattern: "^id$",
7
- groupName: "id",
8
- },
9
- {
10
- elementNamePattern: "(?:^_id$|^uuid$|Id$)",
11
- groupName: "suffixId",
12
- },
13
- {
14
- elementNamePattern: "^key$",
15
- groupName: "key",
16
- },
17
- {
18
- elementNamePattern: "(?:At$|_at$)",
19
- groupName: "timestamp",
20
- },
21
- {
22
- elementNamePattern: "(?:^ref$|Ref$)",
23
- groupName: "ref",
24
- },
25
- {
26
- elementNamePattern: "^on[A-Z]",
27
- groupName: "callback",
28
- },
29
- {
30
- elementNamePattern: "(?:^style$|Style$)",
31
- groupName: "style",
32
- },
33
- {
34
- elementNamePattern: "(?:^className$|ClassName$)",
35
- groupName: "className",
36
- },
37
- ];
38
-
39
- const unifiedGroups = [
40
- "id",
41
- "suffixId",
42
- "key",
43
- "ref",
44
- "unknown",
45
- "multiline-member",
46
- "timestamp",
47
- "method",
48
- "callback",
49
- "style",
50
- "className",
51
- ];
52
-
53
- const jsxGroups = [
54
- "id",
55
- "suffixId",
56
- "key",
57
- "ref",
58
- "shorthand-prop",
59
- "unknown",
60
- "multiline-prop",
61
- "timestamp",
62
- "callback",
63
- "style",
64
- "className",
65
- ];
66
-
67
4
  const baseConfig = {
68
5
  order: "asc" as const,
69
6
  type: "natural" as const,
70
7
  };
71
8
 
72
9
  export const perfectionistConfig = defineConfig({
73
- plugins: {
74
- perfectionist,
75
- },
10
+ plugins: { perfectionist },
76
11
  rules: {
77
- "perfectionist/sort-enums": ["error", baseConfig],
78
- "perfectionist/sort-export-attributes": ["error", baseConfig],
79
- "perfectionist/sort-import-attributes": ["error", baseConfig],
80
- "perfectionist/sort-intersection-types": ["error", baseConfig],
81
- "perfectionist/sort-named-exports": ["error", baseConfig],
82
- "perfectionist/sort-named-imports": ["error", baseConfig],
83
- "perfectionist/sort-switch-case": ["error", baseConfig],
84
- "perfectionist/sort-union-types": ["error", baseConfig],
85
- "perfectionist/sort-classes": [
86
- "error",
87
- {
88
- ...baseConfig,
89
- newlinesBetween: 1,
90
- },
91
- ],
92
- "perfectionist/sort-exports": [
93
- "error",
94
- {
95
- ...baseConfig,
96
- groups: ["type-export", "wildcard-export", "value-export"],
97
- },
98
- ],
99
12
  "perfectionist/sort-imports": [
100
13
  "error",
101
14
  {
@@ -113,44 +26,29 @@ export const perfectionistConfig = defineConfig({
113
26
  ],
114
27
  },
115
28
  ],
116
- "perfectionist/sort-interfaces": [
117
- "error",
118
- {
119
- ...baseConfig,
120
- customGroups: unifiedCustomGroups,
121
- groups: unifiedGroups,
122
- },
123
- ],
124
- "perfectionist/sort-object-types": [
125
- "error",
126
- {
127
- ...baseConfig,
128
- customGroups: unifiedCustomGroups,
129
- groups: unifiedGroups,
130
- },
131
- ],
132
- "perfectionist/sort-objects": [
133
- "error",
134
- {
135
- ...baseConfig,
136
- customGroups: unifiedCustomGroups,
137
- groups: unifiedGroups,
138
- },
139
- ],
29
+ "perfectionist/sort-named-imports": ["error", baseConfig],
30
+ "perfectionist/sort-interfaces": ["error", baseConfig],
31
+ "perfectionist/sort-object-types": ["error", baseConfig],
140
32
  },
141
33
  });
142
34
 
143
35
  export const perfectionistJsxConfig = defineConfig({
144
- plugins: {
145
- perfectionist,
146
- },
36
+ plugins: { perfectionist },
147
37
  rules: {
148
38
  "perfectionist/sort-jsx-props": [
149
39
  "error",
150
40
  {
151
41
  ...baseConfig,
152
- customGroups: unifiedCustomGroups,
153
- groups: jsxGroups,
42
+ customGroups: [
43
+ { elementNamePattern: "^key$", groupName: "key" },
44
+ { elementNamePattern: "^ref$", groupName: "ref" },
45
+ { elementNamePattern: "^on[A-Z]", groupName: "callback" },
46
+ {
47
+ elementNamePattern: "(?:^className$|ClassName$)",
48
+ groupName: "className",
49
+ },
50
+ ],
51
+ groups: ["key", "ref", "unknown", "callback", "className"],
154
52
  },
155
53
  ],
156
54
  },
@@ -6,5 +6,6 @@ const COGNITIVE_COMPLEXITY_THRESHOLD = 15;
6
6
  export const sonarjsConfig = defineConfig(sonarjs.configs.recommended, {
7
7
  rules: {
8
8
  "sonarjs/cognitive-complexity": ["warn", COGNITIVE_COMPLEXITY_THRESHOLD],
9
+ "sonarjs/deprecation": "off",
9
10
  },
10
11
  });
@@ -24,55 +24,6 @@ const sharedConfig = {
24
24
  "error",
25
25
  { fixMixedExportsWithInlineTypeSpecifier: true },
26
26
  ],
27
- "@typescript-eslint/naming-convention": [
28
- "warn",
29
- {
30
- format: ["camelCase"],
31
- leadingUnderscore: "allow",
32
- selector: "default",
33
- trailingUnderscore: "allow",
34
- },
35
- {
36
- format: ["camelCase", "UPPER_CASE", "PascalCase"],
37
- selector: "variable",
38
- },
39
- {
40
- format: ["camelCase", "PascalCase"],
41
- selector: "function",
42
- },
43
- {
44
- format: ["camelCase"],
45
- leadingUnderscore: "allow",
46
- selector: "parameter",
47
- },
48
- {
49
- format: ["PascalCase"],
50
- selector: "typeLike",
51
- },
52
- {
53
- format: ["PascalCase", "UPPER_CASE"],
54
- selector: "enumMember",
55
- },
56
- {
57
- format: ["camelCase", "UPPER_CASE"],
58
- leadingUnderscore: "allow",
59
- selector: "property",
60
- },
61
- {
62
- format: ["camelCase", "UPPER_CASE"],
63
- selector: "classProperty",
64
- },
65
- {
66
- format: ["camelCase"],
67
- selector: "classMethod",
68
- },
69
- {
70
- // eslint-disable-next-line unicorn-x/no-null -- format: null is required by @typescript-eslint/naming-convention to disable format checking
71
- format: null,
72
- modifiers: ["requiresQuotes"],
73
- selector: "objectLiteralProperty",
74
- },
75
- ],
76
27
  } satisfies Linter.RulesRecord,
77
28
  };
78
29
 
@@ -6,5 +6,6 @@ export const unicornXConfig = defineConfig(unicornX.configs.recommended, {
6
6
  "unicorn-x/better-regex": "error",
7
7
  "unicorn-x/prefer-import-meta-properties": "error",
8
8
  "unicorn-x/prevent-abbreviations": "off",
9
+ "unicorn-x/no-array-for-each": "error",
9
10
  },
10
11
  });
@@ -1,2 +0,0 @@
1
- export declare const jsonConfig: import("eslint/config").Config[];
2
- //# sourceMappingURL=json.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/base/json.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,kCAEtB,CAAC"}
package/dist/base/json.js DELETED
@@ -1,3 +0,0 @@
1
- import jsonSchemaValidator from "eslint-plugin-json-schema-validator";
2
- import { defineConfig } from "eslint/config";
3
- export const jsonConfig = defineConfig(...jsonSchemaValidator.configs["flat/recommended"]);
@@ -1,2 +0,0 @@
1
- export declare const jsxA11yXConfig: import("eslint/config").Config[];
2
- //# sourceMappingURL=jsx-a11y-x.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsx-a11y-x.d.ts","sourceRoot":"","sources":["../../src/react/jsx-a11y-x.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc,kCAE1B,CAAC"}
@@ -1,4 +0,0 @@
1
- // @ts-expect-error - eslint-plugin-jsx-a11y-x is not typed
2
- import jsxA11yX from "eslint-plugin-jsx-a11y-x";
3
- import { defineConfig } from "eslint/config";
4
- export const jsxA11yXConfig = defineConfig(jsxA11yX.flatConfigs.strict);
package/src/base/json.ts DELETED
@@ -1,6 +0,0 @@
1
- import jsonSchemaValidator from "eslint-plugin-json-schema-validator";
2
- import { defineConfig } from "eslint/config";
3
-
4
- export const jsonConfig = defineConfig(
5
- ...jsonSchemaValidator.configs["flat/recommended"],
6
- );