@allthings/eslint-config 3.1.0-beta.1 → 3.2.0-beta.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/README.md +11 -0
- package/index.js +17 -20
- package/node.js +17 -20
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -59,6 +59,17 @@ to restore the initial state of dependencies
|
|
|
59
59
|
|
|
60
60
|
Or you could release a dev npm version with `yarn deploy:dev`. Remember to update the version in package.json
|
|
61
61
|
|
|
62
|
+
### Testing the config
|
|
63
|
+
|
|
64
|
+
The config is protected by a two-layer pipeline that runs in CI on every push:
|
|
65
|
+
|
|
66
|
+
- **`yarn test:audit`** — static rule audit. Loads each config and verifies every enabled rule still resolves in its plugin (catches rules removed or renamed by a dependency bump). Reports any rules whose `meta.deprecated` is set so we can migrate before they disappear.
|
|
67
|
+
- **`yarn test:behavioral`** — fixture-based check. Lints `test/fixtures/full/` against `index.js` and `test/fixtures/node/` against `node.js`. Files under `src/clean/` must lint with zero errors; files under `src/violations/` must trigger the rule IDs declared in `manifest.json`.
|
|
68
|
+
|
|
69
|
+
`yarn test` runs both. The CI workflow exposes them as separate steps so a Renovate PR makes it clear which layer regressed.
|
|
70
|
+
|
|
71
|
+
When adding or modifying a rule that consumers rely on, add a fixture line that exercises it — either a clean usage in `clean/` or a violation file with a `manifest.json` entry.
|
|
72
|
+
|
|
62
73
|
### Production release
|
|
63
74
|
|
|
64
75
|
!! DO NOT `npm version` !!
|
package/index.js
CHANGED
|
@@ -75,6 +75,14 @@ export default [
|
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
77
|
],
|
|
78
|
+
'@stylistic/padding-line-between-statements': [
|
|
79
|
+
'error',
|
|
80
|
+
{
|
|
81
|
+
blankLine: 'always',
|
|
82
|
+
prev: '*',
|
|
83
|
+
next: 'return',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
78
86
|
'@stylistic/quotes': [
|
|
79
87
|
'error',
|
|
80
88
|
'single',
|
|
@@ -83,6 +91,13 @@ export default [
|
|
|
83
91
|
},
|
|
84
92
|
],
|
|
85
93
|
'@stylistic/semi': ['error', 'never'],
|
|
94
|
+
'@stylistic/spaced-comment': [
|
|
95
|
+
'error',
|
|
96
|
+
'always',
|
|
97
|
+
{
|
|
98
|
+
markers: ['/'],
|
|
99
|
+
},
|
|
100
|
+
],
|
|
86
101
|
'@stylistic/type-annotation-spacing': 'error',
|
|
87
102
|
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
88
103
|
'@typescript-eslint/array-type': [
|
|
@@ -117,7 +132,7 @@ export default [
|
|
|
117
132
|
'@typescript-eslint/no-base-to-string': 'warn',
|
|
118
133
|
// need for tests' mockups
|
|
119
134
|
'@typescript-eslint/no-empty-function': 'warn',
|
|
120
|
-
'@typescript-eslint/no-empty-
|
|
135
|
+
'@typescript-eslint/no-empty-object-type': 'error',
|
|
121
136
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
122
137
|
// turn on later
|
|
123
138
|
'@typescript-eslint/no-floating-promises': 'warn',
|
|
@@ -126,7 +141,7 @@ export default [
|
|
|
126
141
|
'@typescript-eslint/no-misused-new': 'error',
|
|
127
142
|
'@typescript-eslint/no-namespace': 'error',
|
|
128
143
|
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
|
129
|
-
'@typescript-eslint/no-require-imports': '
|
|
144
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
130
145
|
'@typescript-eslint/no-shadow': [
|
|
131
146
|
'error',
|
|
132
147
|
{
|
|
@@ -147,7 +162,6 @@ export default [
|
|
|
147
162
|
{ varsIgnorePattern: '^jsx$' },
|
|
148
163
|
],
|
|
149
164
|
'@typescript-eslint/no-use-before-define': 'error',
|
|
150
|
-
'@typescript-eslint/no-var-requires': 'error',
|
|
151
165
|
'@typescript-eslint/prefer-for-of': 'error',
|
|
152
166
|
'@typescript-eslint/prefer-function-type': 'error',
|
|
153
167
|
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
@@ -162,7 +176,6 @@ export default [
|
|
|
162
176
|
lib: 'always',
|
|
163
177
|
},
|
|
164
178
|
],
|
|
165
|
-
'@typescript-eslint/typedef': 'error',
|
|
166
179
|
'@typescript-eslint/unified-signatures': 'error',
|
|
167
180
|
'arrow-body-style': ['error', 'as-needed'],
|
|
168
181
|
complexity: [
|
|
@@ -226,7 +239,6 @@ export default [
|
|
|
226
239
|
'no-new-wrappers': 'error',
|
|
227
240
|
'no-param-reassign': 'error',
|
|
228
241
|
'no-redeclare': 'error',
|
|
229
|
-
'no-return-await': 'error',
|
|
230
242
|
'no-sequences': 'error',
|
|
231
243
|
'no-sparse-arrays': 'error',
|
|
232
244
|
'no-template-curly-in-string': 'error',
|
|
@@ -238,14 +250,6 @@ export default [
|
|
|
238
250
|
'no-var': 'error',
|
|
239
251
|
'object-shorthand': 'error',
|
|
240
252
|
'one-var': ['error', 'never'],
|
|
241
|
-
'padding-line-between-statements': [
|
|
242
|
-
'error',
|
|
243
|
-
{
|
|
244
|
-
blankLine: 'always',
|
|
245
|
-
prev: '*',
|
|
246
|
-
next: 'return',
|
|
247
|
-
},
|
|
248
|
-
],
|
|
249
253
|
'prefer-arrow/prefer-arrow-functions': 'warn',
|
|
250
254
|
'prefer-const': 'error',
|
|
251
255
|
'prefer-object-spread': 'error',
|
|
@@ -273,13 +277,6 @@ export default [
|
|
|
273
277
|
'simple-import-sort/exports': 'error',
|
|
274
278
|
'simple-import-sort/imports': 'error',
|
|
275
279
|
'sort-keys': 'error',
|
|
276
|
-
'spaced-comment': [
|
|
277
|
-
'error',
|
|
278
|
-
'always',
|
|
279
|
-
{
|
|
280
|
-
markers: ['/'],
|
|
281
|
-
},
|
|
282
|
-
],
|
|
283
280
|
'unicorn/better-regex': 'off',
|
|
284
281
|
'unicorn/consistent-existence-index-check': 'off',
|
|
285
282
|
'unicorn/expiring-todo-comments': 'off',
|
package/node.js
CHANGED
|
@@ -61,6 +61,14 @@ export default [
|
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
],
|
|
64
|
+
'@stylistic/padding-line-between-statements': [
|
|
65
|
+
'error',
|
|
66
|
+
{
|
|
67
|
+
blankLine: 'always',
|
|
68
|
+
prev: '*',
|
|
69
|
+
next: 'return',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
64
72
|
'@stylistic/quotes': [
|
|
65
73
|
'error',
|
|
66
74
|
'single',
|
|
@@ -69,6 +77,13 @@ export default [
|
|
|
69
77
|
},
|
|
70
78
|
],
|
|
71
79
|
'@stylistic/semi': ['error', 'never'],
|
|
80
|
+
'@stylistic/spaced-comment': [
|
|
81
|
+
'error',
|
|
82
|
+
'always',
|
|
83
|
+
{
|
|
84
|
+
markers: ['/'],
|
|
85
|
+
},
|
|
86
|
+
],
|
|
72
87
|
'@stylistic/type-annotation-spacing': 'error',
|
|
73
88
|
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
74
89
|
'@typescript-eslint/array-type': [
|
|
@@ -104,7 +119,7 @@ export default [
|
|
|
104
119
|
'@typescript-eslint/no-base-to-string': 'warn',
|
|
105
120
|
// need for tests' mockups
|
|
106
121
|
'@typescript-eslint/no-empty-function': 'warn',
|
|
107
|
-
'@typescript-eslint/no-empty-
|
|
122
|
+
'@typescript-eslint/no-empty-object-type': 'error',
|
|
108
123
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
109
124
|
// turn on later
|
|
110
125
|
'@typescript-eslint/no-floating-promises': 'warn',
|
|
@@ -113,7 +128,7 @@ export default [
|
|
|
113
128
|
'@typescript-eslint/no-misused-new': 'error',
|
|
114
129
|
'@typescript-eslint/no-namespace': 'error',
|
|
115
130
|
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
|
116
|
-
'@typescript-eslint/no-require-imports': '
|
|
131
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
117
132
|
'@typescript-eslint/no-shadow': [
|
|
118
133
|
'error',
|
|
119
134
|
{
|
|
@@ -130,7 +145,6 @@ export default [
|
|
|
130
145
|
'@typescript-eslint/no-unused-expressions': 'error',
|
|
131
146
|
'@typescript-eslint/no-unused-vars': 'error',
|
|
132
147
|
'@typescript-eslint/no-use-before-define': 'error',
|
|
133
|
-
'@typescript-eslint/no-var-requires': 'error',
|
|
134
148
|
'@typescript-eslint/prefer-for-of': 'error',
|
|
135
149
|
'@typescript-eslint/prefer-function-type': 'error',
|
|
136
150
|
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
@@ -145,7 +159,6 @@ export default [
|
|
|
145
159
|
lib: 'always',
|
|
146
160
|
},
|
|
147
161
|
],
|
|
148
|
-
'@typescript-eslint/typedef': 'error',
|
|
149
162
|
'@typescript-eslint/unified-signatures': 'error',
|
|
150
163
|
'arrow-body-style': ['error', 'as-needed'],
|
|
151
164
|
complexity: [
|
|
@@ -209,7 +222,6 @@ export default [
|
|
|
209
222
|
'no-new-wrappers': 'error',
|
|
210
223
|
'no-param-reassign': 'error',
|
|
211
224
|
'no-redeclare': 'error',
|
|
212
|
-
'no-return-await': 'error',
|
|
213
225
|
'no-sequences': 'error',
|
|
214
226
|
'no-sparse-arrays': 'error',
|
|
215
227
|
'no-template-curly-in-string': 'error',
|
|
@@ -221,14 +233,6 @@ export default [
|
|
|
221
233
|
'no-var': 'error',
|
|
222
234
|
'object-shorthand': 'error',
|
|
223
235
|
'one-var': ['error', 'never'],
|
|
224
|
-
'padding-line-between-statements': [
|
|
225
|
-
'error',
|
|
226
|
-
{
|
|
227
|
-
blankLine: 'always',
|
|
228
|
-
prev: '*',
|
|
229
|
-
next: 'return',
|
|
230
|
-
},
|
|
231
|
-
],
|
|
232
236
|
'prefer-arrow/prefer-arrow-functions': 'warn',
|
|
233
237
|
'prefer-const': 'error',
|
|
234
238
|
'prefer-object-spread': 'error',
|
|
@@ -238,13 +242,6 @@ export default [
|
|
|
238
242
|
'simple-import-sort/exports': 'error',
|
|
239
243
|
'simple-import-sort/imports': 'error',
|
|
240
244
|
'sort-keys': 'error',
|
|
241
|
-
'spaced-comment': [
|
|
242
|
-
'error',
|
|
243
|
-
'always',
|
|
244
|
-
{
|
|
245
|
-
markers: ['/'],
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
245
|
'unicorn/better-regex': 'off',
|
|
249
246
|
'unicorn/consistent-existence-index-check': 'off',
|
|
250
247
|
'unicorn/expiring-todo-comments': 'off',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allthings/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "ESlint shareable config for Allthings style",
|
|
6
6
|
"main": "index.js",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"lint": "prettier --check .",
|
|
25
25
|
"semantic-release": "semantic-release",
|
|
26
|
-
"test": "
|
|
26
|
+
"test": "yarn test:audit && yarn test:behavioral",
|
|
27
|
+
"test:audit": "node test/audit.js",
|
|
28
|
+
"test:behavioral": "node test/behavioral.js",
|
|
27
29
|
"deps": "yarn upgrade-interactive --latest"
|
|
28
30
|
},
|
|
29
31
|
"dependencies": {
|
|
@@ -52,8 +54,11 @@
|
|
|
52
54
|
"typescript": ">=5.9.0"
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
57
|
+
"@types/jest": "30.0.0",
|
|
58
|
+
"@types/react": "18.3.28",
|
|
55
59
|
"eslint": "9.39.4",
|
|
56
60
|
"prettier": "3.8.1",
|
|
61
|
+
"react": "18.3.1",
|
|
57
62
|
"semantic-release": "25.0.3",
|
|
58
63
|
"typescript": "5.9.3"
|
|
59
64
|
},
|