@allthings/eslint-config 3.3.1 → 3.5.0-alpha.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/index.js +18 -6
- package/node.js +15 -6
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import globals from 'globals'
|
|
|
4
4
|
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'
|
|
5
5
|
import importPlugin from 'eslint-plugin-import'
|
|
6
6
|
import jestPlugin from 'eslint-plugin-jest'
|
|
7
|
+
import perfectionistPlugin from 'eslint-plugin-perfectionist'
|
|
7
8
|
import preferArrowPlugin from 'eslint-plugin-prefer-arrow'
|
|
8
9
|
import prettierConfig from 'eslint-plugin-prettier/recommended'
|
|
9
10
|
import reactPlugin from 'eslint-plugin-react'
|
|
10
11
|
import reactHooksPlugin from 'eslint-plugin-react-hooks'
|
|
11
12
|
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
|
|
12
|
-
import typescriptSortKeysPlugin from 'eslint-plugin-typescript-sort-keys'
|
|
13
13
|
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
14
14
|
import vitestPlugin from '@vitest/eslint-plugin'
|
|
15
15
|
|
|
@@ -44,9 +44,9 @@ export default [
|
|
|
44
44
|
plugins: {
|
|
45
45
|
'@stylistic': stylisticPlugin,
|
|
46
46
|
jest: jestPlugin,
|
|
47
|
+
perfectionist: perfectionistPlugin,
|
|
47
48
|
'prefer-arrow': preferArrowPlugin,
|
|
48
49
|
'simple-import-sort': simpleImportSortPlugin,
|
|
49
|
-
'typescript-sort-keys': typescriptSortKeysPlugin,
|
|
50
50
|
},
|
|
51
51
|
settings: {
|
|
52
52
|
react: { version: 'detect' },
|
|
@@ -59,9 +59,13 @@ export default [
|
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
rules: {
|
|
62
|
-
// typescript-sort-keys
|
|
63
|
-
|
|
64
|
-
'
|
|
62
|
+
// perfectionist — replaces eslint-plugin-typescript-sort-keys
|
|
63
|
+
// (string-enum equivalent: sort-enums with default sortByValue: 'ifNumericEnum')
|
|
64
|
+
'perfectionist/sort-enums': 'error',
|
|
65
|
+
'perfectionist/sort-heritage-clauses': 'error',
|
|
66
|
+
'perfectionist/sort-interfaces': 'error',
|
|
67
|
+
'perfectionist/sort-object-types': 'error',
|
|
68
|
+
'perfectionist/sort-union-types': 'error',
|
|
65
69
|
// react-hooks override (recommended-latest has exhaustive-deps as 'warn')
|
|
66
70
|
'react-hooks/exhaustive-deps': 'error',
|
|
67
71
|
'@stylistic/padding-line-between-statements': [
|
|
@@ -271,21 +275,26 @@ export default [
|
|
|
271
275
|
'unicorn/import-style': 'warn',
|
|
272
276
|
'unicorn/no-anonymous-default-export': 'off',
|
|
273
277
|
'unicorn/no-array-reduce': 'off',
|
|
278
|
+
// .reverse() mutates in place — semantic + perf cost to force .toReversed()
|
|
279
|
+
'unicorn/no-array-reverse': 'off',
|
|
280
|
+
// .sort() mutates in place — same story as no-array-reverse
|
|
281
|
+
'unicorn/no-array-sort': 'off',
|
|
274
282
|
'unicorn/no-await-expression-member': 'warn',
|
|
275
283
|
'unicorn/no-console-spaces': 'off',
|
|
276
284
|
'unicorn/no-document-cookie': 'warn',
|
|
277
285
|
'unicorn/no-empty-file': 'off',
|
|
278
286
|
'unicorn/no-hex-escape': 'warn',
|
|
279
287
|
'unicorn/no-invalid-remove-event-listener': 'warn',
|
|
288
|
+
'unicorn/no-named-default': 'warn',
|
|
280
289
|
'unicorn/no-nested-ternary': 'off',
|
|
281
290
|
// because we have a lot of logic depends on null
|
|
282
291
|
'unicorn/no-null': 'warn',
|
|
283
292
|
'unicorn/no-object-as-default-parameter': 'warn',
|
|
284
293
|
'unicorn/no-single-promise-in-promise-methods': 'warn',
|
|
285
294
|
'unicorn/no-unreadable-array-destructuring': 'off',
|
|
286
|
-
'unicorn/no-unsafe-regex': 'off',
|
|
287
295
|
'unicorn/no-unused-properties': 'warn',
|
|
288
296
|
'unicorn/no-zero-fractions': 'off',
|
|
297
|
+
'unicorn/prefer-class-fields': 'warn',
|
|
289
298
|
'unicorn/prefer-export-from': 'off',
|
|
290
299
|
'unicorn/prefer-global-this': 'warn',
|
|
291
300
|
'unicorn/prefer-includes': 'off',
|
|
@@ -298,6 +307,8 @@ export default [
|
|
|
298
307
|
'unicorn/prefer-regexp-test': 'off',
|
|
299
308
|
'unicorn/prefer-set-has': 'off',
|
|
300
309
|
'unicorn/prefer-set-size': 'off',
|
|
310
|
+
// opinionated condition ordering — too noisy
|
|
311
|
+
'unicorn/prefer-simple-condition-first': 'off',
|
|
301
312
|
'unicorn/prefer-string-raw': 'off',
|
|
302
313
|
'unicorn/prefer-string-replace-all': 'off',
|
|
303
314
|
'unicorn/prefer-structured-clone': 'warn',
|
|
@@ -319,6 +330,7 @@ export default [
|
|
|
319
330
|
},
|
|
320
331
|
],
|
|
321
332
|
'unicorn/relative-url-style': 'off',
|
|
333
|
+
'unicorn/require-module-attributes': 'warn',
|
|
322
334
|
'unicorn/switch-case-braces': 'off',
|
|
323
335
|
'unicorn/template-indent': 'off',
|
|
324
336
|
'use-isnan': 'error',
|
package/node.js
CHANGED
|
@@ -3,10 +3,10 @@ import tsPlugin from '@typescript-eslint/eslint-plugin'
|
|
|
3
3
|
import globals from 'globals'
|
|
4
4
|
import importPlugin from 'eslint-plugin-import'
|
|
5
5
|
import jestPlugin from 'eslint-plugin-jest'
|
|
6
|
+
import perfectionistPlugin from 'eslint-plugin-perfectionist'
|
|
6
7
|
import preferArrowPlugin from 'eslint-plugin-prefer-arrow'
|
|
7
8
|
import prettierConfig from 'eslint-plugin-prettier/recommended'
|
|
8
9
|
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
|
|
9
|
-
import typescriptSortKeysPlugin from 'eslint-plugin-typescript-sort-keys'
|
|
10
10
|
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
11
11
|
import vitestPlugin from '@vitest/eslint-plugin'
|
|
12
12
|
|
|
@@ -33,9 +33,9 @@ export default [
|
|
|
33
33
|
plugins: {
|
|
34
34
|
'@stylistic': stylisticPlugin,
|
|
35
35
|
jest: jestPlugin,
|
|
36
|
+
perfectionist: perfectionistPlugin,
|
|
36
37
|
'prefer-arrow': preferArrowPlugin,
|
|
37
38
|
'simple-import-sort': simpleImportSortPlugin,
|
|
38
|
-
'typescript-sort-keys': typescriptSortKeysPlugin,
|
|
39
39
|
},
|
|
40
40
|
settings: {
|
|
41
41
|
'import/parsers': {
|
|
@@ -47,9 +47,13 @@ export default [
|
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
rules: {
|
|
50
|
-
// typescript-sort-keys
|
|
51
|
-
|
|
52
|
-
'
|
|
50
|
+
// perfectionist — replaces eslint-plugin-typescript-sort-keys
|
|
51
|
+
// (string-enum equivalent: sort-enums with default sortByValue: 'ifNumericEnum')
|
|
52
|
+
'perfectionist/sort-enums': 'error',
|
|
53
|
+
'perfectionist/sort-heritage-clauses': 'error',
|
|
54
|
+
'perfectionist/sort-interfaces': 'error',
|
|
55
|
+
'perfectionist/sort-object-types': 'error',
|
|
56
|
+
'perfectionist/sort-union-types': 'error',
|
|
53
57
|
'@stylistic/padding-line-between-statements': [
|
|
54
58
|
'error',
|
|
55
59
|
{
|
|
@@ -236,21 +240,24 @@ export default [
|
|
|
236
240
|
'unicorn/import-style': 'warn',
|
|
237
241
|
'unicorn/no-anonymous-default-export': 'off',
|
|
238
242
|
'unicorn/no-array-reduce': 'off',
|
|
243
|
+
'unicorn/no-array-reverse': 'off',
|
|
244
|
+
'unicorn/no-array-sort': 'off',
|
|
239
245
|
'unicorn/no-await-expression-member': 'warn',
|
|
240
246
|
'unicorn/no-console-spaces': 'off',
|
|
241
247
|
'unicorn/no-document-cookie': 'warn',
|
|
242
248
|
'unicorn/no-empty-file': 'off',
|
|
243
249
|
'unicorn/no-hex-escape': 'warn',
|
|
244
250
|
'unicorn/no-invalid-remove-event-listener': 'warn',
|
|
251
|
+
'unicorn/no-named-default': 'warn',
|
|
245
252
|
'unicorn/no-nested-ternary': 'off',
|
|
246
253
|
// because we have a lot of logic depends on null
|
|
247
254
|
'unicorn/no-null': 'warn',
|
|
248
255
|
'unicorn/no-object-as-default-parameter': 'warn',
|
|
249
256
|
'unicorn/no-single-promise-in-promise-methods': 'warn',
|
|
250
257
|
'unicorn/no-unreadable-array-destructuring': 'off',
|
|
251
|
-
'unicorn/no-unsafe-regex': 'off',
|
|
252
258
|
'unicorn/no-unused-properties': 'warn',
|
|
253
259
|
'unicorn/no-zero-fractions': 'off',
|
|
260
|
+
'unicorn/prefer-class-fields': 'warn',
|
|
254
261
|
'unicorn/prefer-export-from': 'off',
|
|
255
262
|
'unicorn/prefer-global-this': 'warn',
|
|
256
263
|
'unicorn/prefer-includes': 'off',
|
|
@@ -263,6 +270,7 @@ export default [
|
|
|
263
270
|
'unicorn/prefer-regexp-test': 'off',
|
|
264
271
|
'unicorn/prefer-set-has': 'off',
|
|
265
272
|
'unicorn/prefer-set-size': 'off',
|
|
273
|
+
'unicorn/prefer-simple-condition-first': 'off',
|
|
266
274
|
'unicorn/prefer-string-raw': 'off',
|
|
267
275
|
'unicorn/prefer-string-replace-all': 'off',
|
|
268
276
|
'unicorn/prefer-structured-clone': 'warn',
|
|
@@ -284,6 +292,7 @@ export default [
|
|
|
284
292
|
},
|
|
285
293
|
],
|
|
286
294
|
'unicorn/relative-url-style': 'off',
|
|
295
|
+
'unicorn/require-module-attributes': 'warn',
|
|
287
296
|
'unicorn/switch-case-braces': 'off',
|
|
288
297
|
'unicorn/template-indent': 'off',
|
|
289
298
|
'use-isnan': 'error',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allthings/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0-alpha.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "ESlint shareable config for Allthings style",
|
|
6
6
|
"main": "index.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"eslint-plugin-import": "^2.32.0",
|
|
40
40
|
"eslint-plugin-jest": "^29.0.0",
|
|
41
41
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
42
|
+
"eslint-plugin-perfectionist": "^5.9.0",
|
|
42
43
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
43
44
|
"eslint-plugin-prettier": "^5.5.4",
|
|
44
45
|
"eslint-plugin-react": "^7.37.5",
|
|
45
46
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
46
47
|
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
47
|
-
"eslint-plugin-
|
|
48
|
-
"eslint-plugin-unicorn": "^56.0.1",
|
|
48
|
+
"eslint-plugin-unicorn": "^64.0.0",
|
|
49
49
|
"globals": "^17.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|