@allthings/eslint-config 2.1.0 → 2.2.0-dev.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/index.js +42 -64
- package/node.js +30 -64
- package/package.json +23 -20
package/index.js
CHANGED
|
@@ -42,6 +42,7 @@ const hookPropertyMap = new Map(
|
|
|
42
42
|
],
|
|
43
43
|
['eslint-plugin-prefer-arrow', 'eslint-plugin-prefer-arrow'],
|
|
44
44
|
['eslint-plugin-simple-import-sort', 'eslint-plugin-simple-import-sort'],
|
|
45
|
+
['@stylistic/eslint-plugin', '@stylistic/eslint-plugin'],
|
|
45
46
|
].map(([request, replacement]) => [
|
|
46
47
|
request,
|
|
47
48
|
require.resolve(replacement, { paths: sortedPaths }),
|
|
@@ -66,15 +67,16 @@ module.exports = {
|
|
|
66
67
|
'plugin:import/recommended',
|
|
67
68
|
'plugin:import/typescript',
|
|
68
69
|
'eslint:recommended',
|
|
69
|
-
'plugin:@typescript-eslint/
|
|
70
|
-
'plugin:@typescript-eslint/
|
|
70
|
+
'plugin:@typescript-eslint/recommended-type-checked',
|
|
71
|
+
'plugin:@typescript-eslint/stylistic-type-checked',
|
|
71
72
|
'plugin:typescript-sort-keys/recommended',
|
|
72
73
|
'plugin:react/recommended',
|
|
73
|
-
'plugin:react-hooks/recommended',
|
|
74
|
+
'plugin:react-hooks/recommended-legacy',
|
|
74
75
|
'plugin:react/jsx-runtime',
|
|
75
76
|
'plugin:prettier/recommended',
|
|
76
77
|
],
|
|
77
78
|
plugins: [
|
|
79
|
+
'@stylistic',
|
|
78
80
|
'unicorn',
|
|
79
81
|
'jest',
|
|
80
82
|
'import',
|
|
@@ -86,50 +88,37 @@ module.exports = {
|
|
|
86
88
|
'simple-import-sort',
|
|
87
89
|
],
|
|
88
90
|
rules: {
|
|
89
|
-
'@
|
|
90
|
-
'@typescript-eslint/array-type': [
|
|
91
|
+
'@stylistic/member-delimiter-style': [
|
|
91
92
|
'error',
|
|
92
93
|
{
|
|
93
|
-
|
|
94
|
+
multiline: {
|
|
95
|
+
delimiter: 'none',
|
|
96
|
+
requireLast: true,
|
|
97
|
+
},
|
|
98
|
+
singleline: {
|
|
99
|
+
delimiter: 'semi',
|
|
100
|
+
requireLast: false,
|
|
101
|
+
},
|
|
94
102
|
},
|
|
95
103
|
],
|
|
96
|
-
'@
|
|
104
|
+
'@stylistic/quotes': [
|
|
97
105
|
'error',
|
|
106
|
+
'single',
|
|
98
107
|
{
|
|
99
|
-
|
|
100
|
-
Object: {
|
|
101
|
-
message: 'Avoid using the `Object` type. Did you mean `object`?',
|
|
102
|
-
},
|
|
103
|
-
Function: {
|
|
104
|
-
message:
|
|
105
|
-
'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.',
|
|
106
|
-
},
|
|
107
|
-
Boolean: {
|
|
108
|
-
message: 'Avoid using the `Boolean` type. Did you mean `boolean`?',
|
|
109
|
-
},
|
|
110
|
-
Number: {
|
|
111
|
-
message: 'Avoid using the `Number` type. Did you mean `number`?',
|
|
112
|
-
},
|
|
113
|
-
String: {
|
|
114
|
-
message: 'Avoid using the `String` type. Did you mean `string`?',
|
|
115
|
-
},
|
|
116
|
-
Symbol: {
|
|
117
|
-
message: 'Avoid using the `Symbol` type. Did you mean `symbol`?',
|
|
118
|
-
},
|
|
119
|
-
},
|
|
108
|
+
avoidEscape: true,
|
|
120
109
|
},
|
|
121
110
|
],
|
|
122
|
-
'@
|
|
123
|
-
'@
|
|
124
|
-
|
|
111
|
+
'@stylistic/semi': ['error', 'never'],
|
|
112
|
+
'@stylistic/type-annotation-spacing': 'error',
|
|
113
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
114
|
+
'@typescript-eslint/array-type': [
|
|
115
|
+
'error',
|
|
125
116
|
{
|
|
126
|
-
|
|
127
|
-
allowTypedFunctionExpressions: false,
|
|
128
|
-
allowHigherOrderFunctions: false,
|
|
129
|
-
allowDirectConstAssertionInArrowFunctions: true,
|
|
130
|
-
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
|
|
117
|
+
default: 'array',
|
|
131
118
|
},
|
|
132
119
|
],
|
|
120
|
+
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
121
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
133
122
|
'@typescript-eslint/explicit-module-boundary-types': [
|
|
134
123
|
'warn', // TODO: strict later
|
|
135
124
|
{
|
|
@@ -139,19 +128,6 @@ module.exports = {
|
|
|
139
128
|
allowTypedFunctionExpressions: false,
|
|
140
129
|
},
|
|
141
130
|
],
|
|
142
|
-
'@typescript-eslint/member-delimiter-style': [
|
|
143
|
-
'error',
|
|
144
|
-
{
|
|
145
|
-
multiline: {
|
|
146
|
-
delimiter: 'none',
|
|
147
|
-
requireLast: true,
|
|
148
|
-
},
|
|
149
|
-
singleline: {
|
|
150
|
-
delimiter: 'semi',
|
|
151
|
-
requireLast: false,
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
131
|
'@typescript-eslint/naming-convention': [
|
|
156
132
|
'error',
|
|
157
133
|
{
|
|
@@ -187,14 +163,7 @@ module.exports = {
|
|
|
187
163
|
'@typescript-eslint/prefer-for-of': 'error',
|
|
188
164
|
'@typescript-eslint/prefer-function-type': 'error',
|
|
189
165
|
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
190
|
-
'@typescript-eslint/
|
|
191
|
-
'error',
|
|
192
|
-
'single',
|
|
193
|
-
{
|
|
194
|
-
avoidEscape: true,
|
|
195
|
-
},
|
|
196
|
-
],
|
|
197
|
-
'@typescript-eslint/semi': ['error', 'never'],
|
|
166
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
|
|
198
167
|
'@typescript-eslint/triple-slash-reference': [
|
|
199
168
|
'error',
|
|
200
169
|
{
|
|
@@ -203,7 +172,6 @@ module.exports = {
|
|
|
203
172
|
lib: 'always',
|
|
204
173
|
},
|
|
205
174
|
],
|
|
206
|
-
'@typescript-eslint/type-annotation-spacing': 'error',
|
|
207
175
|
'@typescript-eslint/typedef': 'error',
|
|
208
176
|
'@typescript-eslint/unified-signatures': 'error',
|
|
209
177
|
'arrow-body-style': ['error', 'as-needed'],
|
|
@@ -334,6 +302,7 @@ module.exports = {
|
|
|
334
302
|
},
|
|
335
303
|
],
|
|
336
304
|
'unicorn/import-style': 'warn',
|
|
305
|
+
'unicorn/no-anonymous-default-export': 'off',
|
|
337
306
|
'unicorn/no-array-reduce': 'off',
|
|
338
307
|
'unicorn/no-console-spaces': 'off',
|
|
339
308
|
'unicorn/no-document-cookie': 'warn',
|
|
@@ -346,8 +315,20 @@ module.exports = {
|
|
|
346
315
|
'unicorn/no-unsafe-regex': 'off',
|
|
347
316
|
'unicorn/no-unused-properties': 'warn',
|
|
348
317
|
'unicorn/no-zero-fractions': 'off',
|
|
318
|
+
'unicorn/prevent-abbreviations': [
|
|
319
|
+
'error',
|
|
320
|
+
{
|
|
321
|
+
replacements: {
|
|
322
|
+
props: {
|
|
323
|
+
properties: false,
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
],
|
|
349
328
|
'unicorn/prefer-export-from': 'off',
|
|
329
|
+
'unicorn/prefer-global-this': 'warn',
|
|
350
330
|
'unicorn/prefer-includes': 'off',
|
|
331
|
+
'unicorn/prefer-math-min-max': 'warn',
|
|
351
332
|
'unicorn/prefer-module': 'warn',
|
|
352
333
|
'unicorn/prefer-optional-catch-binding': 'off',
|
|
353
334
|
'unicorn/prefer-prototype-methods': 'off',
|
|
@@ -355,7 +336,9 @@ module.exports = {
|
|
|
355
336
|
'unicorn/prefer-regexp-test': 'off',
|
|
356
337
|
'unicorn/prefer-set-has': 'off',
|
|
357
338
|
'unicorn/prefer-set-size': 'off',
|
|
339
|
+
'unicorn/prefer-string-raw': 'off',
|
|
358
340
|
'unicorn/prefer-string-replace-all': 'off',
|
|
341
|
+
'unicorn/prefer-structured-clone': 'warn',
|
|
359
342
|
'unicorn/prefer-node-protocol': 'off',
|
|
360
343
|
'unicorn/relative-url-style': 'off',
|
|
361
344
|
'unicorn/switch-case-braces': 'off',
|
|
@@ -412,12 +395,7 @@ module.exports = {
|
|
|
412
395
|
// because of jest
|
|
413
396
|
files: ['*.test.ts'],
|
|
414
397
|
rules: {
|
|
415
|
-
'@typescript-eslint/explicit-function-return-type':
|
|
416
|
-
'warn',
|
|
417
|
-
{
|
|
418
|
-
allowTypedFunctionExpressions: true,
|
|
419
|
-
},
|
|
420
|
-
],
|
|
398
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
421
399
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
422
400
|
},
|
|
423
401
|
},
|
package/node.js
CHANGED
|
@@ -37,6 +37,7 @@ const hookPropertyMap = new Map(
|
|
|
37
37
|
],
|
|
38
38
|
['eslint-plugin-prefer-arrow', 'eslint-plugin-prefer-arrow'],
|
|
39
39
|
['eslint-plugin-simple-import-sort', 'eslint-plugin-simple-import-sort'],
|
|
40
|
+
['@stylistic/eslint-plugin', '@stylistic/eslint-plugin'],
|
|
40
41
|
].map(([request, replacement]) => [
|
|
41
42
|
request,
|
|
42
43
|
require.resolve(replacement, { paths: sortedPaths }),
|
|
@@ -61,12 +62,13 @@ module.exports = {
|
|
|
61
62
|
'plugin:import/recommended',
|
|
62
63
|
'plugin:import/typescript',
|
|
63
64
|
'eslint:recommended',
|
|
64
|
-
'plugin:@typescript-eslint/
|
|
65
|
-
'plugin:@typescript-eslint/
|
|
65
|
+
'plugin:@typescript-eslint/recommended-type-checked',
|
|
66
|
+
'plugin:@typescript-eslint/stylistic-type-checked',
|
|
66
67
|
'plugin:typescript-sort-keys/recommended',
|
|
67
68
|
'plugin:prettier/recommended',
|
|
68
69
|
],
|
|
69
70
|
plugins: [
|
|
71
|
+
'@stylistic',
|
|
70
72
|
'unicorn',
|
|
71
73
|
'jest',
|
|
72
74
|
'import',
|
|
@@ -75,51 +77,38 @@ module.exports = {
|
|
|
75
77
|
'simple-import-sort',
|
|
76
78
|
],
|
|
77
79
|
rules: {
|
|
78
|
-
'@
|
|
79
|
-
'@typescript-eslint/array-type': [
|
|
80
|
+
'@stylistic/member-delimiter-style': [
|
|
80
81
|
'error',
|
|
81
82
|
{
|
|
82
|
-
|
|
83
|
+
multiline: {
|
|
84
|
+
delimiter: 'none',
|
|
85
|
+
requireLast: true,
|
|
86
|
+
},
|
|
87
|
+
singleline: {
|
|
88
|
+
delimiter: 'semi',
|
|
89
|
+
requireLast: false,
|
|
90
|
+
},
|
|
83
91
|
},
|
|
84
92
|
],
|
|
85
|
-
'@
|
|
93
|
+
'@stylistic/quotes': [
|
|
86
94
|
'error',
|
|
95
|
+
'single',
|
|
87
96
|
{
|
|
88
|
-
|
|
89
|
-
Object: {
|
|
90
|
-
message: 'Avoid using the `Object` type. Did you mean `object`?',
|
|
91
|
-
},
|
|
92
|
-
Function: {
|
|
93
|
-
message:
|
|
94
|
-
'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.',
|
|
95
|
-
},
|
|
96
|
-
Boolean: {
|
|
97
|
-
message: 'Avoid using the `Boolean` type. Did you mean `boolean`?',
|
|
98
|
-
},
|
|
99
|
-
Number: {
|
|
100
|
-
message: 'Avoid using the `Number` type. Did you mean `number`?',
|
|
101
|
-
},
|
|
102
|
-
String: {
|
|
103
|
-
message: 'Avoid using the `String` type. Did you mean `string`?',
|
|
104
|
-
},
|
|
105
|
-
Symbol: {
|
|
106
|
-
message: 'Avoid using the `Symbol` type. Did you mean `symbol`?',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
97
|
+
avoidEscape: true,
|
|
109
98
|
},
|
|
110
99
|
],
|
|
111
|
-
'@
|
|
112
|
-
'@
|
|
113
|
-
'@typescript-eslint/
|
|
114
|
-
|
|
100
|
+
'@stylistic/semi': ['error', 'never'],
|
|
101
|
+
'@stylistic/type-annotation-spacing': 'error',
|
|
102
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
103
|
+
'@typescript-eslint/array-type': [
|
|
104
|
+
'error',
|
|
115
105
|
{
|
|
116
|
-
|
|
117
|
-
allowTypedFunctionExpressions: false,
|
|
118
|
-
allowHigherOrderFunctions: false,
|
|
119
|
-
allowDirectConstAssertionInArrowFunctions: true,
|
|
120
|
-
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
|
|
106
|
+
default: 'array',
|
|
121
107
|
},
|
|
122
108
|
],
|
|
109
|
+
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
110
|
+
'@typescript-eslint/dot-notation': 'error',
|
|
111
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
123
112
|
'@typescript-eslint/explicit-module-boundary-types': [
|
|
124
113
|
'warn', // TODO: strict later
|
|
125
114
|
{
|
|
@@ -129,19 +118,6 @@ module.exports = {
|
|
|
129
118
|
allowTypedFunctionExpressions: false,
|
|
130
119
|
},
|
|
131
120
|
],
|
|
132
|
-
'@typescript-eslint/member-delimiter-style': [
|
|
133
|
-
'error',
|
|
134
|
-
{
|
|
135
|
-
multiline: {
|
|
136
|
-
delimiter: 'none',
|
|
137
|
-
requireLast: true,
|
|
138
|
-
},
|
|
139
|
-
singleline: {
|
|
140
|
-
delimiter: 'semi',
|
|
141
|
-
requireLast: false,
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
121
|
'@typescript-eslint/naming-convention': [
|
|
146
122
|
'error',
|
|
147
123
|
{
|
|
@@ -174,14 +150,6 @@ module.exports = {
|
|
|
174
150
|
'@typescript-eslint/prefer-for-of': 'error',
|
|
175
151
|
'@typescript-eslint/prefer-function-type': 'error',
|
|
176
152
|
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
177
|
-
'@typescript-eslint/quotes': [
|
|
178
|
-
'error',
|
|
179
|
-
'single',
|
|
180
|
-
{
|
|
181
|
-
avoidEscape: true,
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
'@typescript-eslint/semi': ['error', 'never'],
|
|
185
153
|
'@typescript-eslint/triple-slash-reference': [
|
|
186
154
|
'error',
|
|
187
155
|
{
|
|
@@ -190,7 +158,6 @@ module.exports = {
|
|
|
190
158
|
lib: 'always',
|
|
191
159
|
},
|
|
192
160
|
],
|
|
193
|
-
'@typescript-eslint/type-annotation-spacing': 'error',
|
|
194
161
|
'@typescript-eslint/typedef': 'error',
|
|
195
162
|
'@typescript-eslint/unified-signatures': 'error',
|
|
196
163
|
'arrow-body-style': ['error', 'as-needed'],
|
|
@@ -316,7 +283,9 @@ module.exports = {
|
|
|
316
283
|
'unicorn/no-unused-properties': 'warn',
|
|
317
284
|
'unicorn/no-zero-fractions': 'off',
|
|
318
285
|
'unicorn/prefer-export-from': 'off',
|
|
286
|
+
'unicorn/prefer-global-this': 'warn',
|
|
319
287
|
'unicorn/prefer-includes': 'off',
|
|
288
|
+
'unicorn/prefer-math-min-max': 'warn',
|
|
320
289
|
'unicorn/prefer-module': 'warn',
|
|
321
290
|
'unicorn/prefer-optional-catch-binding': 'off',
|
|
322
291
|
'unicorn/prefer-prototype-methods': 'off',
|
|
@@ -324,7 +293,9 @@ module.exports = {
|
|
|
324
293
|
'unicorn/prefer-regexp-test': 'off',
|
|
325
294
|
'unicorn/prefer-set-has': 'off',
|
|
326
295
|
'unicorn/prefer-set-size': 'off',
|
|
296
|
+
'unicorn/prefer-string-raw': 'off',
|
|
327
297
|
'unicorn/prefer-string-replace-all': 'off',
|
|
298
|
+
'unicorn/prefer-structured-clone': 'warn',
|
|
328
299
|
'unicorn/relative-url-style': 'off',
|
|
329
300
|
'unicorn/switch-case-braces': 'off',
|
|
330
301
|
'unicorn/template-indent': 'off',
|
|
@@ -377,12 +348,7 @@ module.exports = {
|
|
|
377
348
|
// because of jest
|
|
378
349
|
files: ['*.test.ts'],
|
|
379
350
|
rules: {
|
|
380
|
-
'@typescript-eslint/explicit-function-return-type':
|
|
381
|
-
'warn',
|
|
382
|
-
{
|
|
383
|
-
allowTypedFunctionExpressions: true,
|
|
384
|
-
},
|
|
385
|
-
],
|
|
351
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
386
352
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
387
353
|
},
|
|
388
354
|
},
|
package/package.json
CHANGED
|
@@ -1,48 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allthings/eslint-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-dev.0",
|
|
4
4
|
"description": "ESlint shareable config for Allthings style",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"index.js",
|
|
8
8
|
"node.js"
|
|
9
9
|
],
|
|
10
|
+
"packageManager": "yarn@1.22.22",
|
|
10
11
|
"scripts": {
|
|
11
12
|
"lint": "prettier --check .",
|
|
12
13
|
"test": "eslint test/",
|
|
13
14
|
"predeploy": "yarn test",
|
|
14
15
|
"deploy": "yarn publish --new-version $npm_package_version --tag latest --access public",
|
|
16
|
+
"deploy:dev": "yarn publish --new-version $npm_package_version --tag dev --access public",
|
|
15
17
|
"postdeploy": "git push --tags origin HEAD",
|
|
16
18
|
"deps": "yarn upgrade-interactive --latest"
|
|
17
19
|
},
|
|
18
20
|
"dependencies": {
|
|
19
|
-
"@rushstack/eslint-patch": "^1.
|
|
20
|
-
"@
|
|
21
|
-
"@typescript-eslint/
|
|
22
|
-
"eslint
|
|
21
|
+
"@rushstack/eslint-patch": "^1.11.0",
|
|
22
|
+
"@stylistic/eslint-plugin": "3.1.0",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
24
|
+
"@typescript-eslint/parser": "^8.32.1",
|
|
25
|
+
"eslint-config-prettier": "^10.1.5",
|
|
23
26
|
"eslint-import-resolver-node": "^0.3.9",
|
|
24
|
-
"eslint-import-resolver-typescript": "^3.
|
|
25
|
-
"eslint-plugin-import": "^2.
|
|
26
|
-
"eslint-plugin-jest": "^27.6.
|
|
27
|
+
"eslint-import-resolver-typescript": "^4.3.4",
|
|
28
|
+
"eslint-plugin-import": "^2.31.0",
|
|
29
|
+
"eslint-plugin-jest": "^27.6.3",
|
|
27
30
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
28
|
-
"eslint-plugin-n": "^
|
|
31
|
+
"eslint-plugin-n": "^17.18.0",
|
|
29
32
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
30
|
-
"eslint-plugin-prettier": "^5.0
|
|
31
|
-
"eslint-plugin-react": "^7.
|
|
32
|
-
"eslint-plugin-react-hooks": "^
|
|
33
|
-
"eslint-plugin-simple-import-sort": "^
|
|
33
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
34
|
+
"eslint-plugin-react": "^7.37.5",
|
|
35
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
36
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
34
37
|
"eslint-plugin-typescript-sort-keys": "^3.1.0",
|
|
35
|
-
"eslint-plugin-unicorn": "^
|
|
38
|
+
"eslint-plugin-unicorn": "^56.0.1"
|
|
36
39
|
},
|
|
37
40
|
"peerDependencies": {
|
|
38
|
-
"eslint": "
|
|
39
|
-
"prettier": ">=3.
|
|
40
|
-
"typescript": ">=4"
|
|
41
|
+
"eslint": "^8.56.0",
|
|
42
|
+
"prettier": ">=3.5.0",
|
|
43
|
+
"typescript": ">=4.7.4"
|
|
41
44
|
},
|
|
42
45
|
"devDependencies": {
|
|
43
|
-
"eslint": "^8.
|
|
44
|
-
"prettier": "^3.
|
|
45
|
-
"typescript": "
|
|
46
|
+
"eslint": "^8.56.0",
|
|
47
|
+
"prettier": "^3.5.3",
|
|
48
|
+
"typescript": "^5.8.3"
|
|
46
49
|
},
|
|
47
50
|
"keywords": [
|
|
48
51
|
"eslint",
|