@pumpn/eslint-config 15.1.2 → 15.2.0

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/license.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright © 2024 Pumpn Universe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pumpn/eslint-config",
3
- "version": "15.1.2",
3
+ "version": "15.2.0",
4
4
  "description": "standard eslint config for pumpn code projects",
5
5
  "main": "config.js",
6
6
  "author": "Nano Miratus <nanomiratus@gmail.com>",
@@ -17,35 +17,35 @@
17
17
  "test": "echo 'no tests yet'"
18
18
  },
19
19
  "devDependencies": {
20
- "eslint": "^9.9.0"
20
+ "eslint": "^9.13.0"
21
21
  },
22
22
  "dependencies": {
23
- "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
24
- "@eslint-react/eslint-plugin": "^1.9.1",
25
- "@stylistic/eslint-plugin": "^2.6.2",
26
- "@typescript-eslint/parser": "^8.0.1",
27
- "eslint-plugin-depend": "^0.9.0",
23
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
24
+ "@eslint-react/eslint-plugin": "^1.15.0",
25
+ "@stylistic/eslint-plugin": "^2.9.0",
26
+ "@typescript-eslint/parser": "^8.11.0",
27
+ "eslint-plugin-depend": "^0.11.0",
28
28
  "eslint-plugin-disable-autofix": "^5.0.1",
29
29
  "eslint-plugin-func-params-args": "^4.0.0",
30
- "eslint-plugin-import-x": "^3.1.0",
31
- "eslint-plugin-jsdoc": "^50.0.0",
30
+ "eslint-plugin-import-x": "^4.3.1",
31
+ "eslint-plugin-jsdoc": "^50.4.3",
32
32
  "eslint-plugin-no-secrets": "^1.0.2",
33
- "eslint-plugin-perfectionist": "^3.1.3",
33
+ "eslint-plugin-perfectionist": "^3.9.1",
34
34
  "eslint-plugin-promise": "^7.1.0",
35
35
  "eslint-plugin-redos": "^4.4.5",
36
36
  "eslint-plugin-regexp": "^2.6.0",
37
37
  "eslint-plugin-security": "^3.0.1",
38
- "eslint-plugin-sonarjs": "^1.0.4",
39
- "eslint-plugin-tailwindcss": "^3.17.4",
40
- "eslint-plugin-unicorn": "^55.0.0",
41
- "globals": "^15.9.0"
38
+ "eslint-plugin-sonarjs": "^2.0.4",
39
+ "eslint-plugin-tailwindcss": "^3.17.5",
40
+ "eslint-plugin-unicorn": "^56.0.0",
41
+ "globals": "^15.11.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "eslint": "^9.9.0"
45
45
  },
46
46
  "overrides": {
47
- "@typescript-eslint/type-utils": "^8.0.0-alpha.47",
48
- "@typescript-eslint/utils": "^8.0.0-alpha.47",
49
- "eslint": "^9.9.0"
47
+ "@typescript-eslint/type-utils": "^8.11.0",
48
+ "@typescript-eslint/utils": "^8.11.0",
49
+ "eslint": "^9.13.0"
50
50
  }
51
51
  }
package/plugins.js CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint-disable import-x/no-rename-default -- bad export names */
1
2
  /* eslint-disable import-x/max-dependencies -- collection file */
2
3
  // import github from "eslint-plugin-github";
3
4
  // import jsxA11y from "eslint-plugin-jsx-a11y";
