@storm-software/eslint 0.148.20 → 0.148.21
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 +1 -1
- package/dist/{chunk-DKJ6VCEL.js → chunk-2AFQKKSX.js} +91 -63
- package/dist/{chunk-G4SCUHQO.js → chunk-5ALLOW52.js} +2 -5
- package/dist/{chunk-D3EN5HD2.js → chunk-DLORY5AL.js} +4 -6
- package/dist/{chunk-SZFP4QOA.js → chunk-HO6DXXZX.js} +24 -45
- package/dist/{chunk-G7QVU75O.js → chunk-RU7GXBCG.js} +30 -42
- package/dist/{chunk-7JRBTALJ.js → chunk-WYU7W4UW.js} +21 -13
- package/dist/{chunk-FTXILLLE.js → chunk-Z2ZQTZDC.js} +2 -6
- package/dist/preset.js +603 -1147
- package/dist/utils/banner-plugin.js +2 -3
- package/dist/utils/combine.js +0 -5
- package/dist/utils/constants.js +0 -1
- package/dist/utils/correct-paths.js +1 -2
- package/dist/utils/find-workspace-root.js +2 -3
- package/dist/utils/format-config.js +1 -2
- package/dist/utils/get-file-banner.js +1 -2
- package/dist/utils/helpers.js +1 -2
- package/dist/utils/index.js +1 -2
- package/dist/utils/tsconfig-path.js +2 -3
- package/package.json +1 -1
- package/dist/chunk-SHUYVCID.js +0 -6
package/dist/preset.js
CHANGED
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
isPackageInScope,
|
|
6
6
|
parserPlain,
|
|
7
7
|
renameRules
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HO6DXXZX.js";
|
|
9
9
|
import {
|
|
10
10
|
getTsConfigPath
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DLORY5AL.js";
|
|
12
12
|
import {
|
|
13
13
|
banner_plugin_default
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-2AFQKKSX.js";
|
|
15
|
+
import "./chunk-5ALLOW52.js";
|
|
16
16
|
import {
|
|
17
17
|
GLOB_ASTRO,
|
|
18
18
|
GLOB_ASTRO_TS,
|
|
@@ -42,13 +42,10 @@ import {
|
|
|
42
42
|
} from "./chunk-EJ2FSS2J.js";
|
|
43
43
|
import {
|
|
44
44
|
findWorkspaceRoot
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-WYU7W4UW.js";
|
|
46
46
|
import {
|
|
47
47
|
joinPaths
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import {
|
|
50
|
-
__name
|
|
51
|
-
} from "./chunk-SHUYVCID.js";
|
|
48
|
+
} from "./chunk-RU7GXBCG.js";
|
|
52
49
|
|
|
53
50
|
// src/preset.ts
|
|
54
51
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
@@ -56,9 +53,7 @@ import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
|
56
53
|
|
|
57
54
|
// src/configs/astro.ts
|
|
58
55
|
async function astro(options = {}) {
|
|
59
|
-
const { files = [
|
|
60
|
-
GLOB_ASTRO
|
|
61
|
-
], overrides = {}, stylistic: stylistic2 = true } = options;
|
|
56
|
+
const { files = [GLOB_ASTRO], overrides = {}, stylistic: stylistic2 = true } = options;
|
|
62
57
|
const [pluginAstro, parserAstro, parserTs] = await Promise.all([
|
|
63
58
|
interopDefault(import("eslint-plugin-astro")),
|
|
64
59
|
interopDefault(import("astro-eslint-parser")),
|
|
@@ -77,9 +72,7 @@ async function astro(options = {}) {
|
|
|
77
72
|
globals: pluginAstro.environments.astro.globals,
|
|
78
73
|
parser: parserAstro,
|
|
79
74
|
parserOptions: {
|
|
80
|
-
extraFileExtensions: [
|
|
81
|
-
".astro"
|
|
82
|
-
],
|
|
75
|
+
extraFileExtensions: [".astro"],
|
|
83
76
|
parser: parserTs
|
|
84
77
|
},
|
|
85
78
|
sourceType: "module"
|
|
@@ -109,7 +102,6 @@ async function astro(options = {}) {
|
|
|
109
102
|
}
|
|
110
103
|
];
|
|
111
104
|
}
|
|
112
|
-
__name(astro, "astro");
|
|
113
105
|
|
|
114
106
|
// src/configs/cspell.ts
|
|
115
107
|
import cspellConfig from "@cspell/eslint-plugin/recommended";
|
|
@@ -135,15 +127,12 @@ async function cspell(options = {}) {
|
|
|
135
127
|
}
|
|
136
128
|
];
|
|
137
129
|
}
|
|
138
|
-
__name(cspell, "cspell");
|
|
139
130
|
|
|
140
131
|
// src/configs/disables.ts
|
|
141
132
|
async function disables() {
|
|
142
133
|
return [
|
|
143
134
|
{
|
|
144
|
-
files: [
|
|
145
|
-
`**/scripts/${GLOB_SRC}`
|
|
146
|
-
],
|
|
135
|
+
files: [`**/scripts/${GLOB_SRC}`],
|
|
147
136
|
name: "storm/disables/scripts",
|
|
148
137
|
rules: {
|
|
149
138
|
"no-console": "off",
|
|
@@ -151,19 +140,14 @@ async function disables() {
|
|
|
151
140
|
}
|
|
152
141
|
},
|
|
153
142
|
{
|
|
154
|
-
files: [
|
|
155
|
-
`**/cli/${GLOB_SRC}`,
|
|
156
|
-
`**/cli.${GLOB_SRC_EXT}`
|
|
157
|
-
],
|
|
143
|
+
files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
158
144
|
name: "storm/disables/cli",
|
|
159
145
|
rules: {
|
|
160
146
|
"no-console": "off"
|
|
161
147
|
}
|
|
162
148
|
},
|
|
163
149
|
{
|
|
164
|
-
files: [
|
|
165
|
-
"**/*.d.?([cm])ts"
|
|
166
|
-
],
|
|
150
|
+
files: ["**/*.d.?([cm])ts"],
|
|
167
151
|
name: "storm/disables/dts",
|
|
168
152
|
rules: {
|
|
169
153
|
"eslint-comments/no-unlimited-disable": "off",
|
|
@@ -173,20 +157,14 @@ async function disables() {
|
|
|
173
157
|
}
|
|
174
158
|
},
|
|
175
159
|
{
|
|
176
|
-
files: [
|
|
177
|
-
"**/*.js",
|
|
178
|
-
"**/*.cjs"
|
|
179
|
-
],
|
|
160
|
+
files: ["**/*.js", "**/*.cjs"],
|
|
180
161
|
name: "storm/disables/cjs",
|
|
181
162
|
rules: {
|
|
182
163
|
"ts/no-require-imports": "off"
|
|
183
164
|
}
|
|
184
165
|
},
|
|
185
166
|
{
|
|
186
|
-
files: [
|
|
187
|
-
`**/*.config.${GLOB_SRC_EXT}`,
|
|
188
|
-
`**/*.config.*.${GLOB_SRC_EXT}`
|
|
189
|
-
],
|
|
167
|
+
files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
|
|
190
168
|
name: "storm/disables/config-files",
|
|
191
169
|
rules: {
|
|
192
170
|
"no-console": "off",
|
|
@@ -195,7 +173,6 @@ async function disables() {
|
|
|
195
173
|
}
|
|
196
174
|
];
|
|
197
175
|
}
|
|
198
|
-
__name(disables, "disables");
|
|
199
176
|
|
|
200
177
|
// src/configs/formatters.ts
|
|
201
178
|
import defu from "defu";
|
|
@@ -208,11 +185,20 @@ var StylisticConfigDefaults = {
|
|
|
208
185
|
semi: true
|
|
209
186
|
};
|
|
210
187
|
async function stylistic(options = {}) {
|
|
211
|
-
const {
|
|
188
|
+
const {
|
|
189
|
+
indent = 2,
|
|
190
|
+
jsx: jsx2 = true,
|
|
191
|
+
overrides = {},
|
|
192
|
+
quotes = "double",
|
|
193
|
+
semi = true,
|
|
194
|
+
lineEndings = "unix"
|
|
195
|
+
} = {
|
|
212
196
|
...StylisticConfigDefaults,
|
|
213
197
|
...options
|
|
214
198
|
};
|
|
215
|
-
const pluginStylistic = await interopDefault(
|
|
199
|
+
const pluginStylistic = await interopDefault(
|
|
200
|
+
import("@stylistic/eslint-plugin")
|
|
201
|
+
);
|
|
216
202
|
const config2 = pluginStylistic.configs.customize({
|
|
217
203
|
indent,
|
|
218
204
|
jsx: jsx2,
|
|
@@ -229,78 +215,37 @@ async function stylistic(options = {}) {
|
|
|
229
215
|
rules: {
|
|
230
216
|
...config2.rules,
|
|
231
217
|
"style/lines-around-comment": "off",
|
|
232
|
-
"style/linebreak-style": [
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
],
|
|
236
|
-
"style/
|
|
237
|
-
|
|
238
|
-
"never"
|
|
239
|
-
],
|
|
240
|
-
"style/comma-style": [
|
|
241
|
-
"error",
|
|
242
|
-
"last"
|
|
243
|
-
],
|
|
244
|
-
"style/quotes": [
|
|
245
|
-
"error",
|
|
246
|
-
quotes
|
|
247
|
-
],
|
|
248
|
-
"style/semi": [
|
|
249
|
-
"error",
|
|
250
|
-
semi ? "always" : "never"
|
|
251
|
-
],
|
|
252
|
-
"style/indent": [
|
|
253
|
-
"error",
|
|
254
|
-
indent,
|
|
255
|
-
{
|
|
256
|
-
SwitchCase: 1
|
|
257
|
-
}
|
|
258
|
-
],
|
|
218
|
+
"style/linebreak-style": ["error", lineEndings],
|
|
219
|
+
"style/comma-dangle": ["error", "never"],
|
|
220
|
+
"style/comma-style": ["error", "last"],
|
|
221
|
+
"style/quotes": ["error", quotes],
|
|
222
|
+
"style/semi": ["error", semi ? "always" : "never"],
|
|
223
|
+
"style/indent": ["error", indent, { SwitchCase: 1 }],
|
|
259
224
|
"style/operator-linebreak": [
|
|
260
225
|
"error",
|
|
261
226
|
"after",
|
|
262
|
-
{
|
|
263
|
-
overrides: {
|
|
264
|
-
"=": "none",
|
|
265
|
-
"?": "before",
|
|
266
|
-
":": "before"
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
],
|
|
270
|
-
"style/jsx-indent": [
|
|
271
|
-
"error",
|
|
272
|
-
indent
|
|
227
|
+
{ overrides: { "=": "none", "?": "before", ":": "before" } }
|
|
273
228
|
],
|
|
229
|
+
"style/jsx-indent": ["error", indent],
|
|
274
230
|
"style/jsx-quotes": [
|
|
275
231
|
"error",
|
|
276
232
|
quotes === "single" ? "prefer-single" : "prefer-double"
|
|
277
233
|
],
|
|
278
|
-
"style/brace-style": [
|
|
279
|
-
"error",
|
|
280
|
-
"1tbs",
|
|
281
|
-
{
|
|
282
|
-
allowSingleLine: false
|
|
283
|
-
}
|
|
284
|
-
],
|
|
234
|
+
"style/brace-style": ["error", "1tbs", { allowSingleLine: false }],
|
|
285
235
|
...overrides
|
|
286
236
|
}
|
|
287
237
|
}
|
|
288
238
|
];
|
|
289
239
|
}
|
|
290
|
-
__name(stylistic, "stylistic");
|
|
291
240
|
|
|
292
241
|
// src/configs/formatters.ts
|
|
293
242
|
function mergePrettierOptions(options, overrides = {}) {
|
|
294
243
|
return {
|
|
295
244
|
...options,
|
|
296
245
|
...overrides,
|
|
297
|
-
plugins: [
|
|
298
|
-
...overrides.plugins || [],
|
|
299
|
-
...options.plugins || []
|
|
300
|
-
]
|
|
246
|
+
plugins: [...overrides.plugins || [], ...options.plugins || []]
|
|
301
247
|
};
|
|
302
248
|
}
|
|
303
|
-
__name(mergePrettierOptions, "mergePrettierOptions");
|
|
304
249
|
async function formatters(options = {}, stylistic2 = {}) {
|
|
305
250
|
if (options === true) {
|
|
306
251
|
const isPrettierPluginXmlInScope = isPackageInScope("@prettier/plugin-xml");
|
|
@@ -319,35 +264,45 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
319
264
|
options.astro ? "prettier-plugin-astro" : void 0,
|
|
320
265
|
options.xml || options.svg ? "@prettier/plugin-xml" : void 0
|
|
321
266
|
]);
|
|
322
|
-
const {
|
|
267
|
+
const {
|
|
268
|
+
indent = 2,
|
|
269
|
+
quotes = "double",
|
|
270
|
+
semi = true
|
|
271
|
+
} = {
|
|
323
272
|
...StylisticConfigDefaults,
|
|
324
273
|
...stylistic2
|
|
325
274
|
};
|
|
326
|
-
const prettierOptions = defu(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
275
|
+
const prettierOptions = defu(
|
|
276
|
+
{
|
|
277
|
+
proseWrap: "always",
|
|
278
|
+
quoteProps: "preserve",
|
|
279
|
+
bracketSameLine: true,
|
|
280
|
+
bracketSpacing: true,
|
|
281
|
+
arrowParens: "avoid",
|
|
282
|
+
endOfLine: "lf",
|
|
283
|
+
printWidth: 120,
|
|
284
|
+
semi,
|
|
285
|
+
singleQuote: quotes === "single",
|
|
286
|
+
tabWidth: typeof indent === "number" ? indent : 2,
|
|
287
|
+
trailingComma: "none",
|
|
288
|
+
useTabs: indent === "tab"
|
|
289
|
+
},
|
|
290
|
+
options.prettierOptions ?? {}
|
|
291
|
+
);
|
|
340
292
|
const prettierXmlOptions = {
|
|
341
293
|
xmlQuoteAttributes: "double",
|
|
342
294
|
xmlSelfClosingSpace: true,
|
|
343
295
|
xmlSortAttributesByKey: false,
|
|
344
296
|
xmlWhitespaceSensitivity: "ignore"
|
|
345
297
|
};
|
|
346
|
-
const dprintOptions = defu(
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
298
|
+
const dprintOptions = defu(
|
|
299
|
+
{
|
|
300
|
+
indentWidth: typeof indent === "number" ? indent : 2,
|
|
301
|
+
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
302
|
+
useTabs: indent === "tab"
|
|
303
|
+
},
|
|
304
|
+
options.dprintOptions ?? {}
|
|
305
|
+
);
|
|
351
306
|
const pluginFormat = await interopDefault(import("eslint-plugin-format"));
|
|
352
307
|
const configs3 = [
|
|
353
308
|
{
|
|
@@ -358,62 +313,57 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
358
313
|
}
|
|
359
314
|
];
|
|
360
315
|
if (options.css) {
|
|
361
|
-
configs3.push(
|
|
362
|
-
|
|
363
|
-
GLOB_CSS,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
]
|
|
377
|
-
}
|
|
378
|
-
}, {
|
|
379
|
-
files: [
|
|
380
|
-
GLOB_SCSS
|
|
381
|
-
],
|
|
382
|
-
languageOptions: {
|
|
383
|
-
parser: parserPlain
|
|
316
|
+
configs3.push(
|
|
317
|
+
{
|
|
318
|
+
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
319
|
+
languageOptions: {
|
|
320
|
+
parser: parserPlain
|
|
321
|
+
},
|
|
322
|
+
name: "storm/formatter/css",
|
|
323
|
+
rules: {
|
|
324
|
+
"format/prettier": [
|
|
325
|
+
"error",
|
|
326
|
+
mergePrettierOptions(prettierOptions, {
|
|
327
|
+
parser: "css"
|
|
328
|
+
})
|
|
329
|
+
]
|
|
330
|
+
}
|
|
384
331
|
},
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
parser: parserPlain
|
|
332
|
+
{
|
|
333
|
+
files: [GLOB_SCSS],
|
|
334
|
+
languageOptions: {
|
|
335
|
+
parser: parserPlain
|
|
336
|
+
},
|
|
337
|
+
name: "storm/formatter/scss",
|
|
338
|
+
rules: {
|
|
339
|
+
"format/prettier": [
|
|
340
|
+
"error",
|
|
341
|
+
mergePrettierOptions(prettierOptions, {
|
|
342
|
+
parser: "scss"
|
|
343
|
+
})
|
|
344
|
+
]
|
|
345
|
+
}
|
|
400
346
|
},
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
347
|
+
{
|
|
348
|
+
files: [GLOB_LESS],
|
|
349
|
+
languageOptions: {
|
|
350
|
+
parser: parserPlain
|
|
351
|
+
},
|
|
352
|
+
name: "storm/formatter/less",
|
|
353
|
+
rules: {
|
|
354
|
+
"format/prettier": [
|
|
355
|
+
"error",
|
|
356
|
+
mergePrettierOptions(prettierOptions, {
|
|
357
|
+
parser: "less"
|
|
358
|
+
})
|
|
359
|
+
]
|
|
360
|
+
}
|
|
409
361
|
}
|
|
410
|
-
|
|
362
|
+
);
|
|
411
363
|
}
|
|
412
364
|
if (options.html) {
|
|
413
365
|
configs3.push({
|
|
414
|
-
files: [
|
|
415
|
-
GLOB_HTML
|
|
416
|
-
],
|
|
366
|
+
files: [GLOB_HTML],
|
|
417
367
|
languageOptions: {
|
|
418
368
|
parser: parserPlain
|
|
419
369
|
},
|
|
@@ -430,9 +380,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
430
380
|
}
|
|
431
381
|
if (options.xml) {
|
|
432
382
|
configs3.push({
|
|
433
|
-
files: [
|
|
434
|
-
GLOB_XML
|
|
435
|
-
],
|
|
383
|
+
files: [GLOB_XML],
|
|
436
384
|
languageOptions: {
|
|
437
385
|
parser: parserPlain
|
|
438
386
|
},
|
|
@@ -440,24 +388,20 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
440
388
|
rules: {
|
|
441
389
|
"format/prettier": [
|
|
442
390
|
"error",
|
|
443
|
-
mergePrettierOptions(
|
|
444
|
-
...prettierXmlOptions,
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
]
|
|
451
|
-
})
|
|
391
|
+
mergePrettierOptions(
|
|
392
|
+
{ ...prettierXmlOptions, ...prettierOptions },
|
|
393
|
+
{
|
|
394
|
+
parser: "xml",
|
|
395
|
+
plugins: ["@prettier/plugin-xml"]
|
|
396
|
+
}
|
|
397
|
+
)
|
|
452
398
|
]
|
|
453
399
|
}
|
|
454
400
|
});
|
|
455
401
|
}
|
|
456
402
|
if (options.svg) {
|
|
457
403
|
configs3.push({
|
|
458
|
-
files: [
|
|
459
|
-
GLOB_SVG
|
|
460
|
-
],
|
|
404
|
+
files: [GLOB_SVG],
|
|
461
405
|
languageOptions: {
|
|
462
406
|
parser: parserPlain
|
|
463
407
|
},
|
|
@@ -465,15 +409,13 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
465
409
|
rules: {
|
|
466
410
|
"format/prettier": [
|
|
467
411
|
"error",
|
|
468
|
-
mergePrettierOptions(
|
|
469
|
-
...prettierXmlOptions,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
]
|
|
476
|
-
})
|
|
412
|
+
mergePrettierOptions(
|
|
413
|
+
{ ...prettierXmlOptions, ...prettierOptions },
|
|
414
|
+
{
|
|
415
|
+
parser: "xml",
|
|
416
|
+
plugins: ["@prettier/plugin-xml"]
|
|
417
|
+
}
|
|
418
|
+
)
|
|
477
419
|
]
|
|
478
420
|
}
|
|
479
421
|
});
|
|
@@ -481,9 +423,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
481
423
|
if (options.markdown) {
|
|
482
424
|
const formater = options.markdown === true ? "prettier" : options.markdown;
|
|
483
425
|
configs3.push({
|
|
484
|
-
files: [
|
|
485
|
-
GLOB_MARKDOWN
|
|
486
|
-
],
|
|
426
|
+
files: [GLOB_MARKDOWN],
|
|
487
427
|
languageOptions: {
|
|
488
428
|
parser: parserPlain
|
|
489
429
|
},
|
|
@@ -504,9 +444,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
504
444
|
}
|
|
505
445
|
if (options.astro) {
|
|
506
446
|
configs3.push({
|
|
507
|
-
files: [
|
|
508
|
-
GLOB_ASTRO
|
|
509
|
-
],
|
|
447
|
+
files: [GLOB_ASTRO],
|
|
510
448
|
languageOptions: {
|
|
511
449
|
parser: parserPlain
|
|
512
450
|
},
|
|
@@ -516,18 +454,13 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
516
454
|
"error",
|
|
517
455
|
mergePrettierOptions(prettierOptions, {
|
|
518
456
|
parser: "astro",
|
|
519
|
-
plugins: [
|
|
520
|
-
"prettier-plugin-astro"
|
|
521
|
-
]
|
|
457
|
+
plugins: ["prettier-plugin-astro"]
|
|
522
458
|
})
|
|
523
459
|
]
|
|
524
460
|
}
|
|
525
461
|
});
|
|
526
462
|
configs3.push({
|
|
527
|
-
files: [
|
|
528
|
-
GLOB_ASTRO,
|
|
529
|
-
GLOB_ASTRO_TS
|
|
530
|
-
],
|
|
463
|
+
files: [GLOB_ASTRO, GLOB_ASTRO_TS],
|
|
531
464
|
name: "storm/formatter/astro/disables",
|
|
532
465
|
rules: {
|
|
533
466
|
"style/arrow-parens": "off",
|
|
@@ -542,9 +475,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
542
475
|
}
|
|
543
476
|
if (options.graphql) {
|
|
544
477
|
configs3.push({
|
|
545
|
-
files: [
|
|
546
|
-
GLOB_GRAPHQL
|
|
547
|
-
],
|
|
478
|
+
files: [GLOB_GRAPHQL],
|
|
548
479
|
languageOptions: {
|
|
549
480
|
parser: parserPlain
|
|
550
481
|
},
|
|
@@ -561,11 +492,15 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
561
492
|
}
|
|
562
493
|
return configs3;
|
|
563
494
|
}
|
|
564
|
-
__name(formatters, "formatters");
|
|
565
495
|
|
|
566
496
|
// src/configs/graphql.ts
|
|
567
497
|
async function graphql(options = {}) {
|
|
568
|
-
const {
|
|
498
|
+
const {
|
|
499
|
+
relay = true,
|
|
500
|
+
operations = true,
|
|
501
|
+
schema = true,
|
|
502
|
+
overrides = {}
|
|
503
|
+
} = options;
|
|
569
504
|
await ensurePackages([
|
|
570
505
|
"@graphql-eslint/eslint-plugin",
|
|
571
506
|
"eslint-plugin-relay"
|
|
@@ -577,10 +512,7 @@ async function graphql(options = {}) {
|
|
|
577
512
|
return [
|
|
578
513
|
{
|
|
579
514
|
name: "storm/graphql/setup",
|
|
580
|
-
files: [
|
|
581
|
-
"**/*.graphql",
|
|
582
|
-
"**/*.gql"
|
|
583
|
-
],
|
|
515
|
+
files: ["**/*.graphql", "**/*.gql"],
|
|
584
516
|
languageOptions: {
|
|
585
517
|
parser: pluginGraphQL.parser
|
|
586
518
|
},
|
|
@@ -610,61 +542,32 @@ async function graphql(options = {}) {
|
|
|
610
542
|
DirectiveDefinition: "camelCase",
|
|
611
543
|
EnumValueDefinition: "UPPER_CASE",
|
|
612
544
|
"FieldDefinition[parent.name.value=Query]": {
|
|
613
|
-
forbiddenPrefixes: [
|
|
614
|
-
|
|
615
|
-
"get"
|
|
616
|
-
],
|
|
617
|
-
forbiddenSuffixes: [
|
|
618
|
-
"Query"
|
|
619
|
-
]
|
|
545
|
+
forbiddenPrefixes: ["query", "get"],
|
|
546
|
+
forbiddenSuffixes: ["Query"]
|
|
620
547
|
},
|
|
621
548
|
"FieldDefinition[parent.name.value=Mutation]": {
|
|
622
|
-
forbiddenPrefixes: [
|
|
623
|
-
|
|
624
|
-
],
|
|
625
|
-
forbiddenSuffixes: [
|
|
626
|
-
"Mutation"
|
|
627
|
-
]
|
|
549
|
+
forbiddenPrefixes: ["mutation"],
|
|
550
|
+
forbiddenSuffixes: ["Mutation"]
|
|
628
551
|
},
|
|
629
552
|
"FieldDefinition[parent.name.value=Subscription]": {
|
|
630
|
-
forbiddenPrefixes: [
|
|
631
|
-
|
|
632
|
-
],
|
|
633
|
-
forbiddenSuffixes: [
|
|
634
|
-
"Subscription"
|
|
635
|
-
]
|
|
553
|
+
forbiddenPrefixes: ["subscription"],
|
|
554
|
+
forbiddenSuffixes: ["Subscription"]
|
|
636
555
|
},
|
|
637
556
|
"EnumTypeDefinition,EnumTypeExtension": {
|
|
638
|
-
forbiddenPrefixes: [
|
|
639
|
-
|
|
640
|
-
],
|
|
641
|
-
forbiddenSuffixes: [
|
|
642
|
-
"Enum"
|
|
643
|
-
]
|
|
557
|
+
forbiddenPrefixes: ["Enum"],
|
|
558
|
+
forbiddenSuffixes: ["Enum"]
|
|
644
559
|
},
|
|
645
560
|
"InterfaceTypeDefinition,InterfaceTypeExtension": {
|
|
646
|
-
forbiddenPrefixes: [
|
|
647
|
-
|
|
648
|
-
],
|
|
649
|
-
forbiddenSuffixes: [
|
|
650
|
-
"Interface"
|
|
651
|
-
]
|
|
561
|
+
forbiddenPrefixes: ["Interface"],
|
|
562
|
+
forbiddenSuffixes: ["Interface"]
|
|
652
563
|
},
|
|
653
564
|
"UnionTypeDefinition,UnionTypeExtension": {
|
|
654
|
-
forbiddenPrefixes: [
|
|
655
|
-
|
|
656
|
-
],
|
|
657
|
-
forbiddenSuffixes: [
|
|
658
|
-
"Union"
|
|
659
|
-
]
|
|
565
|
+
forbiddenPrefixes: ["Union"],
|
|
566
|
+
forbiddenSuffixes: ["Union"]
|
|
660
567
|
},
|
|
661
568
|
"ObjectTypeDefinition,ObjectTypeExtension": {
|
|
662
|
-
forbiddenPrefixes: [
|
|
663
|
-
|
|
664
|
-
],
|
|
665
|
-
forbiddenSuffixes: [
|
|
666
|
-
"Type"
|
|
667
|
-
]
|
|
569
|
+
forbiddenPrefixes: ["Type"],
|
|
570
|
+
forbiddenSuffixes: ["Type"]
|
|
668
571
|
}
|
|
669
572
|
}
|
|
670
573
|
],
|
|
@@ -676,11 +579,7 @@ async function graphql(options = {}) {
|
|
|
676
579
|
"@graphql-eslint/require-deprecation-reason": "error",
|
|
677
580
|
"@graphql-eslint/require-description": [
|
|
678
581
|
"error",
|
|
679
|
-
{
|
|
680
|
-
types: true,
|
|
681
|
-
DirectiveDefinition: true,
|
|
682
|
-
rootField: true
|
|
683
|
-
}
|
|
582
|
+
{ types: true, DirectiveDefinition: true, rootField: true }
|
|
684
583
|
],
|
|
685
584
|
"@graphql-eslint/strict-id-in-types": "error",
|
|
686
585
|
"@graphql-eslint/unique-directive-names": "error",
|
|
@@ -711,20 +610,12 @@ async function graphql(options = {}) {
|
|
|
711
610
|
"Subscription",
|
|
712
611
|
"Get"
|
|
713
612
|
],
|
|
714
|
-
forbiddenSuffixes: [
|
|
715
|
-
"Query",
|
|
716
|
-
"Mutation",
|
|
717
|
-
"Subscription"
|
|
718
|
-
]
|
|
613
|
+
forbiddenSuffixes: ["Query", "Mutation", "Subscription"]
|
|
719
614
|
},
|
|
720
615
|
FragmentDefinition: {
|
|
721
616
|
style: "PascalCase",
|
|
722
|
-
forbiddenPrefixes: [
|
|
723
|
-
|
|
724
|
-
],
|
|
725
|
-
forbiddenSuffixes: [
|
|
726
|
-
"Fragment"
|
|
727
|
-
]
|
|
617
|
+
forbiddenPrefixes: ["Fragment"],
|
|
618
|
+
forbiddenSuffixes: ["Fragment"]
|
|
728
619
|
}
|
|
729
620
|
}
|
|
730
621
|
],
|
|
@@ -741,12 +632,7 @@ async function graphql(options = {}) {
|
|
|
741
632
|
"@graphql-eslint/provided-required-arguments": "error",
|
|
742
633
|
"@graphql-eslint/require-selections": "error",
|
|
743
634
|
"@graphql-eslint/scalar-leafs": "error",
|
|
744
|
-
"@graphql-eslint/selection-set-depth": [
|
|
745
|
-
"error",
|
|
746
|
-
{
|
|
747
|
-
maxDepth: 7
|
|
748
|
-
}
|
|
749
|
-
],
|
|
635
|
+
"@graphql-eslint/selection-set-depth": ["error", { maxDepth: 7 }],
|
|
750
636
|
"@graphql-eslint/unique-argument-names": "error",
|
|
751
637
|
"@graphql-eslint/unique-directive-names-per-location": "error",
|
|
752
638
|
"@graphql-eslint/unique-fragment-name": "error",
|
|
@@ -762,9 +648,7 @@ async function graphql(options = {}) {
|
|
|
762
648
|
},
|
|
763
649
|
relay ? {
|
|
764
650
|
name: "storm/graphql/relay",
|
|
765
|
-
plugins: {
|
|
766
|
-
relay: pluginRelay
|
|
767
|
-
},
|
|
651
|
+
plugins: { relay: pluginRelay },
|
|
768
652
|
rules: {
|
|
769
653
|
// errors
|
|
770
654
|
"relay/graphql-syntax": "error",
|
|
@@ -786,21 +670,16 @@ async function graphql(options = {}) {
|
|
|
786
670
|
} : {}
|
|
787
671
|
];
|
|
788
672
|
}
|
|
789
|
-
__name(graphql, "graphql");
|
|
790
673
|
|
|
791
674
|
// src/configs/ignores.ts
|
|
792
675
|
async function ignores(userIgnores = []) {
|
|
793
676
|
return [
|
|
794
677
|
{
|
|
795
|
-
ignores: [
|
|
796
|
-
...GLOB_EXCLUDE,
|
|
797
|
-
...userIgnores
|
|
798
|
-
],
|
|
678
|
+
ignores: [...GLOB_EXCLUDE, ...userIgnores],
|
|
799
679
|
name: "storm/ignores"
|
|
800
680
|
}
|
|
801
681
|
];
|
|
802
682
|
}
|
|
803
|
-
__name(ignores, "ignores");
|
|
804
683
|
|
|
805
684
|
// src/plugins.ts
|
|
806
685
|
import { default as default2 } from "@cspell/eslint-plugin";
|
|
@@ -823,7 +702,7 @@ var name = "eslint-plugin-pnpm";
|
|
|
823
702
|
var version = "0.3.0";
|
|
824
703
|
var blobUrl = "https://github.com/antfu/eslint-plugin-pnpm/blob/main/src/rules/";
|
|
825
704
|
function RuleCreator(urlCreator) {
|
|
826
|
-
return
|
|
705
|
+
return function createNamedRule({
|
|
827
706
|
name: name2,
|
|
828
707
|
meta,
|
|
829
708
|
...rule
|
|
@@ -838,16 +717,15 @@ function RuleCreator(urlCreator) {
|
|
|
838
717
|
},
|
|
839
718
|
...rule
|
|
840
719
|
});
|
|
841
|
-
}
|
|
720
|
+
};
|
|
842
721
|
}
|
|
843
|
-
__name(RuleCreator, "RuleCreator");
|
|
844
722
|
function createRule({
|
|
845
723
|
create,
|
|
846
724
|
defaultOptions,
|
|
847
725
|
meta
|
|
848
726
|
}) {
|
|
849
727
|
return {
|
|
850
|
-
create:
|
|
728
|
+
create: (context) => {
|
|
851
729
|
const optionsWithDefault = context.options.map((options, index) => {
|
|
852
730
|
return {
|
|
853
731
|
...defaultOptions[index] || {},
|
|
@@ -855,12 +733,11 @@ function createRule({
|
|
|
855
733
|
};
|
|
856
734
|
});
|
|
857
735
|
return create(context, optionsWithDefault);
|
|
858
|
-
},
|
|
736
|
+
},
|
|
859
737
|
defaultOptions,
|
|
860
738
|
meta
|
|
861
739
|
};
|
|
862
740
|
}
|
|
863
|
-
__name(createRule, "createRule");
|
|
864
741
|
var createEslintRule = RuleCreator(
|
|
865
742
|
(ruleName) => `${blobUrl}${ruleName}.test.ts`
|
|
866
743
|
);
|
|
@@ -872,7 +749,6 @@ function getPackageJsonRootNode(context) {
|
|
|
872
749
|
if (root.expression.type === "JSONObjectExpression")
|
|
873
750
|
return root.expression;
|
|
874
751
|
}
|
|
875
|
-
__name(getPackageJsonRootNode, "getPackageJsonRootNode");
|
|
876
752
|
function* iterateDependencies(context, fields) {
|
|
877
753
|
const root = getPackageJsonRootNode(context);
|
|
878
754
|
if (!root)
|
|
@@ -905,7 +781,6 @@ function* iterateDependencies(context, fields) {
|
|
|
905
781
|
}
|
|
906
782
|
}
|
|
907
783
|
}
|
|
908
|
-
__name(iterateDependencies, "iterateDependencies");
|
|
909
784
|
function readPnpmWorkspace() {
|
|
910
785
|
const filepath = findUpSync("pnpm-workspace.yaml", { cwd: process.cwd() });
|
|
911
786
|
if (!filepath)
|
|
@@ -914,11 +789,11 @@ function readPnpmWorkspace() {
|
|
|
914
789
|
const workspace2 = parsePnpmWorkspaceYaml(content);
|
|
915
790
|
let queueTimer;
|
|
916
791
|
const queue = [];
|
|
917
|
-
const write =
|
|
792
|
+
const write = () => {
|
|
918
793
|
fs.writeFileSync(filepath, workspace2.toString());
|
|
919
|
-
}
|
|
920
|
-
const hasQueue =
|
|
921
|
-
const queueChange =
|
|
794
|
+
};
|
|
795
|
+
const hasQueue = () => queueTimer != null;
|
|
796
|
+
const queueChange = (fn, order) => {
|
|
922
797
|
if (order === "pre")
|
|
923
798
|
queue.unshift(fn);
|
|
924
799
|
else
|
|
@@ -934,7 +809,7 @@ function readPnpmWorkspace() {
|
|
|
934
809
|
if (workspace2.hasChanged())
|
|
935
810
|
write();
|
|
936
811
|
}, 1e3);
|
|
937
|
-
}
|
|
812
|
+
};
|
|
938
813
|
return {
|
|
939
814
|
filepath,
|
|
940
815
|
...workspace2,
|
|
@@ -942,7 +817,6 @@ function readPnpmWorkspace() {
|
|
|
942
817
|
queueChange
|
|
943
818
|
};
|
|
944
819
|
}
|
|
945
|
-
__name(readPnpmWorkspace, "readPnpmWorkspace");
|
|
946
820
|
var WORKSPACE_CACHE_TIME = 1e4;
|
|
947
821
|
var workspaceLastRead;
|
|
948
822
|
var workspace;
|
|
@@ -956,7 +830,6 @@ function getPnpmWorkspace() {
|
|
|
956
830
|
}
|
|
957
831
|
return workspace;
|
|
958
832
|
}
|
|
959
|
-
__name(getPnpmWorkspace, "getPnpmWorkspace");
|
|
960
833
|
var RULE_NAME$4 = "json-enforce-catalog";
|
|
961
834
|
var DEFAULT_FIELDS$1 = [
|
|
962
835
|
"dependencies",
|
|
@@ -1137,7 +1010,6 @@ var preferWorkspaceSettings = createEslintRule({
|
|
|
1137
1010
|
flatValueParis.push([paths, value]);
|
|
1138
1011
|
}
|
|
1139
1012
|
}
|
|
1140
|
-
__name(traverse, "traverse");
|
|
1141
1013
|
traverse(pnpmSettings, []);
|
|
1142
1014
|
workspace2.queueChange(() => {
|
|
1143
1015
|
for (const [paths, value] of flatValueParis) {
|
|
@@ -1443,7 +1315,6 @@ function getObjectPath(obj, path) {
|
|
|
1443
1315
|
}
|
|
1444
1316
|
return current;
|
|
1445
1317
|
}
|
|
1446
|
-
__name(getObjectPath, "getObjectPath");
|
|
1447
1318
|
var rules$1 = {
|
|
1448
1319
|
"yaml-no-unused-catalog-item": noUnusedCatalogItem,
|
|
1449
1320
|
"yaml-no-duplicate-catalog-item": noDuplicateCatalogItem
|
|
@@ -1521,10 +1392,7 @@ async function imports(options = {}) {
|
|
|
1521
1392
|
import: pluginImport
|
|
1522
1393
|
},
|
|
1523
1394
|
rules: {
|
|
1524
|
-
"import/consistent-type-specifier-style": [
|
|
1525
|
-
"error",
|
|
1526
|
-
"prefer-top-level"
|
|
1527
|
-
],
|
|
1395
|
+
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
1528
1396
|
"import/first": "off",
|
|
1529
1397
|
"import/no-duplicates": "error",
|
|
1530
1398
|
"import/no-mutable-exports": "error",
|
|
@@ -1532,24 +1400,23 @@ async function imports(options = {}) {
|
|
|
1532
1400
|
"import/no-self-import": "error",
|
|
1533
1401
|
"import/no-webpack-loader-syntax": "error",
|
|
1534
1402
|
...stylistic2 ? {
|
|
1535
|
-
"import/newline-after-import": [
|
|
1536
|
-
"error",
|
|
1537
|
-
{
|
|
1538
|
-
count: 1
|
|
1539
|
-
}
|
|
1540
|
-
]
|
|
1403
|
+
"import/newline-after-import": ["error", { count: 1 }]
|
|
1541
1404
|
} : {}
|
|
1542
1405
|
}
|
|
1543
1406
|
}
|
|
1544
1407
|
];
|
|
1545
1408
|
}
|
|
1546
|
-
__name(imports, "imports");
|
|
1547
1409
|
|
|
1548
1410
|
// src/configs/javascript.ts
|
|
1549
1411
|
import defu2 from "defu";
|
|
1550
1412
|
import globalsLib from "globals";
|
|
1551
1413
|
async function javascript(options = {}) {
|
|
1552
|
-
const {
|
|
1414
|
+
const {
|
|
1415
|
+
lineEndings = "unix",
|
|
1416
|
+
overrides = {},
|
|
1417
|
+
repositoryName,
|
|
1418
|
+
globals = {}
|
|
1419
|
+
} = options;
|
|
1553
1420
|
return [
|
|
1554
1421
|
{
|
|
1555
1422
|
name: "storm/javascript/setup",
|
|
@@ -1578,9 +1445,7 @@ async function javascript(options = {}) {
|
|
|
1578
1445
|
// Banner
|
|
1579
1446
|
...banner_plugin_default.configs?.["recommended"],
|
|
1580
1447
|
name: "storm/javascript/banner",
|
|
1581
|
-
plugins: {
|
|
1582
|
-
banner: banner_plugin_default
|
|
1583
|
-
},
|
|
1448
|
+
plugins: { banner: banner_plugin_default },
|
|
1584
1449
|
rules: {
|
|
1585
1450
|
"banner/banner": [
|
|
1586
1451
|
"error",
|
|
@@ -1639,6 +1504,7 @@ async function javascript(options = {}) {
|
|
|
1639
1504
|
nestedBinaryExpressions: false,
|
|
1640
1505
|
returnAssign: false,
|
|
1641
1506
|
ignoreJSX: "all",
|
|
1507
|
+
// delegate to eslint-plugin-react
|
|
1642
1508
|
enforceForArrowConditionals: false
|
|
1643
1509
|
}
|
|
1644
1510
|
],
|
|
@@ -1706,9 +1572,7 @@ async function javascript(options = {}) {
|
|
|
1706
1572
|
// https://eslint.org/docs/rules/no-unsafe-optional-chaining
|
|
1707
1573
|
"no-unsafe-optional-chaining": [
|
|
1708
1574
|
"error",
|
|
1709
|
-
{
|
|
1710
|
-
disallowArithmeticOperators: true
|
|
1711
|
-
}
|
|
1575
|
+
{ disallowArithmeticOperators: true }
|
|
1712
1576
|
],
|
|
1713
1577
|
// Disallow Unused Private Class Members
|
|
1714
1578
|
// https://eslint.org/docs/rules/no-unused-private-class-members
|
|
@@ -1731,60 +1595,32 @@ async function javascript(options = {}) {
|
|
|
1731
1595
|
"valid-jsdoc": "off",
|
|
1732
1596
|
// ensure that the results of typeof are compared against a valid string
|
|
1733
1597
|
// https://eslint.org/docs/rules/valid-typeof
|
|
1734
|
-
"valid-typeof": [
|
|
1735
|
-
"error",
|
|
1736
|
-
{
|
|
1737
|
-
requireStringLiterals: true
|
|
1738
|
-
}
|
|
1739
|
-
],
|
|
1598
|
+
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
1740
1599
|
/*************************************************************
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1600
|
+
*
|
|
1601
|
+
* Stylistic Rules - These rules relate to style guidelines
|
|
1602
|
+
*
|
|
1603
|
+
**************************************************************/
|
|
1745
1604
|
// enforce line breaks after opening and before closing array brackets
|
|
1746
1605
|
// https://eslint.org/docs/rules/array-bracket-newline
|
|
1747
1606
|
// TODO: enable? semver-major
|
|
1748
|
-
"array-bracket-newline": [
|
|
1749
|
-
|
|
1750
|
-
"consistent"
|
|
1751
|
-
],
|
|
1607
|
+
"array-bracket-newline": ["off", "consistent"],
|
|
1608
|
+
// object option alternative: { multiline: true, minItems: 3 }
|
|
1752
1609
|
// enforce line breaks between array elements
|
|
1753
1610
|
// https://eslint.org/docs/rules/array-element-newline
|
|
1754
1611
|
// TODO: enable? semver-major
|
|
1755
|
-
"array-element-newline": [
|
|
1756
|
-
"off",
|
|
1757
|
-
{
|
|
1758
|
-
multiline: true,
|
|
1759
|
-
minItems: 3
|
|
1760
|
-
}
|
|
1761
|
-
],
|
|
1612
|
+
"array-element-newline": ["off", { multiline: true, minItems: 3 }],
|
|
1762
1613
|
// enforce spacing inside array brackets
|
|
1763
|
-
"array-bracket-spacing": [
|
|
1764
|
-
"error",
|
|
1765
|
-
"never"
|
|
1766
|
-
],
|
|
1614
|
+
"array-bracket-spacing": ["error", "never"],
|
|
1767
1615
|
// enforce spacing inside single-line blocks
|
|
1768
1616
|
// https://eslint.org/docs/rules/block-spacing
|
|
1769
|
-
"block-spacing": [
|
|
1770
|
-
"error",
|
|
1771
|
-
"always"
|
|
1772
|
-
],
|
|
1617
|
+
"block-spacing": ["error", "always"],
|
|
1773
1618
|
// enforce one true brace style
|
|
1774
|
-
"brace-style": [
|
|
1775
|
-
"error",
|
|
1776
|
-
"1tbs",
|
|
1777
|
-
{
|
|
1778
|
-
allowSingleLine: true
|
|
1779
|
-
}
|
|
1780
|
-
],
|
|
1619
|
+
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
|
|
1781
1620
|
// require camel case names
|
|
1782
1621
|
camelcase: [
|
|
1783
1622
|
"error",
|
|
1784
|
-
{
|
|
1785
|
-
properties: "never",
|
|
1786
|
-
ignoreDestructuring: false
|
|
1787
|
-
}
|
|
1623
|
+
{ properties: "never", ignoreDestructuring: false }
|
|
1788
1624
|
],
|
|
1789
1625
|
// enforce or disallow capitalization of the first letter of a comment
|
|
1790
1626
|
// https://eslint.org/docs/rules/capitalized-comments
|
|
@@ -1805,18 +1641,9 @@ async function javascript(options = {}) {
|
|
|
1805
1641
|
}
|
|
1806
1642
|
],
|
|
1807
1643
|
// require trailing commas in multiline object literals
|
|
1808
|
-
"comma-dangle": [
|
|
1809
|
-
"error",
|
|
1810
|
-
"never"
|
|
1811
|
-
],
|
|
1644
|
+
"comma-dangle": ["error", "never"],
|
|
1812
1645
|
// enforce spacing before and after comma
|
|
1813
|
-
"comma-spacing": [
|
|
1814
|
-
"error",
|
|
1815
|
-
{
|
|
1816
|
-
before: false,
|
|
1817
|
-
after: true
|
|
1818
|
-
}
|
|
1819
|
-
],
|
|
1646
|
+
"comma-spacing": ["error", { before: false, after: true }],
|
|
1820
1647
|
// enforce one true comma style
|
|
1821
1648
|
"comma-style": [
|
|
1822
1649
|
"error",
|
|
@@ -1838,28 +1665,16 @@ async function javascript(options = {}) {
|
|
|
1838
1665
|
}
|
|
1839
1666
|
],
|
|
1840
1667
|
// disallow padding inside computed properties
|
|
1841
|
-
"computed-property-spacing": [
|
|
1842
|
-
"error",
|
|
1843
|
-
"never"
|
|
1844
|
-
],
|
|
1668
|
+
"computed-property-spacing": ["error", "never"],
|
|
1845
1669
|
// enforces consistent naming when capturing the current execution context
|
|
1846
1670
|
"consistent-this": "off",
|
|
1847
1671
|
// enforce newline at the end of file, with no multiple empty lines
|
|
1848
|
-
"eol-last": [
|
|
1849
|
-
"error",
|
|
1850
|
-
"always"
|
|
1851
|
-
],
|
|
1672
|
+
"eol-last": ["error", "always"],
|
|
1852
1673
|
// https://eslint.org/docs/rules/function-call-argument-newline
|
|
1853
|
-
"function-call-argument-newline": [
|
|
1854
|
-
"error",
|
|
1855
|
-
"consistent"
|
|
1856
|
-
],
|
|
1674
|
+
"function-call-argument-newline": ["error", "consistent"],
|
|
1857
1675
|
// enforce spacing between functions and their invocations
|
|
1858
1676
|
// https://eslint.org/docs/rules/func-call-spacing
|
|
1859
|
-
"func-call-spacing": [
|
|
1860
|
-
"error",
|
|
1861
|
-
"never"
|
|
1862
|
-
],
|
|
1677
|
+
"func-call-spacing": ["error", "never"],
|
|
1863
1678
|
// requires function names to match the name of the variable or property to which they are
|
|
1864
1679
|
// assigned
|
|
1865
1680
|
// https://eslint.org/docs/rules/func-name-matching
|
|
@@ -1877,13 +1692,11 @@ async function javascript(options = {}) {
|
|
|
1877
1692
|
// enforces use of function declarations or expressions
|
|
1878
1693
|
// https://eslint.org/docs/rules/func-style
|
|
1879
1694
|
// TODO: enable
|
|
1880
|
-
"func-style": [
|
|
1881
|
-
"off",
|
|
1882
|
-
"expression"
|
|
1883
|
-
],
|
|
1695
|
+
"func-style": ["off", "expression"],
|
|
1884
1696
|
// require line breaks inside function parentheses if there are line breaks between parameters
|
|
1885
1697
|
// https://eslint.org/docs/rules/function-paren-newline
|
|
1886
1698
|
"function-paren-newline": "off",
|
|
1699
|
+
// ["error", "multiline-arguments"],
|
|
1887
1700
|
// disallow specified identifiers
|
|
1888
1701
|
// https://eslint.org/docs/rules/id-denylist
|
|
1889
1702
|
"id-denylist": "off",
|
|
@@ -1898,6 +1711,7 @@ async function javascript(options = {}) {
|
|
|
1898
1711
|
// this option sets a specific tab width for your code
|
|
1899
1712
|
// https://eslint.org/docs/rules/indent
|
|
1900
1713
|
indent: "off",
|
|
1714
|
+
// [
|
|
1901
1715
|
// "error",
|
|
1902
1716
|
// 2,
|
|
1903
1717
|
// {
|
|
@@ -1944,18 +1758,9 @@ async function javascript(options = {}) {
|
|
|
1944
1758
|
// ],
|
|
1945
1759
|
// specify whether double or single quotes should be used in JSX attributes
|
|
1946
1760
|
// https://eslint.org/docs/rules/jsx-quotes
|
|
1947
|
-
"jsx-quotes": [
|
|
1948
|
-
"off",
|
|
1949
|
-
"prefer-double"
|
|
1950
|
-
],
|
|
1761
|
+
"jsx-quotes": ["off", "prefer-double"],
|
|
1951
1762
|
// enforces spacing between keys and values in object literal properties
|
|
1952
|
-
"key-spacing": [
|
|
1953
|
-
"error",
|
|
1954
|
-
{
|
|
1955
|
-
beforeColon: false,
|
|
1956
|
-
afterColon: true
|
|
1957
|
-
}
|
|
1958
|
-
],
|
|
1763
|
+
"key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
1959
1764
|
// require a space before & after certain keywords
|
|
1960
1765
|
"keyword-spacing": [
|
|
1961
1766
|
"error",
|
|
@@ -1963,15 +1768,9 @@ async function javascript(options = {}) {
|
|
|
1963
1768
|
before: true,
|
|
1964
1769
|
after: true,
|
|
1965
1770
|
overrides: {
|
|
1966
|
-
return: {
|
|
1967
|
-
|
|
1968
|
-
}
|
|
1969
|
-
throw: {
|
|
1970
|
-
after: true
|
|
1971
|
-
},
|
|
1972
|
-
case: {
|
|
1973
|
-
after: true
|
|
1974
|
-
}
|
|
1771
|
+
return: { after: true },
|
|
1772
|
+
throw: { after: true },
|
|
1773
|
+
case: { after: true }
|
|
1975
1774
|
}
|
|
1976
1775
|
}
|
|
1977
1776
|
],
|
|
@@ -1988,18 +1787,13 @@ async function javascript(options = {}) {
|
|
|
1988
1787
|
],
|
|
1989
1788
|
// disallow mixed 'LF' and 'CRLF' as linebreaks
|
|
1990
1789
|
// https://eslint.org/docs/rules/linebreak-style
|
|
1991
|
-
"linebreak-style": [
|
|
1992
|
-
"error",
|
|
1993
|
-
"unix"
|
|
1994
|
-
],
|
|
1790
|
+
"linebreak-style": ["error", "unix"],
|
|
1995
1791
|
// require or disallow an empty line between class members
|
|
1996
1792
|
// https://eslint.org/docs/rules/lines-between-class-members
|
|
1997
1793
|
"lines-between-class-members": [
|
|
1998
1794
|
"error",
|
|
1999
1795
|
"always",
|
|
2000
|
-
{
|
|
2001
|
-
exceptAfterSingleLine: false
|
|
2002
|
-
}
|
|
1796
|
+
{ exceptAfterSingleLine: false }
|
|
2003
1797
|
],
|
|
2004
1798
|
// enforces empty lines around comments
|
|
2005
1799
|
"lines-around-comment": "off",
|
|
@@ -2023,10 +1817,7 @@ async function javascript(options = {}) {
|
|
|
2023
1817
|
}
|
|
2024
1818
|
],
|
|
2025
1819
|
// specify the maximum depth that blocks can be nested
|
|
2026
|
-
"max-depth": [
|
|
2027
|
-
"off",
|
|
2028
|
-
4
|
|
2029
|
-
],
|
|
1820
|
+
"max-depth": ["off", 4],
|
|
2030
1821
|
// specify the maximum length of a line in your program
|
|
2031
1822
|
// https://eslint.org/docs/rules/max-len
|
|
2032
1823
|
"max-len": [
|
|
@@ -2065,36 +1856,19 @@ async function javascript(options = {}) {
|
|
|
2065
1856
|
// specify the maximum depth callbacks can be nested
|
|
2066
1857
|
"max-nested-callbacks": "off",
|
|
2067
1858
|
// limits the number of parameters that can be used in the function declaration.
|
|
2068
|
-
"max-params": [
|
|
2069
|
-
"off",
|
|
2070
|
-
3
|
|
2071
|
-
],
|
|
1859
|
+
"max-params": ["off", 3],
|
|
2072
1860
|
// specify the maximum number of statement allowed in a function
|
|
2073
|
-
"max-statements": [
|
|
2074
|
-
"off",
|
|
2075
|
-
10
|
|
2076
|
-
],
|
|
1861
|
+
"max-statements": ["off", 10],
|
|
2077
1862
|
// restrict the number of statements per line
|
|
2078
1863
|
// https://eslint.org/docs/rules/max-statements-per-line
|
|
2079
|
-
"max-statements-per-line": [
|
|
2080
|
-
"off",
|
|
2081
|
-
{
|
|
2082
|
-
max: 1
|
|
2083
|
-
}
|
|
2084
|
-
],
|
|
1864
|
+
"max-statements-per-line": ["off", { max: 1 }],
|
|
2085
1865
|
// enforce a particular style for multiline comments
|
|
2086
1866
|
// https://eslint.org/docs/rules/multiline-comment-style
|
|
2087
|
-
"multiline-comment-style": [
|
|
2088
|
-
"off",
|
|
2089
|
-
"starred-block"
|
|
2090
|
-
],
|
|
1867
|
+
"multiline-comment-style": ["off", "starred-block"],
|
|
2091
1868
|
// require multiline ternary
|
|
2092
1869
|
// https://eslint.org/docs/rules/multiline-ternary
|
|
2093
1870
|
// TODO: enable?
|
|
2094
|
-
"multiline-ternary": [
|
|
2095
|
-
"off",
|
|
2096
|
-
"never"
|
|
2097
|
-
],
|
|
1871
|
+
"multiline-ternary": ["off", "never"],
|
|
2098
1872
|
// require a capital letter for constructors
|
|
2099
1873
|
"new-cap": [
|
|
2100
1874
|
"error",
|
|
@@ -2127,25 +1901,12 @@ async function javascript(options = {}) {
|
|
|
2127
1901
|
// https://eslint.org/docs/rules/padding-line-between-statements
|
|
2128
1902
|
"padding-line-between-statements": [
|
|
2129
1903
|
"error",
|
|
2130
|
-
{
|
|
2131
|
-
blankLine: "always",
|
|
2132
|
-
prev: [
|
|
2133
|
-
"const",
|
|
2134
|
-
"let",
|
|
2135
|
-
"var"
|
|
2136
|
-
],
|
|
2137
|
-
next: "return"
|
|
2138
|
-
}
|
|
1904
|
+
{ blankLine: "always", prev: ["const", "let", "var"], next: "return" }
|
|
2139
1905
|
],
|
|
2140
1906
|
// enforces new line after each method call in the chain to make it
|
|
2141
1907
|
// more readable and easy to maintain
|
|
2142
1908
|
// https://eslint.org/docs/rules/newline-per-chained-call
|
|
2143
|
-
"newline-per-chained-call": [
|
|
2144
|
-
"error",
|
|
2145
|
-
{
|
|
2146
|
-
ignoreChainWithDepth: 5
|
|
2147
|
-
}
|
|
2148
|
-
],
|
|
1909
|
+
"newline-per-chained-call": ["error", { ignoreChainWithDepth: 5 }],
|
|
2149
1910
|
// disallow use of the Array constructor
|
|
2150
1911
|
"no-array-constructor": "error",
|
|
2151
1912
|
// disallow use of bitwise operators
|
|
@@ -2167,47 +1928,15 @@ async function javascript(options = {}) {
|
|
|
2167
1928
|
// the list of arithmetic groups disallows mixing `%` and `**`
|
|
2168
1929
|
// with other arithmetic operators.
|
|
2169
1930
|
groups: [
|
|
2170
|
-
[
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
],
|
|
2174
|
-
[
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
],
|
|
2178
|
-
[
|
|
2179
|
-
"%",
|
|
2180
|
-
"-"
|
|
2181
|
-
],
|
|
2182
|
-
[
|
|
2183
|
-
"%",
|
|
2184
|
-
"*"
|
|
2185
|
-
],
|
|
2186
|
-
[
|
|
2187
|
-
"%",
|
|
2188
|
-
"/"
|
|
2189
|
-
],
|
|
2190
|
-
[
|
|
2191
|
-
"/",
|
|
2192
|
-
"*"
|
|
2193
|
-
],
|
|
2194
|
-
[
|
|
2195
|
-
"&",
|
|
2196
|
-
"|",
|
|
2197
|
-
"<<",
|
|
2198
|
-
">>",
|
|
2199
|
-
">>>"
|
|
2200
|
-
],
|
|
2201
|
-
[
|
|
2202
|
-
"==",
|
|
2203
|
-
"!=",
|
|
2204
|
-
"===",
|
|
2205
|
-
"!=="
|
|
2206
|
-
],
|
|
2207
|
-
[
|
|
2208
|
-
"&&",
|
|
2209
|
-
"||"
|
|
2210
|
-
]
|
|
1931
|
+
["%", "**"],
|
|
1932
|
+
["%", "+"],
|
|
1933
|
+
["%", "-"],
|
|
1934
|
+
["%", "*"],
|
|
1935
|
+
["%", "/"],
|
|
1936
|
+
["/", "*"],
|
|
1937
|
+
["&", "|", "<<", ">>", ">>>"],
|
|
1938
|
+
["==", "!=", "===", "!=="],
|
|
1939
|
+
["&&", "||"]
|
|
2211
1940
|
],
|
|
2212
1941
|
allowSamePrecedence: false
|
|
2213
1942
|
}
|
|
@@ -2216,19 +1945,10 @@ async function javascript(options = {}) {
|
|
|
2216
1945
|
"no-mixed-spaces-and-tabs": "error",
|
|
2217
1946
|
// disallow use of chained assignment expressions
|
|
2218
1947
|
// https://eslint.org/docs/rules/no-multi-assign
|
|
2219
|
-
"no-multi-assign": [
|
|
2220
|
-
"error"
|
|
2221
|
-
],
|
|
1948
|
+
"no-multi-assign": ["error"],
|
|
2222
1949
|
// disallow multiple empty lines, only one newline at the end, and no new lines at the beginning
|
|
2223
1950
|
// https://eslint.org/docs/rules/no-multiple-empty-lines
|
|
2224
|
-
"no-multiple-empty-lines": [
|
|
2225
|
-
"error",
|
|
2226
|
-
{
|
|
2227
|
-
max: 1,
|
|
2228
|
-
maxBOF: 0,
|
|
2229
|
-
maxEOF: 0
|
|
2230
|
-
}
|
|
2231
|
-
],
|
|
1951
|
+
"no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
2232
1952
|
// disallow negated conditions
|
|
2233
1953
|
// https://eslint.org/docs/rules/no-negated-condition
|
|
2234
1954
|
"no-negated-condition": "off",
|
|
@@ -2293,12 +2013,7 @@ async function javascript(options = {}) {
|
|
|
2293
2013
|
// disallow the use of Boolean literals in conditional expressions
|
|
2294
2014
|
// also, prefer `a || b` over `a ? a : b`
|
|
2295
2015
|
// https://eslint.org/docs/rules/no-unneeded-ternary
|
|
2296
|
-
"no-unneeded-ternary": [
|
|
2297
|
-
"error",
|
|
2298
|
-
{
|
|
2299
|
-
defaultAssignment: false
|
|
2300
|
-
}
|
|
2301
|
-
],
|
|
2016
|
+
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
2302
2017
|
// disallow whitespace before properties
|
|
2303
2018
|
// https://eslint.org/docs/rules/no-whitespace-before-property
|
|
2304
2019
|
"no-whitespace-before-property": "error",
|
|
@@ -2307,15 +2022,10 @@ async function javascript(options = {}) {
|
|
|
2307
2022
|
"nonblock-statement-body-position": [
|
|
2308
2023
|
"error",
|
|
2309
2024
|
"beside",
|
|
2310
|
-
{
|
|
2311
|
-
overrides: {}
|
|
2312
|
-
}
|
|
2025
|
+
{ overrides: {} }
|
|
2313
2026
|
],
|
|
2314
2027
|
// require padding inside curly braces
|
|
2315
|
-
"object-curly-spacing": [
|
|
2316
|
-
"error",
|
|
2317
|
-
"always"
|
|
2318
|
-
],
|
|
2028
|
+
"object-curly-spacing": ["error", "always"],
|
|
2319
2029
|
// enforce line breaks between braces
|
|
2320
2030
|
// https://eslint.org/docs/rules/object-curly-newline
|
|
2321
2031
|
"object-curly-newline": [
|
|
@@ -2352,34 +2062,19 @@ async function javascript(options = {}) {
|
|
|
2352
2062
|
}
|
|
2353
2063
|
],
|
|
2354
2064
|
// allow just one var statement per function
|
|
2355
|
-
"one-var": [
|
|
2356
|
-
"error",
|
|
2357
|
-
"never"
|
|
2358
|
-
],
|
|
2065
|
+
"one-var": ["error", "never"],
|
|
2359
2066
|
// require a newline around variable declaration
|
|
2360
2067
|
// https://eslint.org/docs/rules/one-var-declaration-per-line
|
|
2361
|
-
"one-var-declaration-per-line": [
|
|
2362
|
-
"error",
|
|
2363
|
-
"always"
|
|
2364
|
-
],
|
|
2068
|
+
"one-var-declaration-per-line": ["error", "always"],
|
|
2365
2069
|
// require assignment operator shorthand where possible or prohibit it entirely
|
|
2366
2070
|
// https://eslint.org/docs/rules/operator-assignment
|
|
2367
|
-
"operator-assignment": [
|
|
2368
|
-
"error",
|
|
2369
|
-
"always"
|
|
2370
|
-
],
|
|
2071
|
+
"operator-assignment": ["error", "always"],
|
|
2371
2072
|
// Requires operator at the beginning of the line in multiline statements
|
|
2372
2073
|
// https://eslint.org/docs/rules/operator-linebreak
|
|
2373
2074
|
"operator-linebreak": [
|
|
2374
2075
|
"error",
|
|
2375
2076
|
"after",
|
|
2376
|
-
{
|
|
2377
|
-
overrides: {
|
|
2378
|
-
"=": "none",
|
|
2379
|
-
"?": "before",
|
|
2380
|
-
":": "before"
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2077
|
+
{ overrides: { "=": "none", "?": "before", ":": "before" } }
|
|
2383
2078
|
],
|
|
2384
2079
|
// disallow padding within blocks
|
|
2385
2080
|
"padded-blocks": [
|
|
@@ -2404,51 +2099,22 @@ async function javascript(options = {}) {
|
|
|
2404
2099
|
"quote-props": [
|
|
2405
2100
|
"error",
|
|
2406
2101
|
"as-needed",
|
|
2407
|
-
{
|
|
2408
|
-
keywords: false,
|
|
2409
|
-
unnecessary: true,
|
|
2410
|
-
numbers: false
|
|
2411
|
-
}
|
|
2102
|
+
{ keywords: false, unnecessary: true, numbers: false }
|
|
2412
2103
|
],
|
|
2413
2104
|
// specify whether double or single quotes should be used
|
|
2414
|
-
quotes: [
|
|
2415
|
-
"error",
|
|
2416
|
-
"double",
|
|
2417
|
-
{
|
|
2418
|
-
avoidEscape: true
|
|
2419
|
-
}
|
|
2420
|
-
],
|
|
2105
|
+
quotes: ["error", "double", { avoidEscape: true }],
|
|
2421
2106
|
// do not require jsdoc
|
|
2422
2107
|
// https://eslint.org/docs/rules/require-jsdoc
|
|
2423
2108
|
"require-jsdoc": "off",
|
|
2424
2109
|
// require or disallow use of semicolons instead of ASI
|
|
2425
|
-
semi: [
|
|
2426
|
-
"error",
|
|
2427
|
-
"always"
|
|
2428
|
-
],
|
|
2110
|
+
semi: ["error", "always"],
|
|
2429
2111
|
// enforce spacing before and after semicolons
|
|
2430
|
-
"semi-spacing": [
|
|
2431
|
-
"error",
|
|
2432
|
-
{
|
|
2433
|
-
before: false,
|
|
2434
|
-
after: true
|
|
2435
|
-
}
|
|
2436
|
-
],
|
|
2112
|
+
"semi-spacing": ["error", { before: false, after: true }],
|
|
2437
2113
|
// Enforce location of semicolons
|
|
2438
2114
|
// https://eslint.org/docs/rules/semi-style
|
|
2439
|
-
"semi-style": [
|
|
2440
|
-
"error",
|
|
2441
|
-
"last"
|
|
2442
|
-
],
|
|
2115
|
+
"semi-style": ["error", "last"],
|
|
2443
2116
|
// requires object keys to be sorted
|
|
2444
|
-
"sort-keys": [
|
|
2445
|
-
"off",
|
|
2446
|
-
"asc",
|
|
2447
|
-
{
|
|
2448
|
-
caseSensitive: false,
|
|
2449
|
-
natural: true
|
|
2450
|
-
}
|
|
2451
|
-
],
|
|
2117
|
+
"sort-keys": ["off", "asc", { caseSensitive: false, natural: true }],
|
|
2452
2118
|
// sort variables within the same declaration block
|
|
2453
2119
|
"sort-vars": "off",
|
|
2454
2120
|
// require or disallow space before blocks
|
|
@@ -2456,6 +2122,7 @@ async function javascript(options = {}) {
|
|
|
2456
2122
|
// require or disallow space before function opening parenthesis
|
|
2457
2123
|
// https://eslint.org/docs/rules/space-before-function-paren
|
|
2458
2124
|
"space-before-function-paren": "off",
|
|
2125
|
+
//[
|
|
2459
2126
|
// "error",
|
|
2460
2127
|
// {
|
|
2461
2128
|
// anonymous: "always",
|
|
@@ -2464,10 +2131,7 @@ async function javascript(options = {}) {
|
|
|
2464
2131
|
// }
|
|
2465
2132
|
// ],
|
|
2466
2133
|
// require or disallow spaces inside parentheses
|
|
2467
|
-
"space-in-parens": [
|
|
2468
|
-
"error",
|
|
2469
|
-
"never"
|
|
2470
|
-
],
|
|
2134
|
+
"space-in-parens": ["error", "never"],
|
|
2471
2135
|
// require spaces around operators
|
|
2472
2136
|
"space-infix-ops": "error",
|
|
2473
2137
|
// Require or disallow spaces before/after unary operators
|
|
@@ -2487,70 +2151,36 @@ async function javascript(options = {}) {
|
|
|
2487
2151
|
"always",
|
|
2488
2152
|
{
|
|
2489
2153
|
line: {
|
|
2490
|
-
exceptions: [
|
|
2491
|
-
|
|
2492
|
-
"+"
|
|
2493
|
-
],
|
|
2494
|
-
markers: [
|
|
2495
|
-
"=",
|
|
2496
|
-
"!",
|
|
2497
|
-
"/"
|
|
2498
|
-
]
|
|
2154
|
+
exceptions: ["-", "+"],
|
|
2155
|
+
markers: ["=", "!", "/"]
|
|
2499
2156
|
// space here to support sprockets directives, slash for TS /// comments
|
|
2500
2157
|
},
|
|
2501
2158
|
block: {
|
|
2502
|
-
exceptions: [
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
],
|
|
2506
|
-
markers: [
|
|
2507
|
-
"=",
|
|
2508
|
-
"!",
|
|
2509
|
-
":",
|
|
2510
|
-
"::"
|
|
2511
|
-
],
|
|
2159
|
+
exceptions: ["-", "+"],
|
|
2160
|
+
markers: ["=", "!", ":", "::"],
|
|
2161
|
+
// space here to support sprockets directives and flow comment types
|
|
2512
2162
|
balanced: true
|
|
2513
2163
|
}
|
|
2514
2164
|
}
|
|
2515
2165
|
],
|
|
2516
2166
|
// Enforce spacing around colons of switch statements
|
|
2517
2167
|
// https://eslint.org/docs/rules/switch-colon-spacing
|
|
2518
|
-
"switch-colon-spacing": [
|
|
2519
|
-
"error",
|
|
2520
|
-
{
|
|
2521
|
-
after: true,
|
|
2522
|
-
before: false
|
|
2523
|
-
}
|
|
2524
|
-
],
|
|
2168
|
+
"switch-colon-spacing": ["error", { after: true, before: false }],
|
|
2525
2169
|
// Require or disallow spacing between template tags and their literals
|
|
2526
2170
|
// https://eslint.org/docs/rules/template-tag-spacing
|
|
2527
|
-
"template-tag-spacing": [
|
|
2528
|
-
"error",
|
|
2529
|
-
"never"
|
|
2530
|
-
],
|
|
2171
|
+
"template-tag-spacing": ["error", "never"],
|
|
2531
2172
|
// require or disallow the Unicode Byte Order Mark
|
|
2532
2173
|
// https://eslint.org/docs/rules/unicode-bom
|
|
2533
|
-
"unicode-bom": [
|
|
2534
|
-
"error",
|
|
2535
|
-
"never"
|
|
2536
|
-
],
|
|
2174
|
+
"unicode-bom": ["error", "never"],
|
|
2537
2175
|
// require regex literals to be wrapped in parentheses
|
|
2538
2176
|
"wrap-regex": "off",
|
|
2539
2177
|
"class-methods-use-this": "off",
|
|
2540
2178
|
"accessor-pairs": [
|
|
2541
2179
|
"error",
|
|
2542
|
-
{
|
|
2543
|
-
enforceForClassMembers: true,
|
|
2544
|
-
setWithoutGet: true
|
|
2545
|
-
}
|
|
2180
|
+
{ enforceForClassMembers: true, setWithoutGet: true }
|
|
2546
2181
|
],
|
|
2547
2182
|
"constructor-super": "error",
|
|
2548
|
-
"dot-notation": [
|
|
2549
|
-
"error",
|
|
2550
|
-
{
|
|
2551
|
-
allowKeywords: true
|
|
2552
|
-
}
|
|
2553
|
-
],
|
|
2183
|
+
"dot-notation": ["error", { allowKeywords: true }],
|
|
2554
2184
|
"no-case-declarations": "error",
|
|
2555
2185
|
"no-class-assign": "error",
|
|
2556
2186
|
"no-const-assign": "error",
|
|
@@ -2564,13 +2194,7 @@ async function javascript(options = {}) {
|
|
|
2564
2194
|
"no-global-assign": "error",
|
|
2565
2195
|
"no-implied-eval": "error",
|
|
2566
2196
|
"no-iterator": "error",
|
|
2567
|
-
"no-labels": [
|
|
2568
|
-
"error",
|
|
2569
|
-
{
|
|
2570
|
-
allowLoop: false,
|
|
2571
|
-
allowSwitch: false
|
|
2572
|
-
}
|
|
2573
|
-
],
|
|
2197
|
+
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
|
2574
2198
|
"no-lone-blocks": "error",
|
|
2575
2199
|
"no-multi-str": "error",
|
|
2576
2200
|
"no-new": "error",
|
|
@@ -2579,22 +2203,11 @@ async function javascript(options = {}) {
|
|
|
2579
2203
|
"no-octal": "error",
|
|
2580
2204
|
"no-octal-escape": "error",
|
|
2581
2205
|
"no-proto": "error",
|
|
2582
|
-
"no-redeclare": [
|
|
2583
|
-
"error",
|
|
2584
|
-
{
|
|
2585
|
-
builtinGlobals: false
|
|
2586
|
-
}
|
|
2587
|
-
],
|
|
2206
|
+
"no-redeclare": ["error", { builtinGlobals: false }],
|
|
2588
2207
|
"no-restricted-globals": [
|
|
2589
2208
|
"error",
|
|
2590
|
-
{
|
|
2591
|
-
|
|
2592
|
-
name: "global"
|
|
2593
|
-
},
|
|
2594
|
-
{
|
|
2595
|
-
message: "Use `globalThis` instead.",
|
|
2596
|
-
name: "self"
|
|
2597
|
-
}
|
|
2209
|
+
{ message: "Use `globalThis` instead.", name: "global" },
|
|
2210
|
+
{ message: "Use `globalThis` instead.", name: "self" }
|
|
2598
2211
|
],
|
|
2599
2212
|
"no-restricted-properties": [
|
|
2600
2213
|
"error",
|
|
@@ -2619,12 +2232,7 @@ async function javascript(options = {}) {
|
|
|
2619
2232
|
property: "__lookupSetter__"
|
|
2620
2233
|
}
|
|
2621
2234
|
],
|
|
2622
|
-
"no-self-assign": [
|
|
2623
|
-
"error",
|
|
2624
|
-
{
|
|
2625
|
-
props: true
|
|
2626
|
-
}
|
|
2627
|
-
],
|
|
2235
|
+
"no-self-assign": ["error", { props: true }],
|
|
2628
2236
|
"no-self-compare": "error",
|
|
2629
2237
|
"no-sequences": "error",
|
|
2630
2238
|
"no-shadow-restricted-names": "error",
|
|
@@ -2643,11 +2251,7 @@ async function javascript(options = {}) {
|
|
|
2643
2251
|
],
|
|
2644
2252
|
"no-use-before-define": [
|
|
2645
2253
|
"error",
|
|
2646
|
-
{
|
|
2647
|
-
classes: false,
|
|
2648
|
-
functions: false,
|
|
2649
|
-
variables: true
|
|
2650
|
-
}
|
|
2254
|
+
{ classes: false, functions: false, variables: true }
|
|
2651
2255
|
],
|
|
2652
2256
|
"no-useless-call": "error",
|
|
2653
2257
|
"no-useless-catch": "error",
|
|
@@ -2680,12 +2284,7 @@ async function javascript(options = {}) {
|
|
|
2680
2284
|
}
|
|
2681
2285
|
],
|
|
2682
2286
|
"prefer-promise-reject-errors": "error",
|
|
2683
|
-
"prefer-regex-literals": [
|
|
2684
|
-
"error",
|
|
2685
|
-
{
|
|
2686
|
-
disallowRedundantWrapping: true
|
|
2687
|
-
}
|
|
2688
|
-
],
|
|
2287
|
+
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
2689
2288
|
"prefer-rest-params": "error",
|
|
2690
2289
|
"prefer-spread": "error",
|
|
2691
2290
|
"prefer-template": "error",
|
|
@@ -2702,16 +2301,12 @@ async function javascript(options = {}) {
|
|
|
2702
2301
|
}
|
|
2703
2302
|
],
|
|
2704
2303
|
"vars-on-top": "error",
|
|
2705
|
-
"yoda": [
|
|
2706
|
-
"error",
|
|
2707
|
-
"never"
|
|
2708
|
-
],
|
|
2304
|
+
"yoda": ["error", "never"],
|
|
2709
2305
|
...overrides
|
|
2710
2306
|
}
|
|
2711
2307
|
}
|
|
2712
2308
|
];
|
|
2713
2309
|
}
|
|
2714
|
-
__name(javascript, "javascript");
|
|
2715
2310
|
|
|
2716
2311
|
// src/configs/jsdoc.ts
|
|
2717
2312
|
async function jsdoc(options = {}) {
|
|
@@ -2746,15 +2341,14 @@ async function jsdoc(options = {}) {
|
|
|
2746
2341
|
}
|
|
2747
2342
|
];
|
|
2748
2343
|
}
|
|
2749
|
-
__name(jsdoc, "jsdoc");
|
|
2750
2344
|
|
|
2751
2345
|
// src/configs/jsonc.ts
|
|
2752
2346
|
async function jsonc(options = {}) {
|
|
2753
|
-
const {
|
|
2754
|
-
GLOB_JSON,
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2347
|
+
const {
|
|
2348
|
+
files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
2349
|
+
overrides = {},
|
|
2350
|
+
stylistic: stylistic2 = true
|
|
2351
|
+
} = options;
|
|
2758
2352
|
const { indent = 2 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
2759
2353
|
const [pluginJsonc, parserJsonc] = await Promise.all([
|
|
2760
2354
|
interopDefault(import("eslint-plugin-jsonc")),
|
|
@@ -2801,45 +2395,22 @@ async function jsonc(options = {}) {
|
|
|
2801
2395
|
"jsonc/valid-json-number": "error",
|
|
2802
2396
|
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
2803
2397
|
...stylistic2 ? {
|
|
2804
|
-
"jsonc/array-bracket-spacing": [
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
],
|
|
2808
|
-
"jsonc/comma-dangle": [
|
|
2809
|
-
"error",
|
|
2810
|
-
"never"
|
|
2811
|
-
],
|
|
2812
|
-
"jsonc/comma-style": [
|
|
2813
|
-
"error",
|
|
2814
|
-
"last"
|
|
2815
|
-
],
|
|
2816
|
-
"jsonc/indent": [
|
|
2817
|
-
"error",
|
|
2818
|
-
indent
|
|
2819
|
-
],
|
|
2398
|
+
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
2399
|
+
"jsonc/comma-dangle": ["error", "never"],
|
|
2400
|
+
"jsonc/comma-style": ["error", "last"],
|
|
2401
|
+
"jsonc/indent": ["error", indent],
|
|
2820
2402
|
"jsonc/key-spacing": [
|
|
2821
2403
|
"error",
|
|
2822
|
-
{
|
|
2823
|
-
afterColon: true,
|
|
2824
|
-
beforeColon: false
|
|
2825
|
-
}
|
|
2404
|
+
{ afterColon: true, beforeColon: false }
|
|
2826
2405
|
],
|
|
2827
2406
|
"jsonc/object-curly-newline": [
|
|
2828
2407
|
"error",
|
|
2829
|
-
{
|
|
2830
|
-
consistent: true,
|
|
2831
|
-
multiline: true
|
|
2832
|
-
}
|
|
2833
|
-
],
|
|
2834
|
-
"jsonc/object-curly-spacing": [
|
|
2835
|
-
"error",
|
|
2836
|
-
"always"
|
|
2408
|
+
{ consistent: true, multiline: true }
|
|
2837
2409
|
],
|
|
2410
|
+
"jsonc/object-curly-spacing": ["error", "always"],
|
|
2838
2411
|
"jsonc/object-property-newline": [
|
|
2839
2412
|
"error",
|
|
2840
|
-
{
|
|
2841
|
-
allowMultiplePropertiesPerLine: true
|
|
2842
|
-
}
|
|
2413
|
+
{ allowMultiplePropertiesPerLine: true }
|
|
2843
2414
|
],
|
|
2844
2415
|
"jsonc/quote-props": "error",
|
|
2845
2416
|
"jsonc/quotes": "error"
|
|
@@ -2849,23 +2420,17 @@ async function jsonc(options = {}) {
|
|
|
2849
2420
|
}
|
|
2850
2421
|
];
|
|
2851
2422
|
}
|
|
2852
|
-
__name(jsonc, "jsonc");
|
|
2853
2423
|
|
|
2854
2424
|
// src/configs/jsx.ts
|
|
2855
2425
|
async function jsx() {
|
|
2856
|
-
await ensurePackages([
|
|
2857
|
-
"eslint-plugin-jsx-a11y"
|
|
2858
|
-
]);
|
|
2426
|
+
await ensurePackages(["eslint-plugin-jsx-a11y"]);
|
|
2859
2427
|
const [pluginJsxA11y] = await Promise.all([
|
|
2860
2428
|
interopDefault(import("eslint-plugin-jsx-a11y"))
|
|
2861
2429
|
]);
|
|
2862
2430
|
return [
|
|
2863
2431
|
{
|
|
2864
2432
|
name: "storm/jsx/rules",
|
|
2865
|
-
files: [
|
|
2866
|
-
GLOB_JSX,
|
|
2867
|
-
GLOB_TSX
|
|
2868
|
-
],
|
|
2433
|
+
files: [GLOB_JSX, GLOB_TSX],
|
|
2869
2434
|
languageOptions: {
|
|
2870
2435
|
parserOptions: {
|
|
2871
2436
|
ecmaFeatures: {
|
|
@@ -2912,10 +2477,7 @@ async function jsx() {
|
|
|
2912
2477
|
"tree",
|
|
2913
2478
|
"treegrid"
|
|
2914
2479
|
],
|
|
2915
|
-
includeRoles: [
|
|
2916
|
-
"alert",
|
|
2917
|
-
"dialog"
|
|
2918
|
-
]
|
|
2480
|
+
includeRoles: ["alert", "dialog"]
|
|
2919
2481
|
}
|
|
2920
2482
|
],
|
|
2921
2483
|
"jsx-a11y/heading-has-content": "error",
|
|
@@ -2946,13 +2508,8 @@ async function jsx() {
|
|
|
2946
2508
|
"jsx-a11y/no-interactive-element-to-noninteractive-role": [
|
|
2947
2509
|
"error",
|
|
2948
2510
|
{
|
|
2949
|
-
tr: [
|
|
2950
|
-
|
|
2951
|
-
"presentation"
|
|
2952
|
-
],
|
|
2953
|
-
canvas: [
|
|
2954
|
-
"img"
|
|
2955
|
-
]
|
|
2511
|
+
tr: ["none", "presentation"],
|
|
2512
|
+
canvas: ["img"]
|
|
2956
2513
|
}
|
|
2957
2514
|
],
|
|
2958
2515
|
"jsx-a11y/no-noninteractive-element-interactions": [
|
|
@@ -2968,28 +2525,11 @@ async function jsx() {
|
|
|
2968
2525
|
"onKeyDown",
|
|
2969
2526
|
"onKeyUp"
|
|
2970
2527
|
],
|
|
2971
|
-
alert: [
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
]
|
|
2976
|
-
body: [
|
|
2977
|
-
"onError",
|
|
2978
|
-
"onLoad"
|
|
2979
|
-
],
|
|
2980
|
-
dialog: [
|
|
2981
|
-
"onKeyUp",
|
|
2982
|
-
"onKeyDown",
|
|
2983
|
-
"onKeyPress"
|
|
2984
|
-
],
|
|
2985
|
-
iframe: [
|
|
2986
|
-
"onError",
|
|
2987
|
-
"onLoad"
|
|
2988
|
-
],
|
|
2989
|
-
img: [
|
|
2990
|
-
"onError",
|
|
2991
|
-
"onLoad"
|
|
2992
|
-
]
|
|
2528
|
+
alert: ["onKeyUp", "onKeyDown", "onKeyPress"],
|
|
2529
|
+
body: ["onError", "onLoad"],
|
|
2530
|
+
dialog: ["onKeyUp", "onKeyDown", "onKeyPress"],
|
|
2531
|
+
iframe: ["onError", "onLoad"],
|
|
2532
|
+
img: ["onError", "onLoad"]
|
|
2993
2533
|
}
|
|
2994
2534
|
],
|
|
2995
2535
|
"jsx-a11y/no-noninteractive-element-to-interactive-role": [
|
|
@@ -3022,25 +2562,16 @@ async function jsx() {
|
|
|
3022
2562
|
"tab",
|
|
3023
2563
|
"treeitem"
|
|
3024
2564
|
],
|
|
3025
|
-
table: [
|
|
3026
|
-
|
|
3027
|
-
]
|
|
3028
|
-
td: [
|
|
3029
|
-
"gridcell"
|
|
3030
|
-
],
|
|
3031
|
-
fieldset: [
|
|
3032
|
-
"radiogroup",
|
|
3033
|
-
"presentation"
|
|
3034
|
-
]
|
|
2565
|
+
table: ["grid"],
|
|
2566
|
+
td: ["gridcell"],
|
|
2567
|
+
fieldset: ["radiogroup", "presentation"]
|
|
3035
2568
|
}
|
|
3036
2569
|
],
|
|
3037
2570
|
"jsx-a11y/no-noninteractive-tabindex": [
|
|
3038
2571
|
"error",
|
|
3039
2572
|
{
|
|
3040
2573
|
tags: [],
|
|
3041
|
-
roles: [
|
|
3042
|
-
"tabpanel"
|
|
3043
|
-
],
|
|
2574
|
+
roles: ["tabpanel"],
|
|
3044
2575
|
allowExpressionValues: true
|
|
3045
2576
|
}
|
|
3046
2577
|
],
|
|
@@ -3067,33 +2598,28 @@ async function jsx() {
|
|
|
3067
2598
|
}
|
|
3068
2599
|
];
|
|
3069
2600
|
}
|
|
3070
|
-
__name(jsx, "jsx");
|
|
3071
2601
|
|
|
3072
2602
|
// src/configs/markdown.ts
|
|
3073
2603
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
3074
2604
|
async function markdown(options = {}) {
|
|
3075
|
-
const { files = [
|
|
3076
|
-
|
|
3077
|
-
], overrides = {} } = options;
|
|
3078
|
-
const markdown1 = await interopDefault(import("@eslint/markdown"));
|
|
2605
|
+
const { files = [GLOB_MARKDOWN], overrides = {} } = options;
|
|
2606
|
+
const markdown2 = await interopDefault(import("@eslint/markdown"));
|
|
3079
2607
|
return [
|
|
3080
2608
|
{
|
|
3081
2609
|
name: "storm/markdown/setup",
|
|
3082
2610
|
plugins: {
|
|
3083
|
-
markdown:
|
|
2611
|
+
markdown: markdown2
|
|
3084
2612
|
}
|
|
3085
2613
|
},
|
|
3086
2614
|
{
|
|
3087
2615
|
files,
|
|
3088
|
-
ignores: [
|
|
3089
|
-
GLOB_MARKDOWN_IN_MARKDOWN
|
|
3090
|
-
],
|
|
2616
|
+
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
|
|
3091
2617
|
name: "storm/markdown/processor",
|
|
3092
2618
|
// `eslint-plugin-markdown` only creates virtual files for code blocks,
|
|
3093
2619
|
// but not the markdown file itself. We use `eslint-merge-processors` to
|
|
3094
2620
|
// add a pass-through processor for the markdown file itself.
|
|
3095
2621
|
processor: mergeProcessors([
|
|
3096
|
-
|
|
2622
|
+
markdown2.processors?.markdown,
|
|
3097
2623
|
processorPassThrough
|
|
3098
2624
|
])
|
|
3099
2625
|
},
|
|
@@ -3105,48 +2631,82 @@ async function markdown(options = {}) {
|
|
|
3105
2631
|
name: "storm/markdown/parser",
|
|
3106
2632
|
...overrides
|
|
3107
2633
|
}
|
|
2634
|
+
// {
|
|
2635
|
+
// files: [
|
|
2636
|
+
// GLOB_MARKDOWN_CODE,
|
|
2637
|
+
// ...componentExts.map(ext => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
2638
|
+
// ],
|
|
2639
|
+
// languageOptions: {
|
|
2640
|
+
// parserOptions: {
|
|
2641
|
+
// ecmaFeatures: {
|
|
2642
|
+
// impliedStrict: true
|
|
2643
|
+
// }
|
|
2644
|
+
// }
|
|
2645
|
+
// },
|
|
2646
|
+
// name: "storm/markdown/disables",
|
|
2647
|
+
// rules: {
|
|
2648
|
+
// "import/newline-after-import": "off",
|
|
2649
|
+
// "banner/banner": "off",
|
|
2650
|
+
// "no-alert": "off",
|
|
2651
|
+
// "no-console": "off",
|
|
2652
|
+
// "no-labels": "off",
|
|
2653
|
+
// "no-lone-blocks": "off",
|
|
2654
|
+
// "no-restricted-syntax": "off",
|
|
2655
|
+
// "no-undef": "off",
|
|
2656
|
+
// "no-unused-expressions": "off",
|
|
2657
|
+
// "no-unused-labels": "off",
|
|
2658
|
+
// "no-unused-vars": "off",
|
|
2659
|
+
// "node/prefer-global/process": "off",
|
|
2660
|
+
// "style/comma-dangle": "off",
|
|
2661
|
+
// "style/eol-last": "off",
|
|
2662
|
+
// "ts/consistent-type-imports": "off",
|
|
2663
|
+
// "ts/explicit-function-return-type": "off",
|
|
2664
|
+
// "ts/no-namespace": "off",
|
|
2665
|
+
// "ts/no-redeclare": "off",
|
|
2666
|
+
// "ts/no-require-imports": "off",
|
|
2667
|
+
// "ts/no-unused-expressions": "off",
|
|
2668
|
+
// "ts/no-unused-vars": "off",
|
|
2669
|
+
// "ts/no-use-before-define": "off",
|
|
2670
|
+
// "unicode-bom": "off",
|
|
2671
|
+
// "unused-imports/no-unused-imports": "off",
|
|
2672
|
+
// "unused-imports/no-unused-vars": "off",
|
|
2673
|
+
// ...overrides
|
|
2674
|
+
// }
|
|
2675
|
+
// }
|
|
3108
2676
|
];
|
|
3109
2677
|
}
|
|
3110
|
-
__name(markdown, "markdown");
|
|
3111
2678
|
|
|
3112
2679
|
// src/configs/mdx.ts
|
|
3113
2680
|
async function mdx(options = {}) {
|
|
3114
|
-
const { files = [
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
await ensurePackages([
|
|
3118
|
-
"eslint-plugin-mdx"
|
|
3119
|
-
]);
|
|
3120
|
-
const mdx1 = await interopDefault(import("eslint-plugin-mdx"));
|
|
2681
|
+
const { files = [GLOB_MDX], overrides = {} } = options;
|
|
2682
|
+
await ensurePackages(["eslint-plugin-mdx"]);
|
|
2683
|
+
const mdx2 = await interopDefault(import("eslint-plugin-mdx"));
|
|
3121
2684
|
return [
|
|
3122
2685
|
{
|
|
3123
2686
|
name: "storm/mdx/setup",
|
|
3124
2687
|
plugins: {
|
|
3125
|
-
mdx:
|
|
2688
|
+
mdx: mdx2
|
|
3126
2689
|
},
|
|
3127
|
-
...
|
|
2690
|
+
...mdx2.flat,
|
|
3128
2691
|
files,
|
|
3129
|
-
processor:
|
|
2692
|
+
processor: mdx2.createRemarkProcessor({
|
|
3130
2693
|
lintCodeBlocks: true,
|
|
3131
2694
|
// optional, if you want to disable language mapper, set it to `false`
|
|
3132
2695
|
// if you want to override the default language mapper inside, you can provide your own
|
|
3133
2696
|
languageMapper: {}
|
|
3134
2697
|
}),
|
|
3135
2698
|
rules: {
|
|
3136
|
-
...
|
|
2699
|
+
...mdx2.flat.rules,
|
|
3137
2700
|
...overrides
|
|
3138
2701
|
}
|
|
3139
2702
|
}
|
|
3140
2703
|
];
|
|
3141
2704
|
}
|
|
3142
|
-
__name(mdx, "mdx");
|
|
3143
2705
|
|
|
3144
2706
|
// src/configs/next.ts
|
|
3145
2707
|
async function next(options = {}) {
|
|
3146
2708
|
const { coreWebVitals = true, rootDir } = options;
|
|
3147
|
-
await ensurePackages([
|
|
3148
|
-
"@next/eslint-plugin-next"
|
|
3149
|
-
]);
|
|
2709
|
+
await ensurePackages(["@next/eslint-plugin-next"]);
|
|
3150
2710
|
const pluginNext = await interopDefault(import("@next/eslint-plugin-next"));
|
|
3151
2711
|
return [
|
|
3152
2712
|
{
|
|
@@ -3192,7 +2752,6 @@ async function next(options = {}) {
|
|
|
3192
2752
|
}
|
|
3193
2753
|
];
|
|
3194
2754
|
}
|
|
3195
|
-
__name(next, "next");
|
|
3196
2755
|
|
|
3197
2756
|
// src/configs/node.ts
|
|
3198
2757
|
async function node() {
|
|
@@ -3203,33 +2762,30 @@ async function node() {
|
|
|
3203
2762
|
node: default4
|
|
3204
2763
|
},
|
|
3205
2764
|
rules: {
|
|
3206
|
-
"node/handle-callback-err": [
|
|
3207
|
-
"error",
|
|
3208
|
-
"^(err|error)$"
|
|
3209
|
-
],
|
|
2765
|
+
"node/handle-callback-err": ["error", "^(err|error)$"],
|
|
3210
2766
|
"node/no-deprecated-api": "error",
|
|
3211
2767
|
"node/no-exports-assign": "error",
|
|
3212
2768
|
"node/no-new-require": "error",
|
|
3213
2769
|
"node/no-path-concat": "error",
|
|
3214
|
-
"node/prefer-global/buffer": [
|
|
3215
|
-
|
|
3216
|
-
"never"
|
|
3217
|
-
],
|
|
3218
|
-
"node/prefer-global/process": [
|
|
3219
|
-
"error",
|
|
3220
|
-
"always"
|
|
3221
|
-
],
|
|
2770
|
+
"node/prefer-global/buffer": ["error", "never"],
|
|
2771
|
+
"node/prefer-global/process": ["error", "always"],
|
|
3222
2772
|
"node/process-exit-as-throw": "error"
|
|
3223
2773
|
}
|
|
3224
2774
|
}
|
|
3225
2775
|
];
|
|
3226
2776
|
}
|
|
3227
|
-
__name(node, "node");
|
|
3228
2777
|
|
|
3229
2778
|
// src/configs/nx.ts
|
|
3230
2779
|
import defu3 from "defu";
|
|
3231
2780
|
async function nx(options = {}) {
|
|
3232
|
-
const {
|
|
2781
|
+
const {
|
|
2782
|
+
depsCheck = false,
|
|
2783
|
+
depsCheckSeverity = "error",
|
|
2784
|
+
moduleBoundaries,
|
|
2785
|
+
ignoredDependencies = [],
|
|
2786
|
+
ignoredFiles = [],
|
|
2787
|
+
checkObsoleteDependencies = true
|
|
2788
|
+
} = options;
|
|
3233
2789
|
return [
|
|
3234
2790
|
{
|
|
3235
2791
|
name: "storm/nx/setup",
|
|
@@ -3239,27 +2795,19 @@ async function nx(options = {}) {
|
|
|
3239
2795
|
},
|
|
3240
2796
|
{
|
|
3241
2797
|
name: "storm/nx/schema",
|
|
3242
|
-
files: [
|
|
3243
|
-
"**/executors/**/schema.json",
|
|
3244
|
-
"**/generators/**/schema.json"
|
|
3245
|
-
],
|
|
2798
|
+
files: ["**/executors/**/schema.json", "**/generators/**/schema.json"],
|
|
3246
2799
|
rules: {
|
|
3247
2800
|
"@nx/workspace/valid-schema-description": "error"
|
|
3248
2801
|
}
|
|
3249
2802
|
},
|
|
3250
2803
|
{
|
|
3251
2804
|
name: "storm/nx/dependency-check",
|
|
3252
|
-
files: [
|
|
3253
|
-
"**/package.json"
|
|
3254
|
-
],
|
|
2805
|
+
files: ["**/package.json"],
|
|
3255
2806
|
rules: depsCheck !== false ? {
|
|
3256
2807
|
"@nx/dependency-checks": [
|
|
3257
2808
|
depsCheckSeverity,
|
|
3258
2809
|
defu3(depsCheck, {
|
|
3259
|
-
buildTargets: [
|
|
3260
|
-
"build-base",
|
|
3261
|
-
"build"
|
|
3262
|
-
],
|
|
2810
|
+
buildTargets: ["build-base", "build"],
|
|
3263
2811
|
ignoredDependencies,
|
|
3264
2812
|
ignoredFiles,
|
|
3265
2813
|
checkMissingDependencies: true,
|
|
@@ -3273,28 +2821,18 @@ async function nx(options = {}) {
|
|
|
3273
2821
|
},
|
|
3274
2822
|
{
|
|
3275
2823
|
name: "storm/nx/module-boundaries",
|
|
3276
|
-
files: [
|
|
3277
|
-
"**/nx.json",
|
|
3278
|
-
"**/*.ts",
|
|
3279
|
-
"**/*.tsx",
|
|
3280
|
-
"**/*.js",
|
|
3281
|
-
"**/*.jsx"
|
|
3282
|
-
],
|
|
2824
|
+
files: ["**/nx.json", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
|
3283
2825
|
rules: moduleBoundaries !== false ? {
|
|
3284
2826
|
"@nx/enforce-module-boundaries": [
|
|
3285
2827
|
"error",
|
|
3286
2828
|
defu3(moduleBoundaries ?? {}, {
|
|
3287
2829
|
enforceBuildableLibDependency: false,
|
|
3288
|
-
checkDynamicDependenciesExceptions: [
|
|
3289
|
-
".*"
|
|
3290
|
-
],
|
|
2830
|
+
checkDynamicDependenciesExceptions: [".*"],
|
|
3291
2831
|
allow: [],
|
|
3292
2832
|
depConstraints: [
|
|
3293
2833
|
{
|
|
3294
2834
|
sourceTag: "*",
|
|
3295
|
-
onlyDependOnLibsWithTags: [
|
|
3296
|
-
"*"
|
|
3297
|
-
]
|
|
2835
|
+
onlyDependOnLibsWithTags: ["*"]
|
|
3298
2836
|
}
|
|
3299
2837
|
]
|
|
3300
2838
|
})
|
|
@@ -3303,7 +2841,6 @@ async function nx(options = {}) {
|
|
|
3303
2841
|
}
|
|
3304
2842
|
];
|
|
3305
2843
|
}
|
|
3306
|
-
__name(nx, "nx");
|
|
3307
2844
|
|
|
3308
2845
|
// src/configs/perfectionist.ts
|
|
3309
2846
|
async function perfectionist() {
|
|
@@ -3316,10 +2853,7 @@ async function perfectionist() {
|
|
|
3316
2853
|
rules: {
|
|
3317
2854
|
"perfectionist/sort-exports": [
|
|
3318
2855
|
"error",
|
|
3319
|
-
{
|
|
3320
|
-
order: "asc",
|
|
3321
|
-
type: "natural"
|
|
3322
|
-
}
|
|
2856
|
+
{ order: "asc", type: "natural" }
|
|
3323
2857
|
],
|
|
3324
2858
|
// "perfectionist/sort-imports": [
|
|
3325
2859
|
// "error",
|
|
@@ -3343,10 +2877,7 @@ async function perfectionist() {
|
|
|
3343
2877
|
"perfectionist/sort-imports": "off",
|
|
3344
2878
|
"perfectionist/sort-named-exports": [
|
|
3345
2879
|
"error",
|
|
3346
|
-
{
|
|
3347
|
-
order: "asc",
|
|
3348
|
-
type: "natural"
|
|
3349
|
-
}
|
|
2880
|
+
{ order: "asc", type: "natural" }
|
|
3350
2881
|
],
|
|
3351
2882
|
// "perfectionist/sort-named-imports": [
|
|
3352
2883
|
// "error",
|
|
@@ -3357,17 +2888,11 @@ async function perfectionist() {
|
|
|
3357
2888
|
}
|
|
3358
2889
|
];
|
|
3359
2890
|
}
|
|
3360
|
-
__name(perfectionist, "perfectionist");
|
|
3361
2891
|
|
|
3362
2892
|
// src/configs/pnpm.ts
|
|
3363
2893
|
async function pnpm(options = {}) {
|
|
3364
|
-
const { overrides = {}, ignore = [
|
|
3365
|
-
|
|
3366
|
-
] } = options;
|
|
3367
|
-
await ensurePackages([
|
|
3368
|
-
"jsonc-eslint-parser",
|
|
3369
|
-
"yaml-eslint-parser"
|
|
3370
|
-
]);
|
|
2894
|
+
const { overrides = {}, ignore = ["typescript"] } = options;
|
|
2895
|
+
await ensurePackages(["jsonc-eslint-parser", "yaml-eslint-parser"]);
|
|
3371
2896
|
const [parserJsonc, parserYaml] = await Promise.all([
|
|
3372
2897
|
interopDefault(import("jsonc-eslint-parser")),
|
|
3373
2898
|
interopDefault(import("yaml-eslint-parser"))
|
|
@@ -3381,14 +2906,8 @@ async function pnpm(options = {}) {
|
|
|
3381
2906
|
},
|
|
3382
2907
|
{
|
|
3383
2908
|
name: "storm/pnpm/package-json",
|
|
3384
|
-
ignores: [
|
|
3385
|
-
|
|
3386
|
-
"**/dist/**"
|
|
3387
|
-
],
|
|
3388
|
-
files: [
|
|
3389
|
-
"package.json",
|
|
3390
|
-
"**/package.json"
|
|
3391
|
-
],
|
|
2909
|
+
ignores: ["**/node_modules/**", "**/dist/**"],
|
|
2910
|
+
files: ["package.json", "**/package.json"],
|
|
3392
2911
|
languageOptions: {
|
|
3393
2912
|
parser: parserJsonc
|
|
3394
2913
|
},
|
|
@@ -3398,18 +2917,11 @@ async function pnpm(options = {}) {
|
|
|
3398
2917
|
{
|
|
3399
2918
|
ignore,
|
|
3400
2919
|
autofix: true,
|
|
3401
|
-
allowedProtocols: [
|
|
3402
|
-
"workspace",
|
|
3403
|
-
"link",
|
|
3404
|
-
"file"
|
|
3405
|
-
],
|
|
2920
|
+
allowedProtocols: ["workspace", "link", "file"],
|
|
3406
2921
|
defaultCatalog: "default",
|
|
3407
2922
|
reuseExistingCatalog: true,
|
|
3408
2923
|
conflicts: "overrides",
|
|
3409
|
-
fields: [
|
|
3410
|
-
"dependencies",
|
|
3411
|
-
"devDependencies"
|
|
3412
|
-
]
|
|
2924
|
+
fields: ["dependencies", "devDependencies"]
|
|
3413
2925
|
}
|
|
3414
2926
|
],
|
|
3415
2927
|
"pnpm/json-valid-catalog": "error",
|
|
@@ -3419,14 +2931,8 @@ async function pnpm(options = {}) {
|
|
|
3419
2931
|
},
|
|
3420
2932
|
{
|
|
3421
2933
|
name: "storm/pnpm/pnpm-workspace-yaml",
|
|
3422
|
-
ignores: [
|
|
3423
|
-
|
|
3424
|
-
"**/dist/**"
|
|
3425
|
-
],
|
|
3426
|
-
files: [
|
|
3427
|
-
"pnpm-workspace.yaml",
|
|
3428
|
-
"**/pnpm-workspace.yaml"
|
|
3429
|
-
],
|
|
2934
|
+
ignores: ["**/node_modules/**", "**/dist/**"],
|
|
2935
|
+
files: ["pnpm-workspace.yaml", "**/pnpm-workspace.yaml"],
|
|
3430
2936
|
languageOptions: {
|
|
3431
2937
|
parser: parserYaml
|
|
3432
2938
|
},
|
|
@@ -3438,7 +2944,6 @@ async function pnpm(options = {}) {
|
|
|
3438
2944
|
}
|
|
3439
2945
|
];
|
|
3440
2946
|
}
|
|
3441
|
-
__name(pnpm, "pnpm");
|
|
3442
2947
|
|
|
3443
2948
|
// src/configs/prettier.ts
|
|
3444
2949
|
import config from "eslint-config-prettier";
|
|
@@ -3460,32 +2965,25 @@ async function prettier() {
|
|
|
3460
2965
|
}
|
|
3461
2966
|
];
|
|
3462
2967
|
}
|
|
3463
|
-
__name(prettier, "prettier");
|
|
3464
2968
|
|
|
3465
2969
|
// src/configs/react.ts
|
|
3466
2970
|
import { isPackageExists } from "local-pkg";
|
|
3467
|
-
var ReactRefreshAllowConstantExportPackages = [
|
|
3468
|
-
"vite"
|
|
3469
|
-
];
|
|
2971
|
+
var ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
3470
2972
|
var ReactRouterPackages = [
|
|
3471
2973
|
"@react-router/node",
|
|
3472
2974
|
"@react-router/react",
|
|
3473
2975
|
"@react-router/serve",
|
|
3474
2976
|
"@react-router/dev"
|
|
3475
2977
|
];
|
|
3476
|
-
var NextJsPackages = [
|
|
3477
|
-
"next"
|
|
3478
|
-
];
|
|
2978
|
+
var NextJsPackages = ["next"];
|
|
3479
2979
|
async function react(options = {}) {
|
|
3480
|
-
const {
|
|
3481
|
-
GLOB_SRC
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
GLOB_ASTRO_TS
|
|
3488
|
-
], overrides = {}, tsconfigPath } = options;
|
|
2980
|
+
const {
|
|
2981
|
+
files = [GLOB_SRC],
|
|
2982
|
+
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
2983
|
+
ignoresTypeAware = [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS],
|
|
2984
|
+
overrides = {},
|
|
2985
|
+
tsconfigPath
|
|
2986
|
+
} = options;
|
|
3489
2987
|
await ensurePackages([
|
|
3490
2988
|
"@eslint-react/eslint-plugin",
|
|
3491
2989
|
"eslint-plugin-react-hooks",
|
|
@@ -3496,13 +2994,20 @@ async function react(options = {}) {
|
|
|
3496
2994
|
const typeAwareRules = {
|
|
3497
2995
|
"react/no-leaked-conditional-rendering": "warn"
|
|
3498
2996
|
};
|
|
3499
|
-
const [
|
|
2997
|
+
const [
|
|
2998
|
+
pluginReact,
|
|
2999
|
+
pluginReactHooks,
|
|
3000
|
+
pluginReactRefresh,
|
|
3001
|
+
pluginReactCompiler
|
|
3002
|
+
] = await Promise.all([
|
|
3500
3003
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
3501
3004
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
3502
3005
|
interopDefault(import("eslint-plugin-react-refresh")),
|
|
3503
3006
|
interopDefault(import("eslint-plugin-react-compiler"))
|
|
3504
3007
|
]);
|
|
3505
|
-
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
|
|
3008
|
+
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
|
|
3009
|
+
(i) => isPackageExists(i)
|
|
3010
|
+
);
|
|
3506
3011
|
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
|
|
3507
3012
|
const isUsingNext = NextJsPackages.some((i) => isPackageExists(i));
|
|
3508
3013
|
const plugins = pluginReact.configs.all.plugins;
|
|
@@ -3568,13 +3073,7 @@ async function react(options = {}) {
|
|
|
3568
3073
|
"viewport",
|
|
3569
3074
|
"generateViewport"
|
|
3570
3075
|
] : [],
|
|
3571
|
-
...isUsingReactRouter ? [
|
|
3572
|
-
"meta",
|
|
3573
|
-
"links",
|
|
3574
|
-
"headers",
|
|
3575
|
-
"loader",
|
|
3576
|
-
"action"
|
|
3577
|
-
] : []
|
|
3076
|
+
...isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
|
|
3578
3077
|
]
|
|
3579
3078
|
}
|
|
3580
3079
|
],
|
|
@@ -3642,32 +3141,26 @@ async function react(options = {}) {
|
|
|
3642
3141
|
] : []
|
|
3643
3142
|
];
|
|
3644
3143
|
}
|
|
3645
|
-
__name(react, "react");
|
|
3646
3144
|
|
|
3647
3145
|
// src/configs/react-native.ts
|
|
3648
3146
|
async function reactNative(options = {}) {
|
|
3649
3147
|
const { overrides = {} } = options;
|
|
3650
|
-
await ensurePackages([
|
|
3651
|
-
|
|
3652
|
-
]);
|
|
3653
|
-
const reactNative1 = await interopDefault(
|
|
3148
|
+
await ensurePackages(["eslint-plugin-react-native"]);
|
|
3149
|
+
const reactNative2 = await interopDefault(
|
|
3654
3150
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
3655
3151
|
import("eslint-plugin-react-native")
|
|
3656
3152
|
);
|
|
3657
3153
|
return [
|
|
3658
3154
|
{
|
|
3659
3155
|
name: "storm/react-native/rules",
|
|
3660
|
-
plugins: {
|
|
3661
|
-
"react-native": reactNative1
|
|
3662
|
-
},
|
|
3156
|
+
plugins: { "react-native": reactNative2 },
|
|
3663
3157
|
rules: {
|
|
3664
|
-
...
|
|
3158
|
+
...reactNative2.configs.all.rules,
|
|
3665
3159
|
...overrides
|
|
3666
3160
|
}
|
|
3667
3161
|
}
|
|
3668
3162
|
];
|
|
3669
3163
|
}
|
|
3670
|
-
__name(reactNative, "reactNative");
|
|
3671
3164
|
|
|
3672
3165
|
// src/configs/regexp.ts
|
|
3673
3166
|
import { configs as configs2 } from "eslint-plugin-regexp";
|
|
@@ -3699,55 +3192,41 @@ async function regexp(options = {}) {
|
|
|
3699
3192
|
}
|
|
3700
3193
|
];
|
|
3701
3194
|
}
|
|
3702
|
-
__name(regexp, "regexp");
|
|
3703
3195
|
|
|
3704
3196
|
// src/configs/secrets.ts
|
|
3705
3197
|
async function secrets(options) {
|
|
3706
3198
|
const { json = true } = options;
|
|
3707
3199
|
if (json) {
|
|
3708
|
-
await ensurePackages([
|
|
3709
|
-
"eslint-plugin-jsonc"
|
|
3710
|
-
]);
|
|
3200
|
+
await ensurePackages(["eslint-plugin-jsonc"]);
|
|
3711
3201
|
}
|
|
3712
3202
|
return [
|
|
3713
3203
|
{
|
|
3714
3204
|
name: "storm/secrets/rules",
|
|
3715
|
-
files: [
|
|
3716
|
-
`**/*.{js,ts,jsx,tsx${json ? ",json,jsonc" : ""}`
|
|
3717
|
-
],
|
|
3205
|
+
files: [`**/*.{js,ts,jsx,tsx${json ? ",json,jsonc" : ""}`],
|
|
3718
3206
|
plugins: {
|
|
3719
3207
|
"no-secrets": default5
|
|
3720
3208
|
},
|
|
3721
3209
|
rules: {
|
|
3722
3210
|
"no-secrets/no-secrets": [
|
|
3723
3211
|
"error",
|
|
3724
|
-
{
|
|
3725
|
-
ignoreIdentifiers: [
|
|
3726
|
-
"nxCloudId"
|
|
3727
|
-
]
|
|
3728
|
-
}
|
|
3212
|
+
{ ignoreIdentifiers: ["nxCloudId"] }
|
|
3729
3213
|
]
|
|
3730
3214
|
}
|
|
3731
3215
|
}
|
|
3732
3216
|
];
|
|
3733
3217
|
}
|
|
3734
|
-
__name(secrets, "secrets");
|
|
3735
3218
|
|
|
3736
3219
|
// src/configs/sort.ts
|
|
3737
3220
|
async function sortPackageJson() {
|
|
3738
3221
|
return [
|
|
3739
3222
|
{
|
|
3740
|
-
files: [
|
|
3741
|
-
"**/package.json"
|
|
3742
|
-
],
|
|
3223
|
+
files: ["**/package.json"],
|
|
3743
3224
|
name: "storm/sort/package-json",
|
|
3744
3225
|
rules: {
|
|
3745
3226
|
"jsonc/sort-array-values": [
|
|
3746
3227
|
"error",
|
|
3747
3228
|
{
|
|
3748
|
-
order: {
|
|
3749
|
-
type: "asc"
|
|
3750
|
-
},
|
|
3229
|
+
order: { type: "asc" },
|
|
3751
3230
|
pathPattern: "^files$"
|
|
3752
3231
|
}
|
|
3753
3232
|
],
|
|
@@ -3803,24 +3282,15 @@ async function sortPackageJson() {
|
|
|
3803
3282
|
pathPattern: "^$"
|
|
3804
3283
|
},
|
|
3805
3284
|
{
|
|
3806
|
-
order: {
|
|
3807
|
-
type: "asc"
|
|
3808
|
-
},
|
|
3285
|
+
order: { type: "asc" },
|
|
3809
3286
|
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
3810
3287
|
},
|
|
3811
3288
|
{
|
|
3812
|
-
order: {
|
|
3813
|
-
type: "asc"
|
|
3814
|
-
},
|
|
3289
|
+
order: { type: "asc" },
|
|
3815
3290
|
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
3816
3291
|
},
|
|
3817
3292
|
{
|
|
3818
|
-
order: [
|
|
3819
|
-
"types",
|
|
3820
|
-
"import",
|
|
3821
|
-
"require",
|
|
3822
|
-
"default"
|
|
3823
|
-
],
|
|
3293
|
+
order: ["types", "import", "require", "default"],
|
|
3824
3294
|
pathPattern: "^exports.*$"
|
|
3825
3295
|
},
|
|
3826
3296
|
{
|
|
@@ -3844,14 +3314,10 @@ async function sortPackageJson() {
|
|
|
3844
3314
|
}
|
|
3845
3315
|
];
|
|
3846
3316
|
}
|
|
3847
|
-
__name(sortPackageJson, "sortPackageJson");
|
|
3848
3317
|
function sortTsconfig() {
|
|
3849
3318
|
return [
|
|
3850
3319
|
{
|
|
3851
|
-
files: [
|
|
3852
|
-
"**/tsconfig.json",
|
|
3853
|
-
"**/tsconfig.*.json"
|
|
3854
|
-
],
|
|
3320
|
+
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
3855
3321
|
name: "storm/sort/tsconfig-json",
|
|
3856
3322
|
rules: {
|
|
3857
3323
|
"jsonc/sort-keys": [
|
|
@@ -3974,14 +3440,11 @@ function sortTsconfig() {
|
|
|
3974
3440
|
}
|
|
3975
3441
|
];
|
|
3976
3442
|
}
|
|
3977
|
-
__name(sortTsconfig, "sortTsconfig");
|
|
3978
3443
|
|
|
3979
3444
|
// src/configs/storybook.ts
|
|
3980
3445
|
async function storybook(options = {}) {
|
|
3981
3446
|
const { csf = "loose" } = options;
|
|
3982
|
-
await ensurePackages([
|
|
3983
|
-
"eslint-plugin-storybook"
|
|
3984
|
-
]);
|
|
3447
|
+
await ensurePackages(["eslint-plugin-storybook"]);
|
|
3985
3448
|
const [pluginStorybook] = await Promise.all([
|
|
3986
3449
|
interopDefault(import("eslint-plugin-storybook"))
|
|
3987
3450
|
]);
|
|
@@ -3991,9 +3454,7 @@ async function storybook(options = {}) {
|
|
|
3991
3454
|
plugins: {
|
|
3992
3455
|
storybook: pluginStorybook
|
|
3993
3456
|
},
|
|
3994
|
-
ignores: [
|
|
3995
|
-
"!.storybook"
|
|
3996
|
-
]
|
|
3457
|
+
ignores: ["!.storybook"]
|
|
3997
3458
|
},
|
|
3998
3459
|
{
|
|
3999
3460
|
name: "storm/storybook/rules",
|
|
@@ -4027,16 +3488,13 @@ async function storybook(options = {}) {
|
|
|
4027
3488
|
},
|
|
4028
3489
|
{
|
|
4029
3490
|
name: "storm/storybook/main",
|
|
4030
|
-
files: [
|
|
4031
|
-
"**/.storybook/main.@(js|cjs|mjs|ts)"
|
|
4032
|
-
],
|
|
3491
|
+
files: ["**/.storybook/main.@(js|cjs|mjs|ts)"],
|
|
4033
3492
|
rules: {
|
|
4034
3493
|
"storybook/no-uninstalled-addons": "error"
|
|
4035
3494
|
}
|
|
4036
3495
|
}
|
|
4037
3496
|
];
|
|
4038
3497
|
}
|
|
4039
|
-
__name(storybook, "storybook");
|
|
4040
3498
|
|
|
4041
3499
|
// src/configs/test.ts
|
|
4042
3500
|
var _pluginTest;
|
|
@@ -4068,10 +3526,7 @@ async function test(options = {}) {
|
|
|
4068
3526
|
rules: {
|
|
4069
3527
|
"test/consistent-test-it": [
|
|
4070
3528
|
"error",
|
|
4071
|
-
{
|
|
4072
|
-
fn: "it",
|
|
4073
|
-
withinDescribe: "it"
|
|
4074
|
-
}
|
|
3529
|
+
{ fn: "it", withinDescribe: "it" }
|
|
4075
3530
|
],
|
|
4076
3531
|
"test/no-identical-title": "error",
|
|
4077
3532
|
"test/no-import-node-test": "error",
|
|
@@ -4089,13 +3544,10 @@ async function test(options = {}) {
|
|
|
4089
3544
|
}
|
|
4090
3545
|
];
|
|
4091
3546
|
}
|
|
4092
|
-
__name(test, "test");
|
|
4093
3547
|
|
|
4094
3548
|
// src/configs/toml.ts
|
|
4095
3549
|
async function toml(options = {}) {
|
|
4096
|
-
const { files = [
|
|
4097
|
-
GLOB_TOML
|
|
4098
|
-
], overrides = {}, stylistic: stylistic2 = true } = options;
|
|
3550
|
+
const { files = [GLOB_TOML], overrides = {}, stylistic: stylistic2 = true } = options;
|
|
4099
3551
|
const { indent = 2 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
4100
3552
|
const [pluginToml, parserToml] = await Promise.all([
|
|
4101
3553
|
interopDefault(import("eslint-plugin-toml")),
|
|
@@ -4128,10 +3580,7 @@ async function toml(options = {}) {
|
|
|
4128
3580
|
"toml/array-bracket-newline": "error",
|
|
4129
3581
|
"toml/array-bracket-spacing": "error",
|
|
4130
3582
|
"toml/array-element-newline": "error",
|
|
4131
|
-
"toml/indent": [
|
|
4132
|
-
"error",
|
|
4133
|
-
indent === "tab" ? 2 : indent
|
|
4134
|
-
],
|
|
3583
|
+
"toml/indent": ["error", indent === "tab" ? 2 : indent],
|
|
4135
3584
|
"toml/inline-table-curly-spacing": "error",
|
|
4136
3585
|
"toml/key-spacing": "error",
|
|
4137
3586
|
"toml/padding-line-between-pairs": "error",
|
|
@@ -4145,20 +3594,23 @@ async function toml(options = {}) {
|
|
|
4145
3594
|
}
|
|
4146
3595
|
];
|
|
4147
3596
|
}
|
|
4148
|
-
__name(toml, "toml");
|
|
4149
3597
|
|
|
4150
3598
|
// src/configs/typescript.ts
|
|
4151
3599
|
async function typescript(options = {}) {
|
|
4152
|
-
const {
|
|
3600
|
+
const {
|
|
3601
|
+
componentExts = [],
|
|
3602
|
+
overrides = {},
|
|
3603
|
+
overridesTypeAware = {},
|
|
3604
|
+
parserOptions = {},
|
|
3605
|
+
tsdoc = "warn",
|
|
3606
|
+
type = "app"
|
|
3607
|
+
} = options;
|
|
4153
3608
|
const files = options.files ?? [
|
|
4154
3609
|
GLOB_TS,
|
|
4155
3610
|
GLOB_TSX,
|
|
4156
3611
|
...componentExts.map((ext) => `**/*.${ext}`)
|
|
4157
3612
|
];
|
|
4158
|
-
const filesTypeAware = options.filesTypeAware ?? [
|
|
4159
|
-
GLOB_TS,
|
|
4160
|
-
GLOB_TSX
|
|
4161
|
-
];
|
|
3613
|
+
const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
|
|
4162
3614
|
const ignoresTypeAware = options.ignoresTypeAware ?? [
|
|
4163
3615
|
`${GLOB_MARKDOWN}/**`,
|
|
4164
3616
|
GLOB_ASTRO_TS
|
|
@@ -4169,12 +3621,7 @@ async function typescript(options = {}) {
|
|
|
4169
3621
|
"dot-notation": "off",
|
|
4170
3622
|
"no-implied-eval": "off",
|
|
4171
3623
|
"ts/await-thenable": "error",
|
|
4172
|
-
"ts/dot-notation": [
|
|
4173
|
-
"error",
|
|
4174
|
-
{
|
|
4175
|
-
allowKeywords: true
|
|
4176
|
-
}
|
|
4177
|
-
],
|
|
3624
|
+
"ts/dot-notation": ["error", { allowKeywords: true }],
|
|
4178
3625
|
"ts/no-floating-promises": "error",
|
|
4179
3626
|
"ts/no-for-in-array": "error",
|
|
4180
3627
|
"ts/no-implied-eval": "error",
|
|
@@ -4188,10 +3635,7 @@ async function typescript(options = {}) {
|
|
|
4188
3635
|
"ts/promise-function-async": "error",
|
|
4189
3636
|
"ts/restrict-plus-operands": "error",
|
|
4190
3637
|
"ts/restrict-template-expressions": "error",
|
|
4191
|
-
"ts/return-await": [
|
|
4192
|
-
"error",
|
|
4193
|
-
"in-try-catch"
|
|
4194
|
-
],
|
|
3638
|
+
"ts/return-await": ["error", "in-try-catch"],
|
|
4195
3639
|
"ts/strict-boolean-expressions": "off",
|
|
4196
3640
|
"ts/switch-exhaustiveness-check": "error",
|
|
4197
3641
|
"ts/unbound-method": "error"
|
|
@@ -4207,9 +3651,7 @@ async function typescript(options = {}) {
|
|
|
4207
3651
|
function makeParser(typeAware, files2, ignores2) {
|
|
4208
3652
|
return {
|
|
4209
3653
|
files: files2,
|
|
4210
|
-
...ignores2 ? {
|
|
4211
|
-
ignores: ignores2
|
|
4212
|
-
} : {},
|
|
3654
|
+
...ignores2 ? { ignores: ignores2 } : {},
|
|
4213
3655
|
languageOptions: {
|
|
4214
3656
|
parser: parserTs,
|
|
4215
3657
|
parserOptions: {
|
|
@@ -4218,10 +3660,7 @@ async function typescript(options = {}) {
|
|
|
4218
3660
|
projectService: true,
|
|
4219
3661
|
...typeAware ? {
|
|
4220
3662
|
projectService: {
|
|
4221
|
-
allowDefaultProject: [
|
|
4222
|
-
"./*.js",
|
|
4223
|
-
"./*.ts"
|
|
4224
|
-
],
|
|
3663
|
+
allowDefaultProject: ["./*.js", "./*.ts"],
|
|
4225
3664
|
defaultProject: tsconfigPath
|
|
4226
3665
|
},
|
|
4227
3666
|
tsconfigRootDir: workspaceRoot
|
|
@@ -4232,7 +3671,6 @@ async function typescript(options = {}) {
|
|
|
4232
3671
|
name: `storm/typescript/${typeAware ? "type-aware-parser" : "parser"}`
|
|
4233
3672
|
};
|
|
4234
3673
|
}
|
|
4235
|
-
__name(makeParser, "makeParser");
|
|
4236
3674
|
return [
|
|
4237
3675
|
{
|
|
4238
3676
|
// Install the plugins without globs, so they can be configured separately.
|
|
@@ -4253,19 +3691,17 @@ async function typescript(options = {}) {
|
|
|
4253
3691
|
...renameRules(
|
|
4254
3692
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
4255
3693
|
pluginTs.configs["eslint-recommended"]?.overrides?.[0]?.rules,
|
|
4256
|
-
{
|
|
4257
|
-
"@typescript-eslint": "ts"
|
|
4258
|
-
}
|
|
3694
|
+
{ "@typescript-eslint": "ts" }
|
|
4259
3695
|
),
|
|
4260
3696
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
4261
3697
|
...renameRules(pluginTs.configs.strict?.rules, {
|
|
4262
3698
|
"@typescript-eslint": "ts"
|
|
4263
3699
|
}),
|
|
4264
3700
|
/*************************************************************
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
3701
|
+
*
|
|
3702
|
+
* TypeScript Rules - The following rules are specific to the TypeScript plugin
|
|
3703
|
+
*
|
|
3704
|
+
**************************************************************/
|
|
4269
3705
|
"ts/no-explicit-any": "off",
|
|
4270
3706
|
"ts/no-empty-function": "off",
|
|
4271
3707
|
"ts/no-var-requires": "off",
|
|
@@ -4275,10 +3711,7 @@ async function typescript(options = {}) {
|
|
|
4275
3711
|
"ts/explicit-function-return-type": "off",
|
|
4276
3712
|
"ts/no-unused-vars": [
|
|
4277
3713
|
"error",
|
|
4278
|
-
{
|
|
4279
|
-
args: "none",
|
|
4280
|
-
varsIgnorePattern: "^_"
|
|
4281
|
-
}
|
|
3714
|
+
{ args: "none", varsIgnorePattern: "^_" }
|
|
4282
3715
|
],
|
|
4283
3716
|
"ts/prefer-nullish-coalescing": [
|
|
4284
3717
|
"error",
|
|
@@ -4293,28 +3726,19 @@ async function typescript(options = {}) {
|
|
|
4293
3726
|
{
|
|
4294
3727
|
patterns: [
|
|
4295
3728
|
{
|
|
4296
|
-
group: [
|
|
4297
|
-
"nx/src/plugins/js*"
|
|
4298
|
-
],
|
|
3729
|
+
group: ["nx/src/plugins/js*"],
|
|
4299
3730
|
message: "Imports from 'nx/src/plugins/js' are not allowed. Use '@nx/js' instead"
|
|
4300
3731
|
},
|
|
4301
3732
|
{
|
|
4302
|
-
group: [
|
|
4303
|
-
"**/native-bindings",
|
|
4304
|
-
"**/native-bindings.js"
|
|
4305
|
-
],
|
|
3733
|
+
group: ["**/native-bindings", "**/native-bindings.js"],
|
|
4306
3734
|
message: "Direct imports from native-bindings.js are not allowed. Import from index.js instead."
|
|
4307
3735
|
},
|
|
4308
3736
|
{
|
|
4309
|
-
group: [
|
|
4310
|
-
"create-storm-workspace"
|
|
4311
|
-
],
|
|
3737
|
+
group: ["create-storm-workspace"],
|
|
4312
3738
|
message: "Direct imports from `create-storm-workspace` are not allowed. Instead install this package globally (example: 'npm i create-storm-workspace -g')."
|
|
4313
3739
|
},
|
|
4314
3740
|
{
|
|
4315
|
-
group: [
|
|
4316
|
-
"create-nx-workspace"
|
|
4317
|
-
],
|
|
3741
|
+
group: ["create-nx-workspace"],
|
|
4318
3742
|
message: "Direct imports from `create-nx-workspace` are not allowed. Instead install this package globally (example: 'npm i create-nx-workspace -g')."
|
|
4319
3743
|
}
|
|
4320
3744
|
]
|
|
@@ -4324,10 +3748,7 @@ async function typescript(options = {}) {
|
|
|
4324
3748
|
"no-redeclare": "off",
|
|
4325
3749
|
"no-use-before-define": "off",
|
|
4326
3750
|
"no-useless-constructor": "off",
|
|
4327
|
-
"ts/consistent-type-definitions": [
|
|
4328
|
-
"error",
|
|
4329
|
-
"interface"
|
|
4330
|
-
],
|
|
3751
|
+
"ts/consistent-type-definitions": ["error", "interface"],
|
|
4331
3752
|
"ts/consistent-type-imports": [
|
|
4332
3753
|
"error",
|
|
4333
3754
|
{
|
|
@@ -4336,29 +3757,17 @@ async function typescript(options = {}) {
|
|
|
4336
3757
|
prefer: "type-imports"
|
|
4337
3758
|
}
|
|
4338
3759
|
],
|
|
4339
|
-
"ts/method-signature-style": [
|
|
4340
|
-
|
|
4341
|
-
"property"
|
|
4342
|
-
],
|
|
3760
|
+
"ts/method-signature-style": ["error", "property"],
|
|
3761
|
+
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
4343
3762
|
"ts/no-dupe-class-members": "error",
|
|
4344
3763
|
"ts/no-dynamic-delete": "off",
|
|
4345
|
-
"ts/no-empty-object-type": [
|
|
4346
|
-
"error",
|
|
4347
|
-
{
|
|
4348
|
-
allowInterfaces: "always"
|
|
4349
|
-
}
|
|
4350
|
-
],
|
|
3764
|
+
"ts/no-empty-object-type": ["error", { allowInterfaces: "always" }],
|
|
4351
3765
|
"ts/no-extraneous-class": "off",
|
|
4352
3766
|
"ts/no-import-type-side-effects": "error",
|
|
4353
3767
|
"ts/no-invalid-void-type": "off",
|
|
4354
3768
|
"ts/no-non-null-assertion": "off",
|
|
4355
3769
|
"ts/no-non-null-asserted-optional-chain": "error",
|
|
4356
|
-
"ts/no-redeclare": [
|
|
4357
|
-
"error",
|
|
4358
|
-
{
|
|
4359
|
-
builtinGlobals: false
|
|
4360
|
-
}
|
|
4361
|
-
],
|
|
3770
|
+
"ts/no-redeclare": ["error", { builtinGlobals: false }],
|
|
4362
3771
|
"ts/no-require-imports": "error",
|
|
4363
3772
|
"ts/no-unused-expressions": [
|
|
4364
3773
|
"error",
|
|
@@ -4370,11 +3779,7 @@ async function typescript(options = {}) {
|
|
|
4370
3779
|
],
|
|
4371
3780
|
"ts/no-use-before-define": [
|
|
4372
3781
|
"error",
|
|
4373
|
-
{
|
|
4374
|
-
classes: false,
|
|
4375
|
-
functions: false,
|
|
4376
|
-
variables: true
|
|
4377
|
-
}
|
|
3782
|
+
{ classes: false, functions: false, variables: true }
|
|
4378
3783
|
],
|
|
4379
3784
|
"ts/no-useless-constructor": "off",
|
|
4380
3785
|
"ts/no-wrapper-object-types": "error",
|
|
@@ -4416,7 +3821,6 @@ async function typescript(options = {}) {
|
|
|
4416
3821
|
]
|
|
4417
3822
|
].filter(Boolean);
|
|
4418
3823
|
}
|
|
4419
|
-
__name(typescript, "typescript");
|
|
4420
3824
|
|
|
4421
3825
|
// src/configs/unicorn.ts
|
|
4422
3826
|
async function unicorn(options = {}) {
|
|
@@ -4445,10 +3849,10 @@ async function unicorn(options = {}) {
|
|
|
4445
3849
|
"unicorn/throw-new-error": "error"
|
|
4446
3850
|
},
|
|
4447
3851
|
/*************************************************************
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
3852
|
+
*
|
|
3853
|
+
* Unicorn Rules - The following rules are specific to the Unicorn plugin
|
|
3854
|
+
*
|
|
3855
|
+
**************************************************************/
|
|
4452
3856
|
"unicorn/number-literal-case": "off",
|
|
4453
3857
|
"unicorn/template-indent": "off",
|
|
4454
3858
|
"unicorn/prevent-abbreviations": "off",
|
|
@@ -4467,14 +3871,11 @@ async function unicorn(options = {}) {
|
|
|
4467
3871
|
}
|
|
4468
3872
|
];
|
|
4469
3873
|
}
|
|
4470
|
-
__name(unicorn, "unicorn");
|
|
4471
3874
|
|
|
4472
3875
|
// src/configs/unocss.ts
|
|
4473
3876
|
async function unocss(options = {}) {
|
|
4474
3877
|
const { attributify = true, strict = false } = options;
|
|
4475
|
-
await ensurePackages([
|
|
4476
|
-
"@unocss/eslint-plugin"
|
|
4477
|
-
]);
|
|
3878
|
+
await ensurePackages(["@unocss/eslint-plugin"]);
|
|
4478
3879
|
const [pluginUnoCSS] = await Promise.all([
|
|
4479
3880
|
interopDefault(import("@unocss/eslint-plugin"))
|
|
4480
3881
|
]);
|
|
@@ -4496,13 +3897,10 @@ async function unocss(options = {}) {
|
|
|
4496
3897
|
}
|
|
4497
3898
|
];
|
|
4498
3899
|
}
|
|
4499
|
-
__name(unocss, "unocss");
|
|
4500
3900
|
|
|
4501
3901
|
// src/configs/yaml.ts
|
|
4502
3902
|
async function yaml(options = {}) {
|
|
4503
|
-
const { files = [
|
|
4504
|
-
GLOB_YAML
|
|
4505
|
-
], overrides = {}, stylistic: stylistic2 = true } = options;
|
|
3903
|
+
const { files = [GLOB_YAML], overrides = {}, stylistic: stylistic2 = true } = options;
|
|
4506
3904
|
const { indent = 2, quotes = "single" } = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
4507
3905
|
const [pluginYaml, parserYaml] = await Promise.all([
|
|
4508
3906
|
interopDefault(import("eslint-plugin-yml")),
|
|
@@ -4540,10 +3938,7 @@ async function yaml(options = {}) {
|
|
|
4540
3938
|
"yaml/flow-mapping-curly-spacing": "error",
|
|
4541
3939
|
"yaml/flow-sequence-bracket-newline": "error",
|
|
4542
3940
|
"yaml/flow-sequence-bracket-spacing": "error",
|
|
4543
|
-
"yaml/indent": [
|
|
4544
|
-
"error",
|
|
4545
|
-
indent === "tab" ? 2 : indent
|
|
4546
|
-
],
|
|
3941
|
+
"yaml/indent": ["error", indent === "tab" ? 2 : indent],
|
|
4547
3942
|
"yaml/key-spacing": "error",
|
|
4548
3943
|
"yaml/no-tab-indent": "error",
|
|
4549
3944
|
"yaml/quotes": [
|
|
@@ -4560,7 +3955,6 @@ async function yaml(options = {}) {
|
|
|
4560
3955
|
}
|
|
4561
3956
|
];
|
|
4562
3957
|
}
|
|
4563
|
-
__name(yaml, "yaml");
|
|
4564
3958
|
|
|
4565
3959
|
// src/preset.ts
|
|
4566
3960
|
var flatConfigProps = [
|
|
@@ -4587,38 +3981,62 @@ var defaultPluginRenaming = {
|
|
|
4587
3981
|
function resolveSubOptions(options, key) {
|
|
4588
3982
|
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
4589
3983
|
}
|
|
4590
|
-
__name(resolveSubOptions, "resolveSubOptions");
|
|
4591
3984
|
function getOverrides(options, key) {
|
|
4592
3985
|
const sub = resolveSubOptions(options, key);
|
|
4593
3986
|
return "overrides" in sub ? sub.overrides : {};
|
|
4594
3987
|
}
|
|
4595
|
-
__name(getOverrides, "getOverrides");
|
|
4596
3988
|
function getStormConfig(options, ...userConfigs) {
|
|
4597
|
-
const {
|
|
3989
|
+
const {
|
|
3990
|
+
repositoryName,
|
|
3991
|
+
globals = {},
|
|
3992
|
+
lineEndings = "unix",
|
|
3993
|
+
astro: enableAstro = false,
|
|
3994
|
+
autoRenamePlugins = true,
|
|
3995
|
+
componentExts = [],
|
|
3996
|
+
gitignore: enableGitignore = true,
|
|
3997
|
+
jsx: enableJsx = true,
|
|
3998
|
+
cspell: enableCSpell = true,
|
|
3999
|
+
react: enableReact = false,
|
|
4000
|
+
"react-native": enableReactNative = false,
|
|
4001
|
+
regexp: enableRegexp = true,
|
|
4002
|
+
next: enableNext = false,
|
|
4003
|
+
graphql: enableGraphQL = false,
|
|
4004
|
+
storybook: enableStorybook = false,
|
|
4005
|
+
typescript: enableTypeScript = isPackageExists2("typescript"),
|
|
4006
|
+
unicorn: enableUnicorn = true,
|
|
4007
|
+
unocss: enableUnoCSS = false
|
|
4008
|
+
} = options;
|
|
4598
4009
|
let isInEditor = options.isInEditor;
|
|
4599
4010
|
if (isInEditor == null) {
|
|
4600
4011
|
isInEditor = isInEditorEnv();
|
|
4601
4012
|
if (isInEditor)
|
|
4602
|
-
console.log(
|
|
4013
|
+
console.log(
|
|
4014
|
+
"[@storm-software/eslint] Detected running in editor, some rules are disabled."
|
|
4015
|
+
);
|
|
4603
4016
|
}
|
|
4604
4017
|
const stylisticOptions = !options.stylistic ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
4605
|
-
if (stylisticOptions && !("jsx" in stylisticOptions))
|
|
4018
|
+
if (stylisticOptions && !("jsx" in stylisticOptions))
|
|
4019
|
+
stylisticOptions.jsx = enableJsx;
|
|
4606
4020
|
const configs3 = [];
|
|
4607
4021
|
if (enableGitignore) {
|
|
4608
4022
|
if (typeof enableGitignore !== "boolean") {
|
|
4609
|
-
configs3.push(
|
|
4610
|
-
r
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4023
|
+
configs3.push(
|
|
4024
|
+
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
|
|
4025
|
+
r({
|
|
4026
|
+
name: "storm/gitignore",
|
|
4027
|
+
...enableGitignore
|
|
4028
|
+
})
|
|
4029
|
+
])
|
|
4030
|
+
);
|
|
4615
4031
|
} else {
|
|
4616
|
-
configs3.push(
|
|
4617
|
-
r
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4032
|
+
configs3.push(
|
|
4033
|
+
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
|
|
4034
|
+
r({
|
|
4035
|
+
name: "storm/gitignore",
|
|
4036
|
+
strict: false
|
|
4037
|
+
})
|
|
4038
|
+
])
|
|
4039
|
+
);
|
|
4622
4040
|
}
|
|
4623
4041
|
}
|
|
4624
4042
|
const typescriptOptions = resolveSubOptions(options, "typescript");
|
|
@@ -4626,19 +4044,26 @@ function getStormConfig(options, ...userConfigs) {
|
|
|
4626
4044
|
if (!tsconfigPath) {
|
|
4627
4045
|
tsconfigPath = getTsConfigPath();
|
|
4628
4046
|
}
|
|
4629
|
-
configs3.push(
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4047
|
+
configs3.push(
|
|
4048
|
+
ignores(options.ignores),
|
|
4049
|
+
javascript({
|
|
4050
|
+
repositoryName,
|
|
4051
|
+
globals,
|
|
4052
|
+
lineEndings,
|
|
4053
|
+
isInEditor,
|
|
4054
|
+
overrides: getOverrides(options, "javascript")
|
|
4055
|
+
}),
|
|
4056
|
+
node(),
|
|
4057
|
+
jsdoc({
|
|
4058
|
+
stylistic: stylisticOptions
|
|
4059
|
+
}),
|
|
4060
|
+
imports({
|
|
4061
|
+
stylistic: stylisticOptions
|
|
4062
|
+
}),
|
|
4063
|
+
nx(resolveSubOptions(options, "nx")),
|
|
4064
|
+
perfectionist(),
|
|
4065
|
+
secrets({ json: options.jsonc !== false })
|
|
4066
|
+
);
|
|
4642
4067
|
if (!stylisticOptions) {
|
|
4643
4068
|
configs3.push(prettier());
|
|
4644
4069
|
}
|
|
@@ -4652,45 +4077,55 @@ function getStormConfig(options, ...userConfigs) {
|
|
|
4652
4077
|
configs3.push(jsx());
|
|
4653
4078
|
}
|
|
4654
4079
|
if (enableTypeScript) {
|
|
4655
|
-
configs3.push(
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4080
|
+
configs3.push(
|
|
4081
|
+
typescript({
|
|
4082
|
+
...typescriptOptions,
|
|
4083
|
+
componentExts,
|
|
4084
|
+
overrides: getOverrides(options, "typescript"),
|
|
4085
|
+
type: options.type
|
|
4086
|
+
})
|
|
4087
|
+
);
|
|
4661
4088
|
}
|
|
4662
4089
|
if (stylisticOptions) {
|
|
4663
|
-
configs3.push(
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4090
|
+
configs3.push(
|
|
4091
|
+
stylistic({
|
|
4092
|
+
...stylisticOptions,
|
|
4093
|
+
lineEndings,
|
|
4094
|
+
lessOpinionated: options.lessOpinionated,
|
|
4095
|
+
overrides: getOverrides(options, "stylistic")
|
|
4096
|
+
})
|
|
4097
|
+
);
|
|
4669
4098
|
}
|
|
4670
4099
|
if (enableRegexp) {
|
|
4671
4100
|
configs3.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
|
|
4672
4101
|
}
|
|
4673
4102
|
if (options.test ?? true) {
|
|
4674
|
-
configs3.push(
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4103
|
+
configs3.push(
|
|
4104
|
+
test({
|
|
4105
|
+
isInEditor,
|
|
4106
|
+
overrides: getOverrides(options, "test")
|
|
4107
|
+
})
|
|
4108
|
+
);
|
|
4678
4109
|
}
|
|
4679
4110
|
if (enableGraphQL) {
|
|
4680
4111
|
configs3.push(graphql(resolveSubOptions(options, "graphql")));
|
|
4681
4112
|
}
|
|
4682
4113
|
if (enableReact) {
|
|
4683
|
-
configs3.push(
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4114
|
+
configs3.push(
|
|
4115
|
+
react({
|
|
4116
|
+
...typescriptOptions,
|
|
4117
|
+
overrides: getOverrides(options, "react"),
|
|
4118
|
+
tsconfigPath
|
|
4119
|
+
})
|
|
4120
|
+
);
|
|
4688
4121
|
}
|
|
4689
4122
|
if (enableReactNative) {
|
|
4690
|
-
configs3.push(
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4123
|
+
configs3.push(
|
|
4124
|
+
reactNative({
|
|
4125
|
+
...resolveSubOptions(options, "react-native"),
|
|
4126
|
+
overrides: getOverrides(options, "react-native")
|
|
4127
|
+
})
|
|
4128
|
+
);
|
|
4694
4129
|
}
|
|
4695
4130
|
if (enableNext) {
|
|
4696
4131
|
configs3.push(next(resolveSubOptions(options, "next")));
|
|
@@ -4699,61 +4134,85 @@ function getStormConfig(options, ...userConfigs) {
|
|
|
4699
4134
|
configs3.push(storybook(resolveSubOptions(options, "storybook")));
|
|
4700
4135
|
}
|
|
4701
4136
|
if (enableUnoCSS) {
|
|
4702
|
-
configs3.push(
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4137
|
+
configs3.push(
|
|
4138
|
+
unocss({
|
|
4139
|
+
...resolveSubOptions(options, "unocss"),
|
|
4140
|
+
overrides: getOverrides(options, "unocss")
|
|
4141
|
+
})
|
|
4142
|
+
);
|
|
4706
4143
|
}
|
|
4707
4144
|
if (enableAstro) {
|
|
4708
|
-
configs3.push(
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4145
|
+
configs3.push(
|
|
4146
|
+
astro({
|
|
4147
|
+
overrides: getOverrides(options, "astro"),
|
|
4148
|
+
stylistic: stylisticOptions
|
|
4149
|
+
})
|
|
4150
|
+
);
|
|
4712
4151
|
}
|
|
4713
4152
|
if (options.pnpm ?? true) {
|
|
4714
|
-
configs3.push(
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4153
|
+
configs3.push(
|
|
4154
|
+
pnpm({
|
|
4155
|
+
overrides: getOverrides(options, "pnpm"),
|
|
4156
|
+
ignore: typeof options.pnpm !== "boolean" ? options.pnpm?.ignore : void 0
|
|
4157
|
+
})
|
|
4158
|
+
);
|
|
4718
4159
|
}
|
|
4719
4160
|
if (options.jsonc ?? true) {
|
|
4720
|
-
configs3.push(
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4161
|
+
configs3.push(
|
|
4162
|
+
jsonc({
|
|
4163
|
+
overrides: getOverrides(options, "jsonc"),
|
|
4164
|
+
stylistic: stylisticOptions
|
|
4165
|
+
}),
|
|
4166
|
+
sortTsconfig()
|
|
4167
|
+
);
|
|
4724
4168
|
if (stylisticOptions) {
|
|
4725
4169
|
configs3.push(sortPackageJson());
|
|
4726
4170
|
}
|
|
4727
4171
|
}
|
|
4728
4172
|
if (options.yaml ?? true) {
|
|
4729
|
-
configs3.push(
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4173
|
+
configs3.push(
|
|
4174
|
+
yaml({
|
|
4175
|
+
overrides: getOverrides(options, "yaml"),
|
|
4176
|
+
stylistic: stylisticOptions
|
|
4177
|
+
})
|
|
4178
|
+
);
|
|
4733
4179
|
}
|
|
4734
4180
|
if (options.toml ?? true) {
|
|
4735
|
-
configs3.push(
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4181
|
+
configs3.push(
|
|
4182
|
+
toml({
|
|
4183
|
+
overrides: getOverrides(options, "toml"),
|
|
4184
|
+
stylistic: stylisticOptions
|
|
4185
|
+
})
|
|
4186
|
+
);
|
|
4739
4187
|
}
|
|
4740
4188
|
if (options.markdown ?? false) {
|
|
4741
|
-
configs3.push(
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4189
|
+
configs3.push(
|
|
4190
|
+
markdown({
|
|
4191
|
+
componentExts,
|
|
4192
|
+
overrides: getOverrides(options, "markdown")
|
|
4193
|
+
})
|
|
4194
|
+
);
|
|
4745
4195
|
}
|
|
4746
4196
|
if (options.mdx ?? true) {
|
|
4747
|
-
configs3.push(
|
|
4748
|
-
|
|
4749
|
-
|
|
4197
|
+
configs3.push(
|
|
4198
|
+
mdx({
|
|
4199
|
+
overrides: getOverrides(options, "mdx")
|
|
4200
|
+
})
|
|
4201
|
+
);
|
|
4750
4202
|
}
|
|
4751
4203
|
if (options.formatters) {
|
|
4752
|
-
configs3.push(
|
|
4204
|
+
configs3.push(
|
|
4205
|
+
formatters(
|
|
4206
|
+
options.formatters,
|
|
4207
|
+
typeof stylisticOptions === "boolean" ? {} : stylisticOptions
|
|
4208
|
+
)
|
|
4209
|
+
);
|
|
4753
4210
|
}
|
|
4754
4211
|
configs3.push(disables());
|
|
4755
4212
|
if ("files" in options) {
|
|
4756
|
-
throw new Error(
|
|
4213
|
+
throw new Error(
|
|
4214
|
+
'[@storm-software/eslint] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.'
|
|
4215
|
+
);
|
|
4757
4216
|
}
|
|
4758
4217
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
|
4759
4218
|
if (key in options) {
|
|
@@ -4761,27 +4220,24 @@ function getStormConfig(options, ...userConfigs) {
|
|
|
4761
4220
|
}
|
|
4762
4221
|
return acc;
|
|
4763
4222
|
}, {});
|
|
4764
|
-
if (Object.keys(fusedConfig).length) configs3.push([
|
|
4765
|
-
fusedConfig
|
|
4766
|
-
]);
|
|
4223
|
+
if (Object.keys(fusedConfig).length) configs3.push([fusedConfig]);
|
|
4767
4224
|
let composer = new FlatConfigComposer();
|
|
4768
|
-
composer = composer.append(
|
|
4225
|
+
composer = composer.append(
|
|
4226
|
+
...configs3,
|
|
4227
|
+
...userConfigs
|
|
4228
|
+
);
|
|
4769
4229
|
if (autoRenamePlugins) {
|
|
4770
4230
|
composer = composer.renamePlugins(defaultPluginRenaming);
|
|
4771
4231
|
}
|
|
4772
4232
|
if (isInEditor) {
|
|
4773
|
-
composer = composer.disableRulesFix([
|
|
4774
|
-
"
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
"eslint",
|
|
4778
|
-
"use-at-your-own-risk"
|
|
4779
|
-
].join("/")).then((r) => r.builtinRules), "builtinRules")
|
|
4233
|
+
composer = composer.disableRulesFix(["test/no-only-tests"], {
|
|
4234
|
+
builtinRules: () => import(["eslint", "use-at-your-own-risk"].join("/")).then(
|
|
4235
|
+
(r) => r.builtinRules
|
|
4236
|
+
)
|
|
4780
4237
|
});
|
|
4781
4238
|
}
|
|
4782
4239
|
return composer;
|
|
4783
4240
|
}
|
|
4784
|
-
__name(getStormConfig, "getStormConfig");
|
|
4785
4241
|
var preset_default = getStormConfig;
|
|
4786
4242
|
export {
|
|
4787
4243
|
preset_default as default,
|