@@ -6,6 +6,7 @@ const helpfulWarningsRules = {
6
6
  "import-x/no-mutable-exports": "error",
7
7
  "import-x/no-named-as-default": "error",
8
8
  "import-x/no-named-as-default-member": "error",
9
+ "import-x/no-rename-default": "error",
9
10
  "import-x/no-unused-modules": [
10
11
  "error",
11
12
  {
@@ -57,7 +57,7 @@ const staticAnalysisRules = {
57
57
  }
58
58
  ],
59
59
  "import-x/no-self-import": "error",
60
- // TODO [2024-09-01]: Change to "error" when there is a resolver for deno
60
+ // TODO [2024-11-01]: Change to "error" when there is a resolver for deno
61
61
  "import-x/no-unresolved": "off",
62
62
  "import-x/no-useless-path-segments": [
63
63
  "error",
@@ -2,18 +2,7 @@ const perfectionistRules = {
2
2
  "perfectionist/sort-array-includes": [
3
3
  "error",
4
4
  {
5
- groupKind: "literals-first",
6
- ignoreCase: false,
7
- order: "asc",
8
- type: "natural"
9
- }
10
- ],
11
- "perfectionist/sort-astro-attributes": [
12
- "error",
13
- {
14
- ignoreCase: false,
15
- order: "asc",
16
- type: "natural"
5
+ groupKind: "literals-first"
17
6
  }
18
7
  ],
19
8
  "perfectionist/sort-classes": [
@@ -26,32 +15,18 @@ const perfectionistRules = {
26
15
  "property",
27
16
  "constructor",
28
17
  "static-method",
18
+ "static-function-property",
29
19
  "private-method",
20
+ "private-function-property",
30
21
  "method",
22
+ "function-property",
31
23
  ["get-method", "set-method"],
32
24
  "unknown"
33
- ],
34
- ignoreCase: false,
35
- order: "asc",
36
- type: "natural"
37
- }
38
- ],
39
- "perfectionist/sort-enums": [
40
- "error",
41
- {
42
- ignoreCase: false,
43
- order: "asc",
44
- type: "natural"
45
- }
46
- ],
47
- "perfectionist/sort-exports": [
48
- "error",
49
- {
50
- ignoreCase: false,
51
- order: "asc",
52
- type: "natural"
25
+ ]
53
26
  }
54
27
  ],
28
+ "perfectionist/sort-enums": ["error"],
29
+ "perfectionist/sort-exports": ["error"],
55
30
  "perfectionist/sort-imports": [
56
31
  "error",
57
32
  {
@@ -87,29 +62,13 @@ const perfectionistRules = {
87
62
  "index",
88
63
  "unknown"
89
64
  ],
90
- ignoreCase: false,
91
65
  internalPattern: ["@/**"],
92
66
  newlinesBetween: "always",
93
- order: "asc",
94
- type: "natural"
95
- }
96
- ],
97
- "perfectionist/sort-interfaces": [
98
- "error",
99
- {
100
- ignoreCase: false,
101
- order: "asc",
102
- type: "natural"
103
- }
104
- ],
105
- "perfectionist/sort-intersection-types": [
106
- "error",
107
- {
108
- ignoreCase: false,
109
- order: "asc",
110
- type: "natural"
67
+ sortSideEffects: true
111
68
  }
112
69
  ],
70
+ "perfectionist/sort-interfaces": ["error"],
71
+ "perfectionist/sort-intersection-types": ["error"],
113
72
  "perfectionist/sort-jsx-props": [
114
73
  "error",
115
74
  {
@@ -117,44 +76,13 @@ const perfectionistRules = {
117
76
  "shorthand",
118
77
  "unknown",
119
78
  "multiline"
120
- ],
121
- ignoreCase: false,
122
- order: "asc",
123
- type: "natural"
124
- }
125
- ],
126
- "perfectionist/sort-maps": [
127
- "error",
128
- {
129
- ignoreCase: false,
130
- order: "asc",
131
- type: "natural"
132
- }
133
- ],
134
- "perfectionist/sort-named-exports": [
135
- "error",
136
- {
137
- ignoreCase: false,
138
- order: "asc",
139
- type: "natural"
140
- }
141
- ],
142
- "perfectionist/sort-named-imports": [
143
- "error",
144
- {
145
- ignoreCase: false,
146
- order: "asc",
147
- type: "natural"
148
- }
149
- ],
150
- "perfectionist/sort-object-types": [
151
- "error",
152
- {
153
- ignoreCase: false,
154
- order: "asc",
155
- type: "natural"
79
+ ]
156
80
  }
157
81
  ],
82
+ "perfectionist/sort-maps": ["error"],
83
+ "perfectionist/sort-named-exports": ["error"],
84
+ "perfectionist/sort-named-imports": ["error"],
85
+ "perfectionist/sort-object-types": ["error"],
158
86
  "perfectionist/sort-objects": [
159
87
  "error",
160
88
  {
@@ -234,59 +162,17 @@ const perfectionistRules = {
234
162
  "groupPrecedenceOrdinal9",
235
163
  "groupPrecedenceOrdinal10",
236
164
  "groupPrecedenceOrdinalLast",
237
- "groupColor0",
238
165
  "groupColor1",
239
166
  "groupColor2",
240
167
  "groupColor3",
241
168
  "unknown"
242
- ],
243
- ignoreCase: false,
244
- order: "asc",
245
- partitionByComment: true,
246
- partitionByNewLine: true,
247
- type: "natural"
169
+ ]
248
170
  }
249
171
  ],
250
- "perfectionist/sort-svelte-attributes": [
251
- "error",
252
- {
253
- ignoreCase: false,
254
- order: "asc",
255
- type: "natural"
256
- }
257
- ],
258
- "perfectionist/sort-switch-case": [
259
- "error",
260
- {
261
- ignoreCase: false,
262
- order: "asc",
263
- type: "natural"
264
- }
265
- ],
266
- "perfectionist/sort-union-types": [
267
- "error",
268
- {
269
- ignoreCase: false,
270
- order: "asc",
271
- type: "natural"
272
- }
273
- ],
274
- "perfectionist/sort-variable-declarations": [
275
- "error",
276
- {
277
- ignoreCase: false,
278
- order: "asc",
279
- type: "natural"
280
- }
281
- ],
282
- "perfectionist/sort-vue-attributes": [
283
- "error",
284
- {
285
- ignoreCase: false,
286
- order: "asc",
287
- type: "natural"
288
- }
289
- ]
172
+ "perfectionist/sort-sets": ["error"],
173
+ "perfectionist/sort-switch-case": ["error"],
174
+ "perfectionist/sort-union-types": ["error"],
175
+ "perfectionist/sort-variable-declarations": ["error"]
290
176
  };
291
177
 
292
178
  export default perfectionistRules;
@@ -39,8 +39,9 @@ const coreRules = {
39
39
  "@eslint-react/no-unstable-default-props": "error",
40
40
  "@eslint-react/no-unused-class-component-members": "error",
41
41
  "@eslint-react/no-unused-state": "error",
42
- "@eslint-react/no-useless-fragment": "error",
42
+ "@eslint-react/no-useless-fragment": ["error", { allowExpressions: true }],
43
43
  "@eslint-react/prefer-destructuring-assignment": "error",
44
+ "@eslint-react/prefer-react-namespace-import": "error",
44
45
  "@eslint-react/prefer-read-only-props": "error",
45
46
  "@eslint-react/prefer-shorthand-boolean": "error",
46
47
  "@eslint-react/prefer-shorthand-fragment": "error"
@@ -1,7 +1,7 @@
1
1
  const debugRules = {
2
2
  "@eslint-react/debug/class-component": "off",
3
3
  "@eslint-react/debug/function-component": "off",
4
- "@eslint-react/debug/react-hooks": "off"
4
+ "@eslint-react/debug/hook": "off"
5
5
  };
6
6
 
7
7
  export default debugRules;
@@ -1,9 +1,8 @@
1
1
  const hooksExtraRules = {
2
- "@eslint-react/hooks-extra/ensure-custom-hooks-using-other-hooks": "error",
3
- "@eslint-react/hooks-extra/ensure-use-callback-has-non-empty-deps": "error",
4
- "@eslint-react/hooks-extra/ensure-use-memo-has-non-empty-deps": "error",
5
2
  "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "error",
6
- "@eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect": "error",
3
+ "@eslint-react/hooks-extra/no-redundant-custom-hook": "error",
4
+ "@eslint-react/hooks-extra/no-unnecessary-use-callback": "error",
5
+ "@eslint-react/hooks-extra/no-unnecessary-use-memo": "error",
7
6
  "@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "error"
8
7
  };
9
8
 
@@ -2,6 +2,9 @@ const namingConventionRules = {
2
2
  "@eslint-react/naming-convention/component-name": [
3
3
  "error",
4
4
  {
5
+ allowAllCaps: false,
6
+ allowLeadingUnderscore: false,
7
+ allowNamespace: false,
5
8
  excepts: [],
6
9
  rule: "PascalCase"
7
10
  }
@@ -0,0 +1,8 @@
1
+ const namingConventionRules = {
2
+ "@eslint-react/web-api/no-leaked-event-listener": ["error"],
3
+ "@eslint-react/web-api/no-leaked-interval": ["error"],
4
+ "@eslint-react/web-api/no-leaked-resize-observer": ["error"],
5
+ "@eslint-react/web-api/no-leaked-timeout": ["error"]
6
+ };
7
+
8
+ export default namingConventionRules;
@@ -33,7 +33,7 @@ const bestPracticesRules = {
33
33
  "regexp/prefer-regexp-test": "off",
34
34
  "regexp/prefer-set-operation": "error",
35
35
  "regexp/require-unicode-regexp": "error",
36
- // TODO [2024-09-01]: enable when https://github.com/microsoft/vscode/pull/206580 is resolved
36
+ // TODO [2024-11-01]: enable when https://github.com/microsoft/TypeScript-TmLanguage/pull/1032 is resolved
37
37
  "regexp/require-unicode-sets-regexp": "off",
38
38
  "regexp/simplify-set-operations": "error",
39
39
  "regexp/sort-alternatives": "error",
@@ -1,6 +1,6 @@
1
1
  import { minItemsForArrayNewline } from "./_common/_exports.js";
2
2
 
3
- const minPropertiesForObjectNewline = 3;
3
+ const minElementsForCurlyNewline = 3;
4
4
  const wrapMultilinesDefault = "parens-new-line";
5
5
 
6
6
  const bracketsRules = {
@@ -14,6 +14,14 @@ const bracketsRules = {
14
14
  "@stylistic/array-bracket-spacing": ["error", "never"],
15
15
  "@stylistic/arrow-parens": ["error", "always"],
16
16
  "@stylistic/brace-style": ["error", "stroustrup"],
17
+ "@stylistic/curly-newline": [
18
+ "error",
19
+ {
20
+ minElements: minElementsForCurlyNewline,
21
+ consistent: true,
22
+ multiline: true
23
+ }
24
+ ],
17
25
  "@stylistic/function-paren-newline": ["error", "multiline-arguments"],
18
26
  "@stylistic/jsx-closing-bracket-location": "error",
19
27
  "@stylistic/jsx-curly-brace-presence": [
@@ -56,7 +64,7 @@ const bracketsRules = {
56
64
  "@stylistic/object-curly-newline": [
57
65
  "error",
58
66
  {
59
- minProperties: minPropertiesForObjectNewline,
67
+ minProperties: minElementsForCurlyNewline,
60
68
  consistent: true,
61
69
  multiline: true
62
70
  }
@@ -2,7 +2,10 @@ const indentRules = {
2
2
  "@stylistic/indent": [
3
3
  "error",
4
4
  "tab",
5
- { SwitchCase: 1 }
5
+ {
6
+ SwitchCase: 1,
7
+ tabLength: 4
8
+ }
6
9
  ],
7
10
  "@stylistic/indent-binary-ops": ["error", "tab"],
8
11
  "@stylistic/jsx-indent": ["error", "tab"],
@@ -1,6 +1,6 @@
1
1
  const jsxRules = {
2
2
  "@stylistic/jsx-child-element-spacing": "error",
3
- "@stylistic/jsx-closing-tag-location": "error",
3
+ "@stylistic/jsx-closing-tag-location": ["error", "line-aligned"],
4
4
  "@stylistic/jsx-equals-spacing": ["error", "never"],
5
5
  "@stylistic/jsx-max-props-per-line": [
6
6
  "error",
package/rules/unicorn.js CHANGED
@@ -31,10 +31,10 @@ const patterns = {
31
31
  };
32
32
 
33
33
  const unicornRules = {
34
- "unicorn/better-regex": "error",
35
34
  "unicorn/catch-error-name": "error",
36
35
  "unicorn/consistent-destructuring": "error",
37
36
  "unicorn/consistent-empty-array-spread": "error",
37
+ "unicorn/consistent-existence-index-check": "error",
38
38
  "unicorn/consistent-function-scoping": "error",
39
39
  "unicorn/custom-error-definition": "error",
40
40
  "unicorn/empty-brace-spaces": "error",
@@ -142,10 +142,12 @@ const unicornRules = {
142
142
  "unicorn/prefer-dom-node-text-content": "error",
143
143
  "unicorn/prefer-event-target": "error",
144
144
  "unicorn/prefer-export-from": "error",
145
+ "unicorn/prefer-global-this": "error",
145
146
  "unicorn/prefer-includes": "error",
146
147
  "unicorn/prefer-json-parse-buffer": "off",
147
148
  "unicorn/prefer-keyboard-event-key": "error",
148
149
  "unicorn/prefer-logical-operator-over-ternary": "error",
150
+ "unicorn/prefer-math-min-max": "error",
149
151
  "unicorn/prefer-math-trunc": "error",
150
152
  "unicorn/prefer-modern-dom-apis": "error",
151
153
  "unicorn/prefer-modern-math-apis": "error",
@@ -10,7 +10,7 @@ const packageJsonFilePath = join(cwd(), "package.json");
10
10
  const packageJsonFileContent = await readTextFile(packageJsonFilePath);
11
11
  const packageJson = JSON.parse(packageJsonFileContent);
12
12
 
13
- const importMapFilePath = join(cwd(), "import-map.json");
13
+ const importMapFilePath = join(cwd(), "deno.json");
14
14
  const importMapFileContent = await readTextFile(importMapFilePath);
15
15
  const importMap = JSON.parse(importMapFileContent);
16
16
 
package/tsconfig.json CHANGED
@@ -18,7 +18,8 @@
18
18
  "noUncheckedIndexedAccess": false,
19
19
  "noUnusedLocals": false,
20
20
  "noUnusedParameters": false,
21
- "strict": true
21
+ "strict": true,
22
+ "noEmit": true
22
23
  },
23
24
  "include": [
24
25
  "./**/*"
package/import-map.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "imports": {
3
- "@eslint-community/eslint-plugin-eslint-comments": "npm:@eslint-community/eslint-plugin-eslint-comments@^4.3.0",
4
- "@eslint-react/eslint-plugin": "npm:@eslint-react/eslint-plugin@^1.9.1",
5
- "@std/path": "jsr:@std/path@^1",
6
- "@stylistic/eslint-plugin": "npm:@stylistic/eslint-plugin@^2.6.2",
7
- "@typescript-eslint/parser": "npm:@typescript-eslint/parser@^8.0.1",
8
- "eslint-plugin-depend": "npm:eslint-plugin-depend@^0.9.0",
9
- "eslint-plugin-disable-autofix": "npm:eslint-plugin-disable-autofix@^5.0.1",
10
- "eslint-plugin-func-params-args": "npm:eslint-plugin-func-params-args@^4.0.0",
11
- "eslint-plugin-import-x": "npm:eslint-plugin-import-x@^3.1.0",
12
- "eslint-plugin-jsdoc": "npm:eslint-plugin-jsdoc@^50.0.0",
13
- "eslint-plugin-no-secrets": "npm:eslint-plugin-no-secrets@^1.0.2",
14
- "eslint-plugin-perfectionist": "npm:eslint-plugin-perfectionist@^3.1.3",
15
- "eslint-plugin-promise": "npm:eslint-plugin-promise@^7.1.0",
16
- "eslint-plugin-react": "npm:eslint-plugin-react@^7.35.0",
17
- "eslint-plugin-redos": "npm:eslint-plugin-redos@^4.4.5",
18
- "eslint-plugin-regexp": "npm:eslint-plugin-regexp@^2.6.0",
19
- "eslint-plugin-security": "npm:eslint-plugin-security@^3.0.1",
20
- "eslint-plugin-sonarjs": "npm:eslint-plugin-sonarjs@^1.0.4",
21
- "eslint-plugin-tailwindcss": "npm:eslint-plugin-tailwindcss@^3.17.4",
22
- "eslint-plugin-unicorn": "npm:eslint-plugin-unicorn@^55.0.0",
23
- "globals": "npm:globals@^15.9.0",
24
- "preact": "https://esm.sh/*preact@10.19.3?dev",
25
- "preact/jsx-runtime": "https://esm.sh/*preact@10.19.3/jsx-runtime?dev"
26
- }
27
- }