@whoj/eslint-config 2.2.0 → 2.2.2
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 +21 -21
- package/dist/cli.js +42 -56
- package/dist/index.d.ts +290 -283
- package/dist/index.js +709 -757
- package/package.json +3 -3
- package/dist/chunk-3P3JBQLJ.js +0 -5191
- package/dist/chunk-5NT2OOQW.js +0 -29719
- package/dist/chunk-7F5ASJF4.js +0 -1962
- package/dist/chunk-DLJMV7EV.js +0 -626
- package/dist/chunk-G5WGJHBR.js +0 -149
- package/dist/chunk-IDB36RF3.js +0 -353
- package/dist/chunk-IKAXXATW.js +0 -6400
- package/dist/chunk-MKKAXXPL.js +0 -5769
- package/dist/chunk-MKNYKNDN.js +0 -65
- package/dist/chunk-PVCENCBM.js +0 -1053
- package/dist/chunk-QT5XME2Q.js +0 -209134
- package/dist/chunk-THBKBMVU.js +0 -8352
- package/dist/chunk-VSLGWZT6.js +0 -115
- package/dist/chunk-XZGWRL6X.js +0 -1520
- package/dist/dist-MYXPM6TG.js +0 -4953
- package/dist/dist-ZJ2E2ITJ.js +0 -26233
- package/dist/eslint-plugin-react-hooks-BV2CYKDG.js +0 -2559
- package/dist/eslint-plugin-react-refresh-N5P3A37Z.js +0 -272
- package/dist/lib-C6BFP32Q.js +0 -24437
- package/dist/lib-FENTQ4WJ.js +0 -10106
- package/dist/lib-WKUBBNE4.js +0 -26
- package/dist/lib-XQB7MXK6.js +0 -9
- package/dist/sass.node-L3JPZGSW.js +0 -125580
- package/dist/typescript-LG2A6BNW.js +0 -5
package/dist/index.js
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_esm_shims
|
|
3
|
-
} from "./chunk-MKNYKNDN.js";
|
|
4
|
-
|
|
5
|
-
// src/index.ts
|
|
6
|
-
init_esm_shims();
|
|
7
|
-
|
|
8
1
|
// src/factory.ts
|
|
9
|
-
init_esm_shims();
|
|
10
2
|
import { isPackageExists as isPackageExists4 } from "local-pkg";
|
|
11
3
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
12
4
|
|
|
13
5
|
// src/configs/regexp.ts
|
|
14
|
-
init_esm_shims();
|
|
15
6
|
import { configs } from "eslint-plugin-regexp";
|
|
16
7
|
async function regexp(options = {}) {
|
|
17
8
|
const config = configs["flat/recommended"];
|
|
@@ -37,14 +28,9 @@ async function regexp(options = {}) {
|
|
|
37
28
|
}
|
|
38
29
|
|
|
39
30
|
// src/configs/formatters.ts
|
|
40
|
-
init_esm_shims();
|
|
41
31
|
import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
42
32
|
|
|
43
|
-
// src/configs/stylistic.ts
|
|
44
|
-
init_esm_shims();
|
|
45
|
-
|
|
46
33
|
// src/plugins.ts
|
|
47
|
-
init_esm_shims();
|
|
48
34
|
import * as pluginImport from "eslint-plugin-import-x";
|
|
49
35
|
import { default as default2 } from "eslint-plugin-n";
|
|
50
36
|
import { default as default3 } from "eslint-plugin-antfu";
|
|
@@ -54,7 +40,6 @@ import { default as default6 } from "eslint-plugin-unused-imports";
|
|
|
54
40
|
import { default as default7 } from "@eslint-community/eslint-plugin-eslint-comments";
|
|
55
41
|
|
|
56
42
|
// src/utils.ts
|
|
57
|
-
init_esm_shims();
|
|
58
43
|
import process from "node:process";
|
|
59
44
|
import { fileURLToPath } from "node:url";
|
|
60
45
|
import { isPackageExists } from "local-pkg";
|
|
@@ -65,25 +50,45 @@ var parserPlain = {
|
|
|
65
50
|
name: "parser-plain"
|
|
66
51
|
},
|
|
67
52
|
parseForESLint: (code) => ({
|
|
68
|
-
ast: {
|
|
69
|
-
body: [],
|
|
70
|
-
comments: [],
|
|
71
|
-
loc: { end: code.length, start: 0 },
|
|
72
|
-
range: [0, code.length],
|
|
73
|
-
tokens: [],
|
|
74
|
-
type: "Program"
|
|
75
|
-
},
|
|
76
53
|
scopeManager: null,
|
|
77
54
|
services: { isPlain: true },
|
|
78
55
|
visitorKeys: {
|
|
79
56
|
Program: []
|
|
57
|
+
},
|
|
58
|
+
ast: {
|
|
59
|
+
body: [],
|
|
60
|
+
tokens: [],
|
|
61
|
+
comments: [],
|
|
62
|
+
type: "Program",
|
|
63
|
+
range: [0, code.length],
|
|
64
|
+
loc: { start: 0, end: code.length }
|
|
80
65
|
}
|
|
81
66
|
})
|
|
82
67
|
};
|
|
68
|
+
function toArray(value) {
|
|
69
|
+
return Array.isArray(value) ? value : [value];
|
|
70
|
+
}
|
|
71
|
+
function isPackageInScope(name) {
|
|
72
|
+
return isPackageExists(name, { paths: [scopeUrl] });
|
|
73
|
+
}
|
|
74
|
+
async function interopDefault(m) {
|
|
75
|
+
const resolved = await m;
|
|
76
|
+
return resolved.default || resolved;
|
|
77
|
+
}
|
|
78
|
+
function isInGitHooksOrLintStaged() {
|
|
79
|
+
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
|
|
80
|
+
}
|
|
83
81
|
async function combine(...configs2) {
|
|
84
82
|
const resolved = await Promise.all(configs2);
|
|
85
83
|
return resolved.flat();
|
|
86
84
|
}
|
|
85
|
+
function isInEditorEnv() {
|
|
86
|
+
if (process.env.CI)
|
|
87
|
+
return false;
|
|
88
|
+
if (isInGitHooksOrLintStaged())
|
|
89
|
+
return false;
|
|
90
|
+
return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
|
|
91
|
+
}
|
|
87
92
|
function renameRules(rules, map) {
|
|
88
93
|
return Object.fromEntries(
|
|
89
94
|
Object.entries(rules).map(([key, value]) => {
|
|
@@ -112,16 +117,6 @@ function renamePluginInConfigs(configs2, map) {
|
|
|
112
117
|
return clone;
|
|
113
118
|
});
|
|
114
119
|
}
|
|
115
|
-
function toArray(value) {
|
|
116
|
-
return Array.isArray(value) ? value : [value];
|
|
117
|
-
}
|
|
118
|
-
async function interopDefault(m) {
|
|
119
|
-
const resolved = await m;
|
|
120
|
-
return resolved.default || resolved;
|
|
121
|
-
}
|
|
122
|
-
function isPackageInScope(name) {
|
|
123
|
-
return isPackageExists(name, { paths: [scopeUrl] });
|
|
124
|
-
}
|
|
125
120
|
async function ensurePackages(packages) {
|
|
126
121
|
if (process.env.CI || !process.stdout.isTTY || !isCwdInScope)
|
|
127
122
|
return;
|
|
@@ -135,54 +130,44 @@ async function ensurePackages(packages) {
|
|
|
135
130
|
if (result)
|
|
136
131
|
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
137
132
|
}
|
|
138
|
-
function isInEditorEnv() {
|
|
139
|
-
if (process.env.CI)
|
|
140
|
-
return false;
|
|
141
|
-
if (isInGitHooksOrLintStaged())
|
|
142
|
-
return false;
|
|
143
|
-
return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
|
|
144
|
-
}
|
|
145
|
-
function isInGitHooksOrLintStaged() {
|
|
146
|
-
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
|
|
147
|
-
}
|
|
148
133
|
|
|
149
134
|
// src/configs/stylistic.ts
|
|
150
135
|
var StylisticConfigDefaults = {
|
|
151
|
-
commaDangle: "never",
|
|
152
136
|
indent: 2,
|
|
153
137
|
jsx: true,
|
|
138
|
+
semi: true,
|
|
154
139
|
quotes: "single",
|
|
155
|
-
|
|
140
|
+
commaDangle: "never"
|
|
156
141
|
};
|
|
157
142
|
async function stylistic(options = {}) {
|
|
158
143
|
const {
|
|
159
|
-
commaDangle,
|
|
160
|
-
indent,
|
|
161
144
|
jsx: jsx2,
|
|
162
|
-
|
|
163
|
-
|
|
145
|
+
semi,
|
|
146
|
+
indent,
|
|
164
147
|
quotes,
|
|
165
|
-
|
|
148
|
+
commaDangle,
|
|
149
|
+
overrides = {},
|
|
150
|
+
lessOpinionated = false
|
|
166
151
|
} = {
|
|
167
152
|
...StylisticConfigDefaults,
|
|
168
153
|
...options
|
|
169
154
|
};
|
|
170
155
|
const pluginStylistic = await interopDefault(import("@stylistic/eslint-plugin"));
|
|
171
156
|
const config = pluginStylistic.configs.customize({
|
|
172
|
-
commaDangle,
|
|
173
|
-
flat: true,
|
|
174
|
-
indent,
|
|
175
157
|
jsx: jsx2,
|
|
176
|
-
|
|
158
|
+
semi,
|
|
159
|
+
indent,
|
|
177
160
|
quotes,
|
|
178
|
-
|
|
161
|
+
flat: true,
|
|
162
|
+
commaDangle,
|
|
163
|
+
pluginName: "style"
|
|
179
164
|
});
|
|
180
165
|
return [
|
|
181
166
|
{
|
|
182
167
|
name: "whoj/stylistic/rules",
|
|
183
168
|
plugins: {
|
|
184
|
-
|
|
185
|
-
|
|
169
|
+
whoj: default3,
|
|
170
|
+
style: pluginStylistic
|
|
186
171
|
},
|
|
187
172
|
rules: {
|
|
188
173
|
...config.rules,
|
|
@@ -202,7 +187,6 @@ async function stylistic(options = {}) {
|
|
|
202
187
|
}
|
|
203
188
|
|
|
204
189
|
// src/globs.ts
|
|
205
|
-
init_esm_shims();
|
|
206
190
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
207
191
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
208
192
|
var GLOB_JS = "**/*.?([cm])js";
|
|
@@ -284,28 +268,18 @@ var GLOB_EXCLUDE = [
|
|
|
284
268
|
];
|
|
285
269
|
|
|
286
270
|
// src/configs/formatters.ts
|
|
287
|
-
function mergePrettierOptions(options, overrides = {}) {
|
|
288
|
-
return {
|
|
289
|
-
...options,
|
|
290
|
-
...overrides,
|
|
291
|
-
plugins: [
|
|
292
|
-
...overrides.plugins || [],
|
|
293
|
-
...options.plugins || []
|
|
294
|
-
]
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
271
|
async function formatters(options = {}, stylistic2 = {}) {
|
|
298
272
|
if (options === true) {
|
|
299
273
|
const isPrettierPluginXmlInScope = isPackageInScope("@prettier/plugin-xml");
|
|
300
274
|
options = {
|
|
301
|
-
astro: isPackageInScope("prettier-plugin-astro"),
|
|
302
275
|
css: true,
|
|
303
|
-
graphql: true,
|
|
304
276
|
html: true,
|
|
277
|
+
graphql: true,
|
|
305
278
|
markdown: true,
|
|
306
|
-
slidev: isPackageExists2("@slidev/cli"),
|
|
307
279
|
svg: isPrettierPluginXmlInScope,
|
|
308
|
-
xml: isPrettierPluginXmlInScope
|
|
280
|
+
xml: isPrettierPluginXmlInScope,
|
|
281
|
+
slidev: isPackageExists2("@slidev/cli"),
|
|
282
|
+
astro: isPackageInScope("prettier-plugin-astro")
|
|
309
283
|
};
|
|
310
284
|
}
|
|
311
285
|
await ensurePackages([
|
|
@@ -317,36 +291,36 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
317
291
|
if (options.slidev && options.markdown !== true && options.markdown !== "prettier")
|
|
318
292
|
throw new Error("`slidev` option only works when `markdown` is enabled with `prettier`");
|
|
319
293
|
const {
|
|
294
|
+
semi,
|
|
320
295
|
indent,
|
|
321
|
-
quotes
|
|
322
|
-
semi
|
|
296
|
+
quotes
|
|
323
297
|
} = {
|
|
324
298
|
...StylisticConfigDefaults,
|
|
325
299
|
...stylistic2
|
|
326
300
|
};
|
|
327
301
|
const prettierOptions = Object.assign(
|
|
328
302
|
{
|
|
329
|
-
endOfLine: "auto",
|
|
330
|
-
printWidth: 120,
|
|
331
303
|
semi,
|
|
332
|
-
|
|
333
|
-
|
|
304
|
+
printWidth: 120,
|
|
305
|
+
endOfLine: "auto",
|
|
334
306
|
trailingComma: "all",
|
|
335
|
-
useTabs: indent === "tab"
|
|
307
|
+
useTabs: indent === "tab",
|
|
308
|
+
singleQuote: quotes === "single",
|
|
309
|
+
tabWidth: typeof indent === "number" ? indent : 2
|
|
336
310
|
},
|
|
337
311
|
options.prettierOptions || {}
|
|
338
312
|
);
|
|
339
313
|
const prettierXmlOptions = {
|
|
340
|
-
xmlQuoteAttributes: "double",
|
|
341
314
|
xmlSelfClosingSpace: true,
|
|
315
|
+
xmlQuoteAttributes: "double",
|
|
342
316
|
xmlSortAttributesByKey: false,
|
|
343
317
|
xmlWhitespaceSensitivity: "ignore"
|
|
344
318
|
};
|
|
345
319
|
const dprintOptions = Object.assign(
|
|
346
320
|
{
|
|
321
|
+
useTabs: indent === "tab",
|
|
347
322
|
indentWidth: typeof indent === "number" ? indent : 2,
|
|
348
|
-
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble"
|
|
349
|
-
useTabs: indent === "tab"
|
|
323
|
+
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble"
|
|
350
324
|
},
|
|
351
325
|
options.dprintOptions || {}
|
|
352
326
|
);
|
|
@@ -362,11 +336,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
362
336
|
if (options.css) {
|
|
363
337
|
configs2.push(
|
|
364
338
|
{
|
|
339
|
+
name: "whoj/formatter/css",
|
|
365
340
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
366
341
|
languageOptions: {
|
|
367
342
|
parser: parserPlain
|
|
368
343
|
},
|
|
369
|
-
name: "whoj/formatter/css",
|
|
370
344
|
rules: {
|
|
371
345
|
"format/prettier": [
|
|
372
346
|
"error",
|
|
@@ -378,10 +352,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
378
352
|
},
|
|
379
353
|
{
|
|
380
354
|
files: [GLOB_SCSS],
|
|
355
|
+
name: "whoj/formatter/scss",
|
|
381
356
|
languageOptions: {
|
|
382
357
|
parser: parserPlain
|
|
383
358
|
},
|
|
384
|
-
name: "whoj/formatter/scss",
|
|
385
359
|
rules: {
|
|
386
360
|
"format/prettier": [
|
|
387
361
|
"error",
|
|
@@ -393,10 +367,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
393
367
|
},
|
|
394
368
|
{
|
|
395
369
|
files: [GLOB_LESS],
|
|
370
|
+
name: "whoj/formatter/less",
|
|
396
371
|
languageOptions: {
|
|
397
372
|
parser: parserPlain
|
|
398
373
|
},
|
|
399
|
-
name: "whoj/formatter/less",
|
|
400
374
|
rules: {
|
|
401
375
|
"format/prettier": [
|
|
402
376
|
"error",
|
|
@@ -411,10 +385,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
411
385
|
if (options.html) {
|
|
412
386
|
configs2.push({
|
|
413
387
|
files: [GLOB_HTML],
|
|
388
|
+
name: "whoj/formatter/html",
|
|
414
389
|
languageOptions: {
|
|
415
390
|
parser: parserPlain
|
|
416
391
|
},
|
|
417
|
-
name: "whoj/formatter/html",
|
|
418
392
|
rules: {
|
|
419
393
|
"format/prettier": [
|
|
420
394
|
"error",
|
|
@@ -428,10 +402,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
428
402
|
if (options.xml) {
|
|
429
403
|
configs2.push({
|
|
430
404
|
files: [GLOB_XML],
|
|
405
|
+
name: "whoj/formatter/xml",
|
|
431
406
|
languageOptions: {
|
|
432
407
|
parser: parserPlain
|
|
433
408
|
},
|
|
434
|
-
name: "whoj/formatter/xml",
|
|
435
409
|
rules: {
|
|
436
410
|
"format/prettier": [
|
|
437
411
|
"error",
|
|
@@ -448,10 +422,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
448
422
|
if (options.svg) {
|
|
449
423
|
configs2.push({
|
|
450
424
|
files: [GLOB_SVG],
|
|
425
|
+
name: "whoj/formatter/svg",
|
|
451
426
|
languageOptions: {
|
|
452
427
|
parser: parserPlain
|
|
453
428
|
},
|
|
454
|
-
name: "whoj/formatter/svg",
|
|
455
429
|
rules: {
|
|
456
430
|
"format/prettier": [
|
|
457
431
|
"error",
|
|
@@ -469,18 +443,18 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
469
443
|
const formater = options.markdown === true ? "prettier" : options.markdown;
|
|
470
444
|
const GLOB_SLIDEV = !options.slidev ? [] : options.slidev === true ? ["**/slides.md"] : options.slidev.files;
|
|
471
445
|
configs2.push({
|
|
472
|
-
files: [GLOB_MARKDOWN],
|
|
473
446
|
ignores: GLOB_SLIDEV,
|
|
447
|
+
files: [GLOB_MARKDOWN],
|
|
448
|
+
name: "whoj/formatter/markdown",
|
|
474
449
|
languageOptions: {
|
|
475
450
|
parser: parserPlain
|
|
476
451
|
},
|
|
477
|
-
name: "whoj/formatter/markdown",
|
|
478
452
|
rules: {
|
|
479
453
|
[`format/${formater}`]: [
|
|
480
454
|
"error",
|
|
481
455
|
formater === "prettier" ? mergePrettierOptions(prettierOptions, {
|
|
482
|
-
|
|
483
|
-
|
|
456
|
+
parser: "markdown",
|
|
457
|
+
embeddedLanguageFormatting: "off"
|
|
484
458
|
}) : {
|
|
485
459
|
...dprintOptions,
|
|
486
460
|
language: "markdown"
|
|
@@ -491,16 +465,16 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
491
465
|
if (options.slidev) {
|
|
492
466
|
configs2.push({
|
|
493
467
|
files: GLOB_SLIDEV,
|
|
468
|
+
name: "whoj/formatter/slidev",
|
|
494
469
|
languageOptions: {
|
|
495
470
|
parser: parserPlain
|
|
496
471
|
},
|
|
497
|
-
name: "whoj/formatter/slidev",
|
|
498
472
|
rules: {
|
|
499
473
|
"format/prettier": [
|
|
500
474
|
"error",
|
|
501
475
|
mergePrettierOptions(prettierOptions, {
|
|
502
|
-
embeddedLanguageFormatting: "off",
|
|
503
476
|
parser: "slidev",
|
|
477
|
+
embeddedLanguageFormatting: "off",
|
|
504
478
|
plugins: [
|
|
505
479
|
"prettier-plugin-slidev"
|
|
506
480
|
]
|
|
@@ -513,10 +487,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
513
487
|
if (options.astro) {
|
|
514
488
|
configs2.push({
|
|
515
489
|
files: [GLOB_ASTRO],
|
|
490
|
+
name: "whoj/formatter/astro",
|
|
516
491
|
languageOptions: {
|
|
517
492
|
parser: parserPlain
|
|
518
493
|
},
|
|
519
|
-
name: "whoj/formatter/astro",
|
|
520
494
|
rules: {
|
|
521
495
|
"format/prettier": [
|
|
522
496
|
"error",
|
|
@@ -533,23 +507,23 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
533
507
|
files: [GLOB_ASTRO, GLOB_ASTRO_TS],
|
|
534
508
|
name: "whoj/formatter/astro/disables",
|
|
535
509
|
rules: {
|
|
536
|
-
"style/
|
|
537
|
-
"style/block-spacing": "off",
|
|
538
|
-
"style/comma-dangle": "off",
|
|
510
|
+
"style/semi": "off",
|
|
539
511
|
"style/indent": "off",
|
|
540
|
-
"style/no-multi-spaces": "off",
|
|
541
512
|
"style/quotes": "off",
|
|
542
|
-
"style/
|
|
513
|
+
"style/arrow-parens": "off",
|
|
514
|
+
"style/comma-dangle": "off",
|
|
515
|
+
"style/block-spacing": "off",
|
|
516
|
+
"style/no-multi-spaces": "off"
|
|
543
517
|
}
|
|
544
518
|
});
|
|
545
519
|
}
|
|
546
520
|
if (options.graphql) {
|
|
547
521
|
configs2.push({
|
|
548
522
|
files: [GLOB_GRAPHQL],
|
|
523
|
+
name: "whoj/formatter/graphql",
|
|
549
524
|
languageOptions: {
|
|
550
525
|
parser: parserPlain
|
|
551
526
|
},
|
|
552
|
-
name: "whoj/formatter/graphql",
|
|
553
527
|
rules: {
|
|
554
528
|
"format/prettier": [
|
|
555
529
|
"error",
|
|
@@ -562,15 +536,22 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
562
536
|
}
|
|
563
537
|
return configs2;
|
|
564
538
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
539
|
+
function mergePrettierOptions(options, overrides = {}) {
|
|
540
|
+
return {
|
|
541
|
+
...options,
|
|
542
|
+
...overrides,
|
|
543
|
+
plugins: [
|
|
544
|
+
...overrides.plugins || [],
|
|
545
|
+
...options.plugins || []
|
|
546
|
+
]
|
|
547
|
+
};
|
|
548
|
+
}
|
|
568
549
|
|
|
569
550
|
// src/configs/jsx.ts
|
|
570
|
-
init_esm_shims();
|
|
571
551
|
async function jsx() {
|
|
572
552
|
return [
|
|
573
553
|
{
|
|
554
|
+
name: "whoj/jsx/setup",
|
|
574
555
|
files: [GLOB_JSX, GLOB_TSX],
|
|
575
556
|
languageOptions: {
|
|
576
557
|
parserOptions: {
|
|
@@ -578,21 +559,19 @@ async function jsx() {
|
|
|
578
559
|
jsx: true
|
|
579
560
|
}
|
|
580
561
|
}
|
|
581
|
-
}
|
|
582
|
-
name: "whoj/jsx/setup"
|
|
562
|
+
}
|
|
583
563
|
}
|
|
584
564
|
];
|
|
585
565
|
}
|
|
586
566
|
|
|
587
567
|
// src/configs/vue.ts
|
|
588
|
-
init_esm_shims();
|
|
589
568
|
import { mergeProcessors } from "eslint-merge-processors";
|
|
590
569
|
async function vue(options = {}) {
|
|
591
570
|
const {
|
|
592
|
-
files = [GLOB_VUE],
|
|
593
571
|
overrides = {},
|
|
572
|
+
vueVersion = 3,
|
|
594
573
|
stylistic: stylistic2 = true,
|
|
595
|
-
|
|
574
|
+
files = [GLOB_VUE]
|
|
596
575
|
} = options;
|
|
597
576
|
const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
|
|
598
577
|
const {
|
|
@@ -609,44 +588,33 @@ async function vue(options = {}) {
|
|
|
609
588
|
]);
|
|
610
589
|
return [
|
|
611
590
|
{
|
|
591
|
+
name: "whoj/vue/setup",
|
|
592
|
+
plugins: {
|
|
593
|
+
vue: pluginVue
|
|
594
|
+
},
|
|
612
595
|
// This allows Vue plugin to work with auto imports
|
|
613
596
|
// https://github.com/vuejs/eslint-plugin-vue/pull/2422
|
|
614
597
|
languageOptions: {
|
|
615
598
|
globals: {
|
|
599
|
+
ref: "readonly",
|
|
600
|
+
toRef: "readonly",
|
|
601
|
+
watch: "readonly",
|
|
602
|
+
toRefs: "readonly",
|
|
616
603
|
computed: "readonly",
|
|
604
|
+
reactive: "readonly",
|
|
605
|
+
onMounted: "readonly",
|
|
606
|
+
shallowRef: "readonly",
|
|
617
607
|
defineEmits: "readonly",
|
|
618
|
-
defineExpose: "readonly",
|
|
619
608
|
defineProps: "readonly",
|
|
620
|
-
onMounted: "readonly",
|
|
621
609
|
onUnmounted: "readonly",
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
shallowReactive: "readonly"
|
|
625
|
-
shallowRef: "readonly",
|
|
626
|
-
toRef: "readonly",
|
|
627
|
-
toRefs: "readonly",
|
|
628
|
-
watch: "readonly",
|
|
629
|
-
watchEffect: "readonly"
|
|
610
|
+
watchEffect: "readonly",
|
|
611
|
+
defineExpose: "readonly",
|
|
612
|
+
shallowReactive: "readonly"
|
|
630
613
|
}
|
|
631
|
-
},
|
|
632
|
-
name: "whoj/vue/setup",
|
|
633
|
-
plugins: {
|
|
634
|
-
vue: pluginVue
|
|
635
614
|
}
|
|
636
615
|
},
|
|
637
616
|
{
|
|
638
617
|
files,
|
|
639
|
-
languageOptions: {
|
|
640
|
-
parser: parserVue,
|
|
641
|
-
parserOptions: {
|
|
642
|
-
ecmaFeatures: {
|
|
643
|
-
jsx: true
|
|
644
|
-
},
|
|
645
|
-
extraFileExtensions: [".vue"],
|
|
646
|
-
parser: options.typescript ? await interopDefault(import("@typescript-eslint/parser")) : null,
|
|
647
|
-
sourceType: "module"
|
|
648
|
-
}
|
|
649
|
-
},
|
|
650
618
|
name: "whoj/vue/rules",
|
|
651
619
|
processor: sfcBlocks === false ? pluginVue.processors[".vue"] : mergeProcessors([
|
|
652
620
|
pluginVue.processors[".vue"],
|
|
@@ -658,6 +626,17 @@ async function vue(options = {}) {
|
|
|
658
626
|
}
|
|
659
627
|
})
|
|
660
628
|
]),
|
|
629
|
+
languageOptions: {
|
|
630
|
+
parser: parserVue,
|
|
631
|
+
parserOptions: {
|
|
632
|
+
sourceType: "module",
|
|
633
|
+
extraFileExtensions: [".vue"],
|
|
634
|
+
ecmaFeatures: {
|
|
635
|
+
jsx: true
|
|
636
|
+
},
|
|
637
|
+
parser: options.typescript ? await interopDefault(import("@typescript-eslint/parser")) : null
|
|
638
|
+
}
|
|
639
|
+
},
|
|
661
640
|
rules: {
|
|
662
641
|
...pluginVue.configs.base.rules,
|
|
663
642
|
...vueVersion === 2 ? {
|
|
@@ -669,42 +648,50 @@ async function vue(options = {}) {
|
|
|
669
648
|
...pluginVue.configs["vue3-strongly-recommended"].rules,
|
|
670
649
|
...pluginVue.configs["vue3-recommended"].rules
|
|
671
650
|
},
|
|
651
|
+
"vue/no-v-html": "off",
|
|
652
|
+
"vue/no-dupe-keys": "off",
|
|
653
|
+
"vue/no-unused-refs": "error",
|
|
654
|
+
"vue/prefer-template": "error",
|
|
655
|
+
"vue/space-infix-ops": "error",
|
|
656
|
+
"vue/no-empty-pattern": "error",
|
|
657
|
+
"vue/no-sparse-arrays": "error",
|
|
658
|
+
"vue/require-prop-types": "off",
|
|
659
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
660
|
+
"vue/no-useless-v-bind": "error",
|
|
661
|
+
"whoj/no-top-level-await": "off",
|
|
662
|
+
// this is deprecated
|
|
663
|
+
"vue/component-tags-order": "off",
|
|
664
|
+
"vue/require-default-prop": "off",
|
|
672
665
|
"node/prefer-global/process": "off",
|
|
666
|
+
"vue/no-loss-of-precision": "error",
|
|
667
|
+
"vue/html-indent": ["error", indent],
|
|
668
|
+
"vue/max-attributes-per-line": "off",
|
|
669
|
+
"vue/html-quotes": ["error", "double"],
|
|
670
|
+
"vue/no-irregular-whitespace": "error",
|
|
671
|
+
"vue/multi-word-component-names": "off",
|
|
673
672
|
"ts/explicit-function-return-type": "off",
|
|
673
|
+
"vue/dot-location": ["error", "property"],
|
|
674
|
+
"vue/no-setup-props-reactivity-loss": "off",
|
|
675
|
+
"vue/prefer-separate-static-class": "error",
|
|
676
|
+
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
677
|
+
"vue/prop-name-casing": ["error", "camelCase"],
|
|
678
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
679
|
+
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
680
|
+
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
681
|
+
"vue/component-name-in-template-casing": ["error", "PascalCase"],
|
|
682
|
+
"vue/space-unary-ops": ["error", { words: true, nonwords: false }],
|
|
674
683
|
"vue/block-order": ["error", {
|
|
675
684
|
order: ["script", "template", "style"]
|
|
676
685
|
}],
|
|
677
|
-
"vue/component-name-in-template-casing": ["error", "PascalCase"],
|
|
678
|
-
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
679
|
-
// this is deprecated
|
|
680
|
-
"vue/component-tags-order": "off",
|
|
681
|
-
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
682
686
|
"vue/define-macros-order": ["error", {
|
|
683
687
|
order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
|
|
684
688
|
}],
|
|
685
|
-
"vue/dot-location": ["error", "property"],
|
|
686
|
-
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
687
|
-
"vue/eqeqeq": ["error", "smart"],
|
|
688
|
-
"vue/html-indent": ["error", indent],
|
|
689
|
-
"vue/html-quotes": ["error", "double"],
|
|
690
|
-
"vue/max-attributes-per-line": "off",
|
|
691
|
-
"vue/multi-word-component-names": "off",
|
|
692
|
-
"vue/no-dupe-keys": "off",
|
|
693
|
-
"vue/no-empty-pattern": "error",
|
|
694
|
-
"vue/no-irregular-whitespace": "error",
|
|
695
|
-
"vue/no-loss-of-precision": "error",
|
|
696
689
|
"vue/no-restricted-syntax": [
|
|
697
690
|
"error",
|
|
698
691
|
"DebuggerStatement",
|
|
699
692
|
"LabeledStatement",
|
|
700
693
|
"WithStatement"
|
|
701
694
|
],
|
|
702
|
-
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
703
|
-
"vue/no-setup-props-reactivity-loss": "off",
|
|
704
|
-
"vue/no-sparse-arrays": "error",
|
|
705
|
-
"vue/no-unused-refs": "error",
|
|
706
|
-
"vue/no-useless-v-bind": "error",
|
|
707
|
-
"vue/no-v-html": "off",
|
|
708
695
|
"vue/object-shorthand": [
|
|
709
696
|
"error",
|
|
710
697
|
"always",
|
|
@@ -713,39 +700,31 @@ async function vue(options = {}) {
|
|
|
713
700
|
ignoreConstructors: false
|
|
714
701
|
}
|
|
715
702
|
],
|
|
716
|
-
"vue/prefer-separate-static-class": "error",
|
|
717
|
-
"vue/prefer-template": "error",
|
|
718
|
-
"vue/prop-name-casing": ["error", "camelCase"],
|
|
719
|
-
"vue/require-default-prop": "off",
|
|
720
|
-
"vue/require-prop-types": "off",
|
|
721
|
-
"vue/space-infix-ops": "error",
|
|
722
|
-
"vue/space-unary-ops": ["error", { nonwords: false, words: true }],
|
|
723
|
-
"whoj/no-top-level-await": "off",
|
|
724
703
|
...stylistic2 ? {
|
|
704
|
+
"vue/object-curly-newline": "off",
|
|
705
|
+
"vue/comma-style": ["error", "last"],
|
|
706
|
+
"vue/template-curly-spacing": "error",
|
|
707
|
+
"vue/block-spacing": ["error", "always"],
|
|
708
|
+
"vue/space-in-parens": ["error", "never"],
|
|
709
|
+
"vue/operator-linebreak": ["error", "before"],
|
|
725
710
|
"vue/array-bracket-spacing": ["error", "never"],
|
|
711
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
712
|
+
"vue/comma-dangle": ["error", "always-multiline"],
|
|
713
|
+
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
714
|
+
"vue/padding-line-between-blocks": ["error", "always"],
|
|
726
715
|
"vue/arrow-spacing": ["error", { after: true, before: true }],
|
|
727
|
-
"vue/
|
|
716
|
+
"vue/comma-spacing": ["error", { after: true, before: false }],
|
|
717
|
+
"vue/keyword-spacing": ["error", { after: true, before: true }],
|
|
718
|
+
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
719
|
+
"vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
|
|
720
|
+
"vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
|
|
721
|
+
"vue/html-comment-content-spacing": ["error", "always", {
|
|
722
|
+
exceptions: ["-"]
|
|
723
|
+
}],
|
|
728
724
|
"vue/block-tag-newline": ["error", {
|
|
729
725
|
multiline: "always",
|
|
730
726
|
singleline: "always"
|
|
731
|
-
}]
|
|
732
|
-
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
733
|
-
"vue/comma-dangle": ["error", "always-multiline"],
|
|
734
|
-
"vue/comma-spacing": ["error", { after: true, before: false }],
|
|
735
|
-
"vue/comma-style": ["error", "last"],
|
|
736
|
-
"vue/html-comment-content-spacing": ["error", "always", {
|
|
737
|
-
exceptions: ["-"]
|
|
738
|
-
}],
|
|
739
|
-
"vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
|
|
740
|
-
"vue/keyword-spacing": ["error", { after: true, before: true }],
|
|
741
|
-
"vue/object-curly-newline": "off",
|
|
742
|
-
"vue/object-curly-spacing": ["error", "always"],
|
|
743
|
-
"vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
|
|
744
|
-
"vue/operator-linebreak": ["error", "before"],
|
|
745
|
-
"vue/padding-line-between-blocks": ["error", "always"],
|
|
746
|
-
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
747
|
-
"vue/space-in-parens": ["error", "never"],
|
|
748
|
-
"vue/template-curly-spacing": "error"
|
|
727
|
+
}]
|
|
749
728
|
} : {},
|
|
750
729
|
...overrides
|
|
751
730
|
}
|
|
@@ -754,7 +733,6 @@ async function vue(options = {}) {
|
|
|
754
733
|
}
|
|
755
734
|
|
|
756
735
|
// src/configs/node.ts
|
|
757
|
-
init_esm_shims();
|
|
758
736
|
async function node() {
|
|
759
737
|
return [
|
|
760
738
|
{
|
|
@@ -763,21 +741,20 @@ async function node() {
|
|
|
763
741
|
node: default2
|
|
764
742
|
},
|
|
765
743
|
rules: {
|
|
766
|
-
"node/handle-callback-err": ["error", "^(err|error)$"],
|
|
767
|
-
"node/no-deprecated-api": "error",
|
|
768
|
-
"node/no-exports-assign": "error",
|
|
769
744
|
"node/no-new-require": "error",
|
|
770
745
|
"node/no-path-concat": "error",
|
|
746
|
+
"node/no-deprecated-api": "error",
|
|
747
|
+
"node/no-exports-assign": "error",
|
|
771
748
|
"node/prefer-global/buffer": ["off"],
|
|
772
749
|
"node/prefer-global/process": ["off"],
|
|
773
|
-
"node/process-exit-as-throw": "error"
|
|
750
|
+
"node/process-exit-as-throw": "error",
|
|
751
|
+
"node/handle-callback-err": ["error", "^(err|error)$"]
|
|
774
752
|
}
|
|
775
753
|
}
|
|
776
754
|
];
|
|
777
755
|
}
|
|
778
756
|
|
|
779
757
|
// src/configs/nuxt.ts
|
|
780
|
-
init_esm_shims();
|
|
781
758
|
import { createConfigForNuxt } from "@nuxt/eslint-config/flat";
|
|
782
759
|
function nuxt({ dirs, features = {} } = {}) {
|
|
783
760
|
return createConfigForNuxt({
|
|
@@ -787,13 +764,12 @@ function nuxt({ dirs, features = {} } = {}) {
|
|
|
787
764
|
standalone: false
|
|
788
765
|
}
|
|
789
766
|
}).append({
|
|
790
|
-
|
|
791
|
-
|
|
767
|
+
rules: {},
|
|
768
|
+
name: "whoj/nuxt/rules"
|
|
792
769
|
}).toConfigs();
|
|
793
770
|
}
|
|
794
771
|
|
|
795
772
|
// src/configs/sort.ts
|
|
796
|
-
init_esm_shims();
|
|
797
773
|
async function sortPackageJson() {
|
|
798
774
|
return [
|
|
799
775
|
{
|
|
@@ -810,6 +786,7 @@ async function sortPackageJson() {
|
|
|
810
786
|
"jsonc/sort-keys": [
|
|
811
787
|
"error",
|
|
812
788
|
{
|
|
789
|
+
pathPattern: "^$",
|
|
813
790
|
order: [
|
|
814
791
|
"publisher",
|
|
815
792
|
"name",
|
|
@@ -855,8 +832,7 @@ async function sortPackageJson() {
|
|
|
855
832
|
"simple-git-hooks",
|
|
856
833
|
"lint-staged",
|
|
857
834
|
"eslintConfig"
|
|
858
|
-
]
|
|
859
|
-
pathPattern: "^$"
|
|
835
|
+
]
|
|
860
836
|
},
|
|
861
837
|
{
|
|
862
838
|
order: { type: "asc" },
|
|
@@ -867,15 +843,16 @@ async function sortPackageJson() {
|
|
|
867
843
|
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
868
844
|
},
|
|
869
845
|
{
|
|
846
|
+
pathPattern: "^exports.*$",
|
|
870
847
|
order: [
|
|
871
848
|
"types",
|
|
872
849
|
"import",
|
|
873
850
|
"require",
|
|
874
851
|
"default"
|
|
875
|
-
]
|
|
876
|
-
pathPattern: "^exports.*$"
|
|
852
|
+
]
|
|
877
853
|
},
|
|
878
854
|
{
|
|
855
|
+
pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$",
|
|
879
856
|
order: [
|
|
880
857
|
// client hooks only
|
|
881
858
|
"pre-commit",
|
|
@@ -888,8 +865,7 @@ async function sortPackageJson() {
|
|
|
888
865
|
"post-merge",
|
|
889
866
|
"pre-push",
|
|
890
867
|
"pre-auto-gc"
|
|
891
|
-
]
|
|
892
|
-
pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
|
|
868
|
+
]
|
|
893
869
|
}
|
|
894
870
|
]
|
|
895
871
|
}
|
|
@@ -899,12 +875,13 @@ async function sortPackageJson() {
|
|
|
899
875
|
function sortTsconfig() {
|
|
900
876
|
return [
|
|
901
877
|
{
|
|
902
|
-
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
903
878
|
name: "whoj/sort/tsconfig-json",
|
|
879
|
+
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
904
880
|
rules: {
|
|
905
881
|
"jsonc/sort-keys": [
|
|
906
882
|
"error",
|
|
907
883
|
{
|
|
884
|
+
pathPattern: "^$",
|
|
908
885
|
order: [
|
|
909
886
|
"extends",
|
|
910
887
|
"compilerOptions",
|
|
@@ -912,10 +889,10 @@ function sortTsconfig() {
|
|
|
912
889
|
"files",
|
|
913
890
|
"include",
|
|
914
891
|
"exclude"
|
|
915
|
-
]
|
|
916
|
-
pathPattern: "^$"
|
|
892
|
+
]
|
|
917
893
|
},
|
|
918
894
|
{
|
|
895
|
+
pathPattern: "^compilerOptions$",
|
|
919
896
|
order: [
|
|
920
897
|
/* Projects */
|
|
921
898
|
"incremental",
|
|
@@ -1014,8 +991,7 @@ function sortTsconfig() {
|
|
|
1014
991
|
/* Completeness */
|
|
1015
992
|
"skipDefaultLibCheck",
|
|
1016
993
|
"skipLibCheck"
|
|
1017
|
-
]
|
|
1018
|
-
pathPattern: "^compilerOptions$"
|
|
994
|
+
]
|
|
1019
995
|
}
|
|
1020
996
|
]
|
|
1021
997
|
}
|
|
@@ -1024,13 +1000,12 @@ function sortTsconfig() {
|
|
|
1024
1000
|
}
|
|
1025
1001
|
|
|
1026
1002
|
// src/configs/test.ts
|
|
1027
|
-
init_esm_shims();
|
|
1028
1003
|
var _pluginTest;
|
|
1029
1004
|
async function test(options = {}) {
|
|
1030
1005
|
const {
|
|
1006
|
+
overrides = {},
|
|
1031
1007
|
files = GLOB_TESTS,
|
|
1032
|
-
isInEditor = false
|
|
1033
|
-
overrides = {}
|
|
1008
|
+
isInEditor = false
|
|
1034
1009
|
} = options;
|
|
1035
1010
|
const [
|
|
1036
1011
|
pluginVitest,
|
|
@@ -1059,18 +1034,18 @@ async function test(options = {}) {
|
|
|
1059
1034
|
files,
|
|
1060
1035
|
name: "whoj/test/rules",
|
|
1061
1036
|
rules: {
|
|
1062
|
-
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1063
1037
|
"test/no-identical-title": "error",
|
|
1064
1038
|
"test/no-import-node-test": "error",
|
|
1065
|
-
"test/no-only-tests": isInEditor ? "warn" : "error",
|
|
1066
1039
|
"test/prefer-hooks-in-order": "error",
|
|
1067
1040
|
"test/prefer-lowercase-title": "error",
|
|
1041
|
+
"test/no-only-tests": isInEditor ? "warn" : "error",
|
|
1042
|
+
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1068
1043
|
// Disables
|
|
1069
1044
|
...{
|
|
1070
1045
|
"no-unused-expressions": "off",
|
|
1046
|
+
"whoj/no-top-level-await": "off",
|
|
1071
1047
|
"node/prefer-global/process": "off",
|
|
1072
|
-
"ts/explicit-function-return-type": "off"
|
|
1073
|
-
"whoj/no-top-level-await": "off"
|
|
1048
|
+
"ts/explicit-function-return-type": "off"
|
|
1074
1049
|
},
|
|
1075
1050
|
...overrides
|
|
1076
1051
|
}
|
|
@@ -1079,12 +1054,11 @@ async function test(options = {}) {
|
|
|
1079
1054
|
}
|
|
1080
1055
|
|
|
1081
1056
|
// src/configs/toml.ts
|
|
1082
|
-
init_esm_shims();
|
|
1083
1057
|
async function toml(options = {}) {
|
|
1084
1058
|
const {
|
|
1085
|
-
files = [GLOB_TOML],
|
|
1086
1059
|
overrides = {},
|
|
1087
|
-
stylistic: stylistic2 = true
|
|
1060
|
+
stylistic: stylistic2 = true,
|
|
1061
|
+
files = [GLOB_TOML]
|
|
1088
1062
|
} = options;
|
|
1089
1063
|
const {
|
|
1090
1064
|
indent = 2
|
|
@@ -1105,32 +1079,32 @@ async function toml(options = {}) {
|
|
|
1105
1079
|
},
|
|
1106
1080
|
{
|
|
1107
1081
|
files,
|
|
1082
|
+
name: "whoj/toml/rules",
|
|
1108
1083
|
languageOptions: {
|
|
1109
1084
|
parser: parserToml
|
|
1110
1085
|
},
|
|
1111
|
-
name: "whoj/toml/rules",
|
|
1112
1086
|
rules: {
|
|
1113
|
-
"style/spaced-comment": "off",
|
|
1114
|
-
"toml/comma-style": "error",
|
|
1115
1087
|
"toml/keys-order": "error",
|
|
1088
|
+
"toml/comma-style": "error",
|
|
1089
|
+
"toml/tables-order": "error",
|
|
1090
|
+
"style/spaced-comment": "off",
|
|
1116
1091
|
"toml/no-space-dots": "error",
|
|
1092
|
+
"toml/precision-of-integer": "error",
|
|
1117
1093
|
"toml/no-unreadable-number-separator": "error",
|
|
1118
1094
|
"toml/precision-of-fractional-seconds": "error",
|
|
1119
|
-
"toml/precision-of-integer": "error",
|
|
1120
|
-
"toml/tables-order": "error",
|
|
1121
1095
|
"toml/vue-custom-block/no-parsing-error": "error",
|
|
1122
1096
|
...stylistic2 ? {
|
|
1097
|
+
"toml/key-spacing": "error",
|
|
1098
|
+
"toml/quoted-keys": "error",
|
|
1099
|
+
"toml/spaced-comment": "error",
|
|
1123
1100
|
"toml/array-bracket-newline": "error",
|
|
1124
1101
|
"toml/array-bracket-spacing": "error",
|
|
1125
1102
|
"toml/array-element-newline": "error",
|
|
1126
|
-
"toml/
|
|
1103
|
+
"toml/table-bracket-spacing": "error",
|
|
1127
1104
|
"toml/inline-table-curly-spacing": "error",
|
|
1128
|
-
"toml/key-spacing": "error",
|
|
1129
1105
|
"toml/padding-line-between-pairs": "error",
|
|
1130
1106
|
"toml/padding-line-between-tables": "error",
|
|
1131
|
-
"toml/
|
|
1132
|
-
"toml/spaced-comment": "error",
|
|
1133
|
-
"toml/table-bracket-spacing": "error"
|
|
1107
|
+
"toml/indent": ["error", indent === "tab" ? 2 : indent]
|
|
1134
1108
|
} : {},
|
|
1135
1109
|
...overrides
|
|
1136
1110
|
}
|
|
@@ -1139,12 +1113,11 @@ async function toml(options = {}) {
|
|
|
1139
1113
|
}
|
|
1140
1114
|
|
|
1141
1115
|
// src/configs/yaml.ts
|
|
1142
|
-
init_esm_shims();
|
|
1143
1116
|
async function yaml(options = {}) {
|
|
1144
1117
|
const {
|
|
1145
|
-
files = [GLOB_YAML],
|
|
1146
1118
|
overrides = {},
|
|
1147
|
-
stylistic: stylistic2 = true
|
|
1119
|
+
stylistic: stylistic2 = true,
|
|
1120
|
+
files = [GLOB_YAML]
|
|
1148
1121
|
} = options;
|
|
1149
1122
|
const {
|
|
1150
1123
|
indent = 2,
|
|
@@ -1166,31 +1139,31 @@ async function yaml(options = {}) {
|
|
|
1166
1139
|
},
|
|
1167
1140
|
{
|
|
1168
1141
|
files,
|
|
1142
|
+
name: "whoj/yaml/rules",
|
|
1169
1143
|
languageOptions: {
|
|
1170
1144
|
parser: parserYaml
|
|
1171
1145
|
},
|
|
1172
|
-
name: "whoj/yaml/rules",
|
|
1173
1146
|
rules: {
|
|
1147
|
+
"yaml/no-empty-key": "error",
|
|
1148
|
+
"yaml/plain-scalar": "error",
|
|
1174
1149
|
"style/spaced-comment": "off",
|
|
1175
1150
|
"yaml/block-mapping": "error",
|
|
1176
1151
|
"yaml/block-sequence": "error",
|
|
1177
|
-
"yaml/no-empty-key": "error",
|
|
1178
1152
|
"yaml/no-empty-sequence-entry": "error",
|
|
1179
1153
|
"yaml/no-irregular-whitespace": "error",
|
|
1180
|
-
"yaml/plain-scalar": "error",
|
|
1181
1154
|
"yaml/vue-custom-block/no-parsing-error": "error",
|
|
1182
1155
|
...stylistic2 ? {
|
|
1183
|
-
"yaml/
|
|
1184
|
-
"yaml/
|
|
1156
|
+
"yaml/key-spacing": "error",
|
|
1157
|
+
"yaml/no-tab-indent": "error",
|
|
1158
|
+
"yaml/spaced-comment": "error",
|
|
1185
1159
|
"yaml/flow-mapping-curly-newline": "error",
|
|
1186
1160
|
"yaml/flow-mapping-curly-spacing": "error",
|
|
1187
1161
|
"yaml/flow-sequence-bracket-newline": "error",
|
|
1188
1162
|
"yaml/flow-sequence-bracket-spacing": "error",
|
|
1163
|
+
"yaml/block-sequence-hyphen-indicator-newline": "error",
|
|
1189
1164
|
"yaml/indent": ["error", indent === "tab" ? 2 : indent],
|
|
1190
|
-
"yaml/
|
|
1191
|
-
"yaml/
|
|
1192
|
-
"yaml/quotes": ["error", { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }],
|
|
1193
|
-
"yaml/spaced-comment": "error"
|
|
1165
|
+
"yaml/block-mapping-question-indicator-newline": "error",
|
|
1166
|
+
"yaml/quotes": ["error", { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }]
|
|
1194
1167
|
} : {},
|
|
1195
1168
|
...overrides
|
|
1196
1169
|
}
|
|
@@ -1199,20 +1172,19 @@ async function yaml(options = {}) {
|
|
|
1199
1172
|
}
|
|
1200
1173
|
|
|
1201
1174
|
// src/configs/astro.ts
|
|
1202
|
-
init_esm_shims();
|
|
1203
1175
|
async function astro(options = {}) {
|
|
1204
1176
|
const {
|
|
1205
|
-
files = [GLOB_ASTRO],
|
|
1206
1177
|
overrides = {},
|
|
1207
|
-
stylistic: stylistic2 = true
|
|
1178
|
+
stylistic: stylistic2 = true,
|
|
1179
|
+
files = [GLOB_ASTRO]
|
|
1208
1180
|
} = options;
|
|
1209
1181
|
const [
|
|
1210
1182
|
pluginAstro,
|
|
1211
1183
|
parserAstro,
|
|
1212
1184
|
parserTs
|
|
1213
1185
|
] = await Promise.all([
|
|
1214
|
-
interopDefault(import("
|
|
1215
|
-
interopDefault(import("
|
|
1186
|
+
interopDefault(import("eslint-plugin-astro")),
|
|
1187
|
+
interopDefault(import("astro-eslint-parser")),
|
|
1216
1188
|
interopDefault(import("@typescript-eslint/parser"))
|
|
1217
1189
|
]);
|
|
1218
1190
|
return [
|
|
@@ -1224,37 +1196,37 @@ async function astro(options = {}) {
|
|
|
1224
1196
|
},
|
|
1225
1197
|
{
|
|
1226
1198
|
files,
|
|
1199
|
+
name: "whoj/astro/rules",
|
|
1200
|
+
processor: "astro/client-side-ts",
|
|
1227
1201
|
languageOptions: {
|
|
1228
|
-
globals: pluginAstro.environments.astro.globals,
|
|
1229
1202
|
parser: parserAstro,
|
|
1203
|
+
sourceType: "module",
|
|
1204
|
+
globals: pluginAstro.environments.astro.globals,
|
|
1230
1205
|
parserOptions: {
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
}
|
|
1234
|
-
sourceType: "module"
|
|
1206
|
+
parser: parserTs,
|
|
1207
|
+
extraFileExtensions: [".astro"]
|
|
1208
|
+
}
|
|
1235
1209
|
},
|
|
1236
|
-
name: "whoj/astro/rules",
|
|
1237
|
-
processor: "astro/client-side-ts",
|
|
1238
1210
|
rules: {
|
|
1239
|
-
// use recommended rules
|
|
1240
|
-
"astro/missing-client-only-directive-value": "error",
|
|
1241
|
-
"astro/no-conflict-set-directives": "error",
|
|
1242
|
-
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
1243
|
-
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
1244
|
-
"astro/no-deprecated-astro-resolve": "error",
|
|
1245
|
-
"astro/no-deprecated-getentrybyslug": "error",
|
|
1246
|
-
"astro/no-set-html-directive": "off",
|
|
1247
|
-
"astro/no-unused-define-vars-in-style": "error",
|
|
1248
1211
|
"astro/semi": "off",
|
|
1249
1212
|
"astro/valid-compile": "error",
|
|
1250
1213
|
// Astro uses top level await for e.g. data fetching
|
|
1251
1214
|
// https://docs.astro.build/en/guides/data-fetching/#fetch-in-astro
|
|
1252
1215
|
"whoj/no-top-level-await": "off",
|
|
1216
|
+
"astro/no-set-html-directive": "off",
|
|
1217
|
+
"astro/no-conflict-set-directives": "error",
|
|
1218
|
+
"astro/no-deprecated-astro-resolve": "error",
|
|
1219
|
+
"astro/no-deprecated-getentrybyslug": "error",
|
|
1220
|
+
"astro/no-unused-define-vars-in-style": "error",
|
|
1221
|
+
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
1222
|
+
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
1223
|
+
// use recommended rules
|
|
1224
|
+
"astro/missing-client-only-directive-value": "error",
|
|
1253
1225
|
...stylistic2 ? {
|
|
1254
1226
|
"style/indent": "off",
|
|
1227
|
+
"style/no-multiple-empty-lines": "off",
|
|
1255
1228
|
"style/jsx-closing-tag-location": "off",
|
|
1256
|
-
"style/jsx-one-expression-per-line": "off"
|
|
1257
|
-
"style/no-multiple-empty-lines": "off"
|
|
1229
|
+
"style/jsx-one-expression-per-line": "off"
|
|
1258
1230
|
} : {},
|
|
1259
1231
|
...overrides
|
|
1260
1232
|
}
|
|
@@ -1263,7 +1235,6 @@ async function astro(options = {}) {
|
|
|
1263
1235
|
}
|
|
1264
1236
|
|
|
1265
1237
|
// src/configs/jsdoc.ts
|
|
1266
|
-
init_esm_shims();
|
|
1267
1238
|
async function jsdoc(options = {}) {
|
|
1268
1239
|
const {
|
|
1269
1240
|
stylistic: stylistic2 = true
|
|
@@ -1275,21 +1246,21 @@ async function jsdoc(options = {}) {
|
|
|
1275
1246
|
jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
|
|
1276
1247
|
},
|
|
1277
1248
|
rules: {
|
|
1278
|
-
"jsdoc/check-access": "warn",
|
|
1279
|
-
"jsdoc/check-param-names": "warn",
|
|
1280
|
-
"jsdoc/check-property-names": "warn",
|
|
1281
|
-
"jsdoc/check-types": "warn",
|
|
1282
1249
|
"jsdoc/empty-tags": "warn",
|
|
1283
|
-
"jsdoc/
|
|
1250
|
+
"jsdoc/check-types": "warn",
|
|
1284
1251
|
"jsdoc/no-defaults": "warn",
|
|
1252
|
+
"jsdoc/check-access": "warn",
|
|
1253
|
+
"jsdoc/require-property": "warn",
|
|
1254
|
+
"jsdoc/check-param-names": "warn",
|
|
1285
1255
|
"jsdoc/no-multi-asterisks": "warn",
|
|
1286
1256
|
"jsdoc/require-param-name": "warn",
|
|
1287
|
-
"jsdoc/
|
|
1288
|
-
"jsdoc/require-
|
|
1257
|
+
"jsdoc/check-property-names": "warn",
|
|
1258
|
+
"jsdoc/require-yields-check": "warn",
|
|
1259
|
+
"jsdoc/implements-on-classes": "warn",
|
|
1289
1260
|
"jsdoc/require-property-name": "warn",
|
|
1290
1261
|
"jsdoc/require-returns-check": "warn",
|
|
1291
1262
|
"jsdoc/require-returns-description": "off",
|
|
1292
|
-
"jsdoc/require-
|
|
1263
|
+
"jsdoc/require-property-description": "warn",
|
|
1293
1264
|
...stylistic2 ? {
|
|
1294
1265
|
"jsdoc/check-alignment": "warn",
|
|
1295
1266
|
"jsdoc/multiline-blocks": "warn"
|
|
@@ -1300,12 +1271,11 @@ async function jsdoc(options = {}) {
|
|
|
1300
1271
|
}
|
|
1301
1272
|
|
|
1302
1273
|
// src/configs/jsonc.ts
|
|
1303
|
-
init_esm_shims();
|
|
1304
1274
|
async function jsonc(options = {}) {
|
|
1305
1275
|
const {
|
|
1306
|
-
files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
1307
1276
|
overrides = {},
|
|
1308
|
-
stylistic: stylistic2 = true
|
|
1277
|
+
stylistic: stylistic2 = true,
|
|
1278
|
+
files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC]
|
|
1309
1279
|
} = options;
|
|
1310
1280
|
const {
|
|
1311
1281
|
indent = 2
|
|
@@ -1326,48 +1296,48 @@ async function jsonc(options = {}) {
|
|
|
1326
1296
|
},
|
|
1327
1297
|
{
|
|
1328
1298
|
files,
|
|
1299
|
+
name: "whoj/jsonc/rules",
|
|
1329
1300
|
languageOptions: {
|
|
1330
1301
|
parser: parserJsonc
|
|
1331
1302
|
},
|
|
1332
|
-
name: "whoj/jsonc/rules",
|
|
1333
1303
|
rules: {
|
|
1334
|
-
"jsonc/no-
|
|
1335
|
-
"jsonc/no-
|
|
1336
|
-
"jsonc/no-binary-numeric-literals": "error",
|
|
1337
|
-
"jsonc/no-dupe-keys": "error",
|
|
1338
|
-
"jsonc/no-escape-sequence-in-identifier": "error",
|
|
1339
|
-
"jsonc/no-floating-decimal": "error",
|
|
1340
|
-
"jsonc/no-hexadecimal-numeric-literals": "error",
|
|
1304
|
+
"jsonc/no-nan": "error",
|
|
1305
|
+
"jsonc/no-octal": "error",
|
|
1341
1306
|
"jsonc/no-infinity": "error",
|
|
1307
|
+
"jsonc/no-dupe-keys": "error",
|
|
1342
1308
|
"jsonc/no-multi-str": "error",
|
|
1343
|
-
"jsonc/no-
|
|
1309
|
+
"jsonc/no-plus-sign": "error",
|
|
1344
1310
|
"jsonc/no-number-props": "error",
|
|
1345
|
-
"jsonc/no-numeric-separators": "error",
|
|
1346
|
-
"jsonc/no-octal": "error",
|
|
1347
1311
|
"jsonc/no-octal-escape": "error",
|
|
1348
|
-
"jsonc/
|
|
1312
|
+
"jsonc/space-unary-ops": "error",
|
|
1349
1313
|
"jsonc/no-parenthesized": "error",
|
|
1350
|
-
"jsonc/no-plus-sign": "error",
|
|
1351
|
-
"jsonc/no-regexp-literals": "error",
|
|
1352
1314
|
"jsonc/no-sparse-arrays": "error",
|
|
1353
|
-
"jsonc/no-template-literals": "error",
|
|
1354
|
-
"jsonc/no-undefined-value": "error",
|
|
1355
|
-
"jsonc/no-unicode-codepoint-escapes": "error",
|
|
1356
1315
|
"jsonc/no-useless-escape": "error",
|
|
1357
|
-
"jsonc/space-unary-ops": "error",
|
|
1358
1316
|
"jsonc/valid-json-number": "error",
|
|
1317
|
+
"jsonc/no-bigint-literals": "error",
|
|
1318
|
+
"jsonc/no-regexp-literals": "error",
|
|
1319
|
+
"jsonc/no-undefined-value": "error",
|
|
1320
|
+
"jsonc/no-floating-decimal": "error",
|
|
1321
|
+
"jsonc/no-binary-expression": "error",
|
|
1322
|
+
"jsonc/no-template-literals": "error",
|
|
1323
|
+
"jsonc/no-numeric-separators": "error",
|
|
1324
|
+
"jsonc/no-octal-numeric-literals": "error",
|
|
1325
|
+
"jsonc/no-binary-numeric-literals": "error",
|
|
1326
|
+
"jsonc/no-unicode-codepoint-escapes": "error",
|
|
1327
|
+
"jsonc/no-hexadecimal-numeric-literals": "error",
|
|
1328
|
+
"jsonc/no-escape-sequence-in-identifier": "error",
|
|
1359
1329
|
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
1360
1330
|
...stylistic2 ? {
|
|
1361
|
-
"jsonc/
|
|
1362
|
-
"jsonc/
|
|
1363
|
-
"jsonc/comma-style": ["error", "last"],
|
|
1331
|
+
"jsonc/quotes": "error",
|
|
1332
|
+
"jsonc/quote-props": "error",
|
|
1364
1333
|
"jsonc/indent": ["error", indent],
|
|
1365
|
-
"jsonc/
|
|
1366
|
-
"jsonc/
|
|
1334
|
+
"jsonc/comma-style": ["error", "last"],
|
|
1335
|
+
"jsonc/comma-dangle": ["error", "never"],
|
|
1336
|
+
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
1367
1337
|
"jsonc/object-curly-spacing": ["error", "always"],
|
|
1368
|
-
"jsonc/
|
|
1369
|
-
"jsonc/
|
|
1370
|
-
"jsonc/
|
|
1338
|
+
"jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
|
|
1339
|
+
"jsonc/object-curly-newline": ["error", { multiline: true, consistent: true }],
|
|
1340
|
+
"jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }]
|
|
1371
1341
|
} : {},
|
|
1372
1342
|
...overrides
|
|
1373
1343
|
}
|
|
@@ -1376,7 +1346,6 @@ async function jsonc(options = {}) {
|
|
|
1376
1346
|
}
|
|
1377
1347
|
|
|
1378
1348
|
// src/configs/react.ts
|
|
1379
|
-
init_esm_shims();
|
|
1380
1349
|
import { isPackageExists as isPackageExists3 } from "local-pkg";
|
|
1381
1350
|
var ReactRefreshAllowConstantExportPackages = [
|
|
1382
1351
|
"vite"
|
|
@@ -1398,14 +1367,14 @@ var NextJsPackages = [
|
|
|
1398
1367
|
];
|
|
1399
1368
|
async function react(options = {}) {
|
|
1400
1369
|
const {
|
|
1370
|
+
tsconfigPath,
|
|
1371
|
+
overrides = {},
|
|
1401
1372
|
files = [GLOB_SRC],
|
|
1402
1373
|
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
1403
1374
|
ignoresTypeAware = [
|
|
1404
1375
|
`${GLOB_MARKDOWN}/**`,
|
|
1405
1376
|
GLOB_ASTRO_TS
|
|
1406
|
-
]
|
|
1407
|
-
overrides = {},
|
|
1408
|
-
tsconfigPath
|
|
1377
|
+
]
|
|
1409
1378
|
} = options;
|
|
1410
1379
|
await ensurePackages([
|
|
1411
1380
|
"@eslint-react/eslint-plugin",
|
|
@@ -1421,9 +1390,9 @@ async function react(options = {}) {
|
|
|
1421
1390
|
pluginReactHooks,
|
|
1422
1391
|
pluginReactRefresh
|
|
1423
1392
|
] = await Promise.all([
|
|
1424
|
-
interopDefault(import("
|
|
1425
|
-
interopDefault(import("
|
|
1426
|
-
interopDefault(import("
|
|
1393
|
+
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1394
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1395
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1427
1396
|
]);
|
|
1428
1397
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists3(i));
|
|
1429
1398
|
const isUsingRemix = RemixPackages.some((i) => isPackageExists3(i));
|
|
@@ -1434,42 +1403,88 @@ async function react(options = {}) {
|
|
|
1434
1403
|
{
|
|
1435
1404
|
name: "whoj/react/setup",
|
|
1436
1405
|
plugins: {
|
|
1406
|
+
"react-hooks": pluginReactHooks,
|
|
1437
1407
|
"react": plugins["@eslint-react"],
|
|
1408
|
+
"react-refresh": pluginReactRefresh,
|
|
1438
1409
|
"react-dom": plugins["@eslint-react/dom"],
|
|
1439
|
-
"react-
|
|
1410
|
+
"react-web-api": plugins["@eslint-react/web-api"],
|
|
1440
1411
|
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1441
|
-
"react-naming-convention": plugins["@eslint-react/naming-convention"]
|
|
1442
|
-
"react-refresh": pluginReactRefresh,
|
|
1443
|
-
"react-web-api": plugins["@eslint-react/web-api"]
|
|
1412
|
+
"react-naming-convention": plugins["@eslint-react/naming-convention"]
|
|
1444
1413
|
}
|
|
1445
1414
|
},
|
|
1446
1415
|
{
|
|
1447
1416
|
files,
|
|
1417
|
+
name: "whoj/react/rules",
|
|
1448
1418
|
languageOptions: {
|
|
1419
|
+
sourceType: "module",
|
|
1449
1420
|
parserOptions: {
|
|
1450
1421
|
ecmaFeatures: {
|
|
1451
1422
|
jsx: true
|
|
1452
1423
|
}
|
|
1453
|
-
}
|
|
1454
|
-
sourceType: "module"
|
|
1424
|
+
}
|
|
1455
1425
|
},
|
|
1456
|
-
name: "whoj/react/rules",
|
|
1457
1426
|
rules: {
|
|
1458
|
-
|
|
1459
|
-
"react
|
|
1460
|
-
"react
|
|
1461
|
-
"react
|
|
1462
|
-
"react
|
|
1463
|
-
"react
|
|
1464
|
-
"react
|
|
1427
|
+
"react/jsx-uses-vars": "warn",
|
|
1428
|
+
"react/no-create-ref": "error",
|
|
1429
|
+
"react/no-forward-ref": "warn",
|
|
1430
|
+
"react/no-prop-types": "error",
|
|
1431
|
+
"react/no-children-map": "warn",
|
|
1432
|
+
"react/no-implicit-key": "warn",
|
|
1433
|
+
"react/no-missing-key": "error",
|
|
1434
|
+
"react/no-string-refs": "error",
|
|
1435
|
+
"react/no-unused-state": "warn",
|
|
1436
|
+
"react/no-children-only": "warn",
|
|
1437
|
+
"react/no-clone-element": "warn",
|
|
1465
1438
|
"react-dom/no-namespace": "error",
|
|
1466
|
-
"react-dom/no-render-return-value": "error",
|
|
1467
1439
|
"react-dom/no-script-url": "warn",
|
|
1468
|
-
"react
|
|
1469
|
-
"react
|
|
1440
|
+
"react/no-children-count": "warn",
|
|
1441
|
+
"react/no-default-props": "error",
|
|
1442
|
+
"react/no-duplicate-key": "error",
|
|
1443
|
+
"react/no-array-index-key": "warn",
|
|
1444
|
+
"react/no-context-provider": "warn",
|
|
1445
|
+
"react/no-children-for-each": "warn",
|
|
1446
|
+
"react/no-children-to-array": "warn",
|
|
1447
|
+
"react/no-comment-textnodes": "warn",
|
|
1448
|
+
"react-dom/no-find-dom-node": "error",
|
|
1470
1449
|
// recommended rules react-hooks
|
|
1471
1450
|
"react-hooks/exhaustive-deps": "warn",
|
|
1472
1451
|
"react-hooks/rules-of-hooks": "error",
|
|
1452
|
+
"react/no-nested-components": "error",
|
|
1453
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
1454
|
+
"react/no-component-will-mount": "error",
|
|
1455
|
+
"react/prefer-shorthand-boolean": "warn",
|
|
1456
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
1457
|
+
"react/no-component-will-update": "error",
|
|
1458
|
+
"react/no-direct-mutation-state": "error",
|
|
1459
|
+
"react/no-unstable-context-value": "warn",
|
|
1460
|
+
"react/no-unstable-default-props": "warn",
|
|
1461
|
+
"react/prefer-shorthand-fragment": "warn",
|
|
1462
|
+
"react-dom/no-missing-button-type": "warn",
|
|
1463
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
1464
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
1465
|
+
"react-dom/no-render-return-value": "error",
|
|
1466
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1467
|
+
// recommended rules from @eslint-react
|
|
1468
|
+
"react/ensure-forward-ref-using-ref": "warn",
|
|
1469
|
+
"react/no-access-state-in-setstate": "error",
|
|
1470
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
1471
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
1472
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
1473
|
+
"react/prefer-destructuring-assignment": "warn",
|
|
1474
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1475
|
+
// recommended rules from @eslint-react/web-api
|
|
1476
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
1477
|
+
"react/no-component-will-receive-props": "error",
|
|
1478
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1479
|
+
"react/no-unused-class-component-members": "warn",
|
|
1480
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
1481
|
+
// recommended rules from @eslint-react/dom
|
|
1482
|
+
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
1483
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
1484
|
+
"react/no-redundant-should-component-update": "error",
|
|
1485
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
1486
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1487
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1473
1488
|
// react refresh
|
|
1474
1489
|
"react-refresh/only-export-components": [
|
|
1475
1490
|
"warn",
|
|
@@ -1501,52 +1516,6 @@ async function react(options = {}) {
|
|
|
1501
1516
|
]
|
|
1502
1517
|
}
|
|
1503
1518
|
],
|
|
1504
|
-
// recommended rules from @eslint-react/web-api
|
|
1505
|
-
"react-web-api/no-leaked-event-listener": "warn",
|
|
1506
|
-
"react-web-api/no-leaked-interval": "warn",
|
|
1507
|
-
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1508
|
-
"react-web-api/no-leaked-timeout": "warn",
|
|
1509
|
-
// recommended rules from @eslint-react
|
|
1510
|
-
"react/ensure-forward-ref-using-ref": "warn",
|
|
1511
|
-
"react/jsx-no-duplicate-props": "warn",
|
|
1512
|
-
"react/jsx-uses-vars": "warn",
|
|
1513
|
-
"react/no-access-state-in-setstate": "error",
|
|
1514
|
-
"react/no-array-index-key": "warn",
|
|
1515
|
-
"react/no-children-count": "warn",
|
|
1516
|
-
"react/no-children-for-each": "warn",
|
|
1517
|
-
"react/no-children-map": "warn",
|
|
1518
|
-
"react/no-children-only": "warn",
|
|
1519
|
-
"react/no-children-to-array": "warn",
|
|
1520
|
-
"react/no-clone-element": "warn",
|
|
1521
|
-
"react/no-comment-textnodes": "warn",
|
|
1522
|
-
"react/no-component-will-mount": "error",
|
|
1523
|
-
"react/no-component-will-receive-props": "error",
|
|
1524
|
-
"react/no-component-will-update": "error",
|
|
1525
|
-
"react/no-context-provider": "warn",
|
|
1526
|
-
"react/no-create-ref": "error",
|
|
1527
|
-
"react/no-default-props": "error",
|
|
1528
|
-
"react/no-direct-mutation-state": "error",
|
|
1529
|
-
"react/no-duplicate-key": "error",
|
|
1530
|
-
"react/no-forward-ref": "warn",
|
|
1531
|
-
"react/no-implicit-key": "warn",
|
|
1532
|
-
"react/no-missing-key": "error",
|
|
1533
|
-
"react/no-nested-components": "error",
|
|
1534
|
-
"react/no-prop-types": "error",
|
|
1535
|
-
"react/no-redundant-should-component-update": "error",
|
|
1536
|
-
"react/no-set-state-in-component-did-mount": "warn",
|
|
1537
|
-
"react/no-set-state-in-component-did-update": "warn",
|
|
1538
|
-
"react/no-set-state-in-component-will-update": "warn",
|
|
1539
|
-
"react/no-string-refs": "error",
|
|
1540
|
-
"react/no-unsafe-component-will-mount": "warn",
|
|
1541
|
-
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1542
|
-
"react/no-unsafe-component-will-update": "warn",
|
|
1543
|
-
"react/no-unstable-context-value": "warn",
|
|
1544
|
-
"react/no-unstable-default-props": "warn",
|
|
1545
|
-
"react/no-unused-class-component-members": "warn",
|
|
1546
|
-
"react/no-unused-state": "warn",
|
|
1547
|
-
"react/prefer-destructuring-assignment": "warn",
|
|
1548
|
-
"react/prefer-shorthand-boolean": "warn",
|
|
1549
|
-
"react/prefer-shorthand-fragment": "warn",
|
|
1550
1519
|
// overrides
|
|
1551
1520
|
...overrides
|
|
1552
1521
|
}
|
|
@@ -1563,12 +1532,11 @@ async function react(options = {}) {
|
|
|
1563
1532
|
}
|
|
1564
1533
|
|
|
1565
1534
|
// src/configs/solid.ts
|
|
1566
|
-
init_esm_shims();
|
|
1567
1535
|
async function solid(options = {}) {
|
|
1568
1536
|
const {
|
|
1569
|
-
files = [GLOB_JSX, GLOB_TSX],
|
|
1570
1537
|
overrides = {},
|
|
1571
|
-
typescript: typescript2 = true
|
|
1538
|
+
typescript: typescript2 = true,
|
|
1539
|
+
files = [GLOB_JSX, GLOB_TSX]
|
|
1572
1540
|
} = options;
|
|
1573
1541
|
await ensurePackages([
|
|
1574
1542
|
"eslint-plugin-solid"
|
|
@@ -1579,7 +1547,7 @@ async function solid(options = {}) {
|
|
|
1579
1547
|
pluginSolid,
|
|
1580
1548
|
parserTs
|
|
1581
1549
|
] = await Promise.all([
|
|
1582
|
-
interopDefault(import("
|
|
1550
|
+
interopDefault(import("eslint-plugin-solid")),
|
|
1583
1551
|
interopDefault(import("@typescript-eslint/parser"))
|
|
1584
1552
|
]);
|
|
1585
1553
|
return [
|
|
@@ -1591,46 +1559,46 @@ async function solid(options = {}) {
|
|
|
1591
1559
|
},
|
|
1592
1560
|
{
|
|
1593
1561
|
files,
|
|
1562
|
+
name: "whoj/solid/rules",
|
|
1594
1563
|
languageOptions: {
|
|
1595
1564
|
parser: parserTs,
|
|
1565
|
+
sourceType: "module",
|
|
1596
1566
|
parserOptions: {
|
|
1597
1567
|
ecmaFeatures: {
|
|
1598
1568
|
jsx: true
|
|
1599
1569
|
},
|
|
1600
1570
|
...isTypeAware ? { project: tsconfigPath } : {}
|
|
1601
|
-
}
|
|
1602
|
-
sourceType: "module"
|
|
1571
|
+
}
|
|
1603
1572
|
},
|
|
1604
|
-
name: "whoj/solid/rules",
|
|
1605
1573
|
rules: {
|
|
1606
|
-
// reactivity
|
|
1607
|
-
"solid/components-return-once": "warn",
|
|
1608
|
-
"solid/event-handlers": ["error", {
|
|
1609
|
-
// if true, don't warn on ambiguously named event handlers like `onclick` or `onchange`
|
|
1610
|
-
ignoreCase: false,
|
|
1611
|
-
// if true, warn when spreading event handlers onto JSX. Enable for Solid < v1.6.
|
|
1612
|
-
warnOnSpread: false
|
|
1613
|
-
}],
|
|
1614
1574
|
// these rules are mostly style suggestions
|
|
1615
1575
|
"solid/imports": "error",
|
|
1616
|
-
|
|
1617
|
-
"solid/
|
|
1618
|
-
"solid/jsx-no-script-url": "error",
|
|
1576
|
+
"solid/reactivity": "warn",
|
|
1577
|
+
"solid/prefer-for": "error",
|
|
1619
1578
|
"solid/jsx-no-undef": "error",
|
|
1620
1579
|
"solid/jsx-uses-vars": "error",
|
|
1580
|
+
"solid/no-react-deps": "error",
|
|
1621
1581
|
"solid/no-destructure": "error",
|
|
1582
|
+
"solid/jsx-no-script-url": "error",
|
|
1583
|
+
"solid/self-closing-comp": "error",
|
|
1584
|
+
// reactivity
|
|
1585
|
+
"solid/components-return-once": "warn",
|
|
1586
|
+
"solid/no-unknown-namespaces": "error",
|
|
1587
|
+
// identifier usage is important
|
|
1588
|
+
"solid/jsx-no-duplicate-props": "error",
|
|
1589
|
+
"solid/no-react-specific-props": "error",
|
|
1622
1590
|
// security problems
|
|
1623
1591
|
"solid/no-innerhtml": ["error", { allowStatic: true }],
|
|
1624
|
-
"solid/no-react-deps": "error",
|
|
1625
|
-
"solid/no-react-specific-props": "error",
|
|
1626
|
-
"solid/no-unknown-namespaces": "error",
|
|
1627
|
-
"solid/prefer-for": "error",
|
|
1628
|
-
"solid/reactivity": "warn",
|
|
1629
|
-
"solid/self-closing-comp": "error",
|
|
1630
1592
|
"solid/style-prop": ["error", { styleProps: ["style", "css"] }],
|
|
1593
|
+
"solid/event-handlers": ["error", {
|
|
1594
|
+
// if true, don't warn on ambiguously named event handlers like `onclick` or `onchange`
|
|
1595
|
+
ignoreCase: false,
|
|
1596
|
+
// if true, warn when spreading event handlers onto JSX. Enable for Solid < v1.6.
|
|
1597
|
+
warnOnSpread: false
|
|
1598
|
+
}],
|
|
1631
1599
|
...typescript2 ? {
|
|
1632
|
-
"solid/
|
|
1633
|
-
"solid/no-
|
|
1600
|
+
"solid/no-unknown-namespaces": "off",
|
|
1601
|
+
"solid/jsx-no-undef": ["error", { typescriptEnabled: true }]
|
|
1634
1602
|
} : {},
|
|
1635
1603
|
// overrides
|
|
1636
1604
|
...overrides
|
|
@@ -1640,12 +1608,11 @@ async function solid(options = {}) {
|
|
|
1640
1608
|
}
|
|
1641
1609
|
|
|
1642
1610
|
// src/configs/svelte.ts
|
|
1643
|
-
init_esm_shims();
|
|
1644
1611
|
async function svelte(options = {}) {
|
|
1645
1612
|
const {
|
|
1646
|
-
files = [GLOB_SVELTE],
|
|
1647
1613
|
overrides = {},
|
|
1648
|
-
stylistic: stylistic2 = true
|
|
1614
|
+
stylistic: stylistic2 = true,
|
|
1615
|
+
files = [GLOB_SVELTE]
|
|
1649
1616
|
} = options;
|
|
1650
1617
|
const {
|
|
1651
1618
|
indent = 2,
|
|
@@ -1658,8 +1625,8 @@ async function svelte(options = {}) {
|
|
|
1658
1625
|
pluginSvelte,
|
|
1659
1626
|
parserSvelte
|
|
1660
1627
|
] = await Promise.all([
|
|
1661
|
-
interopDefault(import("
|
|
1662
|
-
interopDefault(import("
|
|
1628
|
+
interopDefault(import("eslint-plugin-svelte")),
|
|
1629
|
+
interopDefault(import("svelte-eslint-parser"))
|
|
1663
1630
|
]);
|
|
1664
1631
|
return [
|
|
1665
1632
|
{
|
|
@@ -1670,6 +1637,8 @@ async function svelte(options = {}) {
|
|
|
1670
1637
|
},
|
|
1671
1638
|
{
|
|
1672
1639
|
files,
|
|
1640
|
+
name: "whoj/svelte/rules",
|
|
1641
|
+
processor: pluginSvelte.processors[".svelte"],
|
|
1673
1642
|
languageOptions: {
|
|
1674
1643
|
parser: parserSvelte,
|
|
1675
1644
|
parserOptions: {
|
|
@@ -1677,45 +1646,43 @@ async function svelte(options = {}) {
|
|
|
1677
1646
|
parser: options.typescript ? await interopDefault(import("@typescript-eslint/parser")) : null
|
|
1678
1647
|
}
|
|
1679
1648
|
},
|
|
1680
|
-
name: "whoj/svelte/rules",
|
|
1681
|
-
processor: pluginSvelte.processors[".svelte"],
|
|
1682
1649
|
rules: {
|
|
1683
|
-
"import/no-mutable-exports": "off",
|
|
1684
1650
|
"no-undef": "off",
|
|
1685
1651
|
// incompatible with most recent (attribute-form) generic types RFC
|
|
1686
|
-
"
|
|
1687
|
-
|
|
1688
|
-
caughtErrors: "none",
|
|
1689
|
-
ignoreRestSiblings: true,
|
|
1690
|
-
vars: "all",
|
|
1691
|
-
varsIgnorePattern: "^(\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
|
|
1692
|
-
}],
|
|
1693
|
-
"svelte/comment-directive": "error",
|
|
1652
|
+
"svelte/system": "error",
|
|
1653
|
+
"svelte/valid-each-key": "error",
|
|
1694
1654
|
"svelte/no-at-debug-tags": "warn",
|
|
1695
1655
|
"svelte/no-at-html-tags": "error",
|
|
1696
|
-
"
|
|
1697
|
-
"svelte/
|
|
1698
|
-
"svelte/no-dupe-use-directives": "error",
|
|
1656
|
+
"import/no-mutable-exports": "off",
|
|
1657
|
+
"svelte/comment-directive": "error",
|
|
1699
1658
|
"svelte/no-dynamic-slot-name": "error",
|
|
1700
|
-
"svelte/no-
|
|
1659
|
+
"svelte/no-reactive-literals": "error",
|
|
1660
|
+
"svelte/no-useless-mustaches": "error",
|
|
1701
1661
|
"svelte/no-inner-declarations": "error",
|
|
1662
|
+
"svelte/no-reactive-functions": "error",
|
|
1663
|
+
"svelte/no-dupe-else-if-blocks": "error",
|
|
1664
|
+
"svelte/no-dupe-use-directives": "error",
|
|
1702
1665
|
"svelte/no-not-function-handler": "error",
|
|
1666
|
+
"svelte/no-unused-svelte-ignore": "error",
|
|
1667
|
+
"svelte/no-dupe-style-properties": "error",
|
|
1703
1668
|
"svelte/no-object-in-text-mustaches": "error",
|
|
1704
|
-
"svelte/no-reactive-functions": "error",
|
|
1705
|
-
"svelte/no-reactive-literals": "error",
|
|
1706
|
-
"svelte/no-shorthand-style-property-overrides": "error",
|
|
1707
1669
|
"svelte/no-unknown-style-directive-property": "error",
|
|
1708
|
-
"svelte/no-
|
|
1709
|
-
"svelte/no-useless-mustaches": "error",
|
|
1670
|
+
"svelte/no-shorthand-style-property-overrides": "error",
|
|
1710
1671
|
"svelte/require-store-callbacks-use-set-param": "error",
|
|
1711
|
-
"svelte/
|
|
1712
|
-
"
|
|
1672
|
+
"svelte/no-export-load-in-svelte-module-in-kit-pages": "error",
|
|
1673
|
+
"no-unused-vars": ["error", {
|
|
1674
|
+
vars: "all",
|
|
1675
|
+
args: "none",
|
|
1676
|
+
caughtErrors: "none",
|
|
1677
|
+
ignoreRestSiblings: true,
|
|
1678
|
+
varsIgnorePattern: "^(\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
|
|
1679
|
+
}],
|
|
1713
1680
|
"unused-imports/no-unused-vars": [
|
|
1714
1681
|
"error",
|
|
1715
1682
|
{
|
|
1683
|
+
vars: "all",
|
|
1716
1684
|
args: "after-used",
|
|
1717
1685
|
argsIgnorePattern: "^_",
|
|
1718
|
-
vars: "all",
|
|
1719
1686
|
varsIgnorePattern: "^(_|\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
|
|
1720
1687
|
}
|
|
1721
1688
|
],
|
|
@@ -1724,14 +1691,14 @@ async function svelte(options = {}) {
|
|
|
1724
1691
|
// superseded by svelte/indent
|
|
1725
1692
|
"style/no-trailing-spaces": "off",
|
|
1726
1693
|
// superseded by svelte/no-trailing-spaces
|
|
1727
|
-
"svelte/derived-has-same-inputs-outputs": "error",
|
|
1728
|
-
"svelte/html-closing-bracket-spacing": "error",
|
|
1729
|
-
"svelte/html-quotes": ["error", { prefer: quotes === "backtick" ? "double" : quotes }],
|
|
1730
|
-
"svelte/indent": ["error", { alignAttributesVertically: true, indent }],
|
|
1731
1694
|
"svelte/mustache-spacing": "error",
|
|
1732
|
-
"svelte/no-spaces-around-equal-signs-in-attribute": "error",
|
|
1733
1695
|
"svelte/no-trailing-spaces": "error",
|
|
1734
|
-
"svelte/spaced-html-comment": "error"
|
|
1696
|
+
"svelte/spaced-html-comment": "error",
|
|
1697
|
+
"svelte/html-closing-bracket-spacing": "error",
|
|
1698
|
+
"svelte/derived-has-same-inputs-outputs": "error",
|
|
1699
|
+
"svelte/no-spaces-around-equal-signs-in-attribute": "error",
|
|
1700
|
+
"svelte/indent": ["error", { indent, alignAttributesVertically: true }],
|
|
1701
|
+
"svelte/html-quotes": ["error", { prefer: quotes === "backtick" ? "double" : quotes }]
|
|
1735
1702
|
} : {},
|
|
1736
1703
|
...overrides
|
|
1737
1704
|
}
|
|
@@ -1740,11 +1707,10 @@ async function svelte(options = {}) {
|
|
|
1740
1707
|
}
|
|
1741
1708
|
|
|
1742
1709
|
// src/configs/unocss.ts
|
|
1743
|
-
init_esm_shims();
|
|
1744
1710
|
async function unocss(options = {}) {
|
|
1745
1711
|
const {
|
|
1746
|
-
|
|
1747
|
-
|
|
1712
|
+
strict = false,
|
|
1713
|
+
attributify = true
|
|
1748
1714
|
} = options;
|
|
1749
1715
|
await ensurePackages([
|
|
1750
1716
|
"@unocss/eslint-plugin"
|
|
@@ -1774,7 +1740,6 @@ async function unocss(options = {}) {
|
|
|
1774
1740
|
}
|
|
1775
1741
|
|
|
1776
1742
|
// src/configs/command.ts
|
|
1777
|
-
init_esm_shims();
|
|
1778
1743
|
import createCommand from "eslint-plugin-command/config";
|
|
1779
1744
|
async function command() {
|
|
1780
1745
|
return [
|
|
@@ -1786,21 +1751,19 @@ async function command() {
|
|
|
1786
1751
|
}
|
|
1787
1752
|
|
|
1788
1753
|
// src/configs/ignores.ts
|
|
1789
|
-
init_esm_shims();
|
|
1790
1754
|
async function ignores(userIgnores = []) {
|
|
1791
1755
|
return [
|
|
1792
1756
|
{
|
|
1757
|
+
name: "whoj/ignores",
|
|
1793
1758
|
ignores: [
|
|
1794
1759
|
...GLOB_EXCLUDE,
|
|
1795
1760
|
...userIgnores
|
|
1796
|
-
]
|
|
1797
|
-
name: "whoj/ignores"
|
|
1761
|
+
]
|
|
1798
1762
|
}
|
|
1799
1763
|
];
|
|
1800
1764
|
}
|
|
1801
1765
|
|
|
1802
1766
|
// src/configs/imports.ts
|
|
1803
|
-
init_esm_shims();
|
|
1804
1767
|
async function imports(options = {}) {
|
|
1805
1768
|
const {
|
|
1806
1769
|
stylistic: stylistic2 = true
|
|
@@ -1809,20 +1772,20 @@ async function imports(options = {}) {
|
|
|
1809
1772
|
{
|
|
1810
1773
|
name: "whoj/imports/rules",
|
|
1811
1774
|
plugins: {
|
|
1812
|
-
|
|
1813
|
-
|
|
1775
|
+
whoj: default3,
|
|
1776
|
+
import: pluginImport
|
|
1814
1777
|
},
|
|
1815
1778
|
rules: {
|
|
1816
|
-
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
1817
1779
|
"import/first": "error",
|
|
1780
|
+
"whoj/import-dedupe": "error",
|
|
1781
|
+
"whoj/no-import-dist": "error",
|
|
1818
1782
|
"import/no-duplicates": "error",
|
|
1819
|
-
"import/no-mutable-exports": "error",
|
|
1820
|
-
"import/no-named-default": "error",
|
|
1821
1783
|
"import/no-self-import": "error",
|
|
1784
|
+
"import/no-named-default": "error",
|
|
1785
|
+
"import/no-mutable-exports": "error",
|
|
1822
1786
|
"import/no-webpack-loader-syntax": "error",
|
|
1823
|
-
"whoj/import-dedupe": "error",
|
|
1824
|
-
"whoj/no-import-dist": "error",
|
|
1825
1787
|
"whoj/no-import-node-modules-by-path": "error",
|
|
1788
|
+
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
1826
1789
|
...stylistic2 ? {
|
|
1827
1790
|
"import/newline-after-import": ["error", { count: 1 }]
|
|
1828
1791
|
} : {}
|
|
@@ -1832,7 +1795,6 @@ async function imports(options = {}) {
|
|
|
1832
1795
|
}
|
|
1833
1796
|
|
|
1834
1797
|
// src/configs/unicorn.ts
|
|
1835
|
-
init_esm_shims();
|
|
1836
1798
|
async function unicorn(options = {}) {
|
|
1837
1799
|
return [
|
|
1838
1800
|
{
|
|
@@ -1842,21 +1804,21 @@ async function unicorn(options = {}) {
|
|
|
1842
1804
|
},
|
|
1843
1805
|
rules: {
|
|
1844
1806
|
...options.allRecommended ? default4.configs["flat/recommended"].rules : {
|
|
1845
|
-
"unicorn/consistent-empty-array-spread": "error",
|
|
1846
|
-
"unicorn/error-message": "error",
|
|
1847
1807
|
"unicorn/escape-case": "error",
|
|
1848
|
-
"unicorn/new-for-builtins": "error",
|
|
1849
|
-
"unicorn/no-instanceof-array": "error",
|
|
1850
1808
|
"unicorn/no-new-array": "error",
|
|
1809
|
+
"unicorn/error-message": "error",
|
|
1851
1810
|
"unicorn/no-new-buffer": "error",
|
|
1852
|
-
"unicorn/number-literal-case": "error",
|
|
1853
|
-
"unicorn/prefer-dom-node-text-content": "error",
|
|
1854
1811
|
"unicorn/prefer-includes": "error",
|
|
1812
|
+
"unicorn/throw-new-error": "error",
|
|
1813
|
+
"unicorn/new-for-builtins": "error",
|
|
1814
|
+
"unicorn/prefer-type-error": "error",
|
|
1815
|
+
"unicorn/no-instanceof-array": "error",
|
|
1816
|
+
"unicorn/number-literal-case": "error",
|
|
1855
1817
|
"unicorn/prefer-node-protocol": "error",
|
|
1856
1818
|
"unicorn/prefer-number-properties": "error",
|
|
1857
|
-
"unicorn/prefer-
|
|
1858
|
-
"unicorn/
|
|
1859
|
-
"unicorn/
|
|
1819
|
+
"unicorn/prefer-dom-node-text-content": "error",
|
|
1820
|
+
"unicorn/consistent-empty-array-spread": "error",
|
|
1821
|
+
"unicorn/prefer-string-starts-ends-with": "error"
|
|
1860
1822
|
}
|
|
1861
1823
|
}
|
|
1862
1824
|
}
|
|
@@ -1864,7 +1826,6 @@ async function unicorn(options = {}) {
|
|
|
1864
1826
|
}
|
|
1865
1827
|
|
|
1866
1828
|
// src/configs/comments.ts
|
|
1867
|
-
init_esm_shims();
|
|
1868
1829
|
async function comments() {
|
|
1869
1830
|
return [
|
|
1870
1831
|
{
|
|
@@ -1873,81 +1834,79 @@ async function comments() {
|
|
|
1873
1834
|
"eslint-comments": default7
|
|
1874
1835
|
},
|
|
1875
1836
|
rules: {
|
|
1876
|
-
"eslint-comments/no-
|
|
1837
|
+
"eslint-comments/no-unused-enable": "error",
|
|
1877
1838
|
"eslint-comments/no-duplicate-disable": "error",
|
|
1878
1839
|
"eslint-comments/no-unlimited-disable": "error",
|
|
1879
|
-
"eslint-comments/no-
|
|
1840
|
+
"eslint-comments/no-aggregating-enable": "error"
|
|
1880
1841
|
}
|
|
1881
1842
|
}
|
|
1882
1843
|
];
|
|
1883
1844
|
}
|
|
1884
1845
|
|
|
1885
1846
|
// src/configs/disables.ts
|
|
1886
|
-
init_esm_shims();
|
|
1887
1847
|
async function disables() {
|
|
1888
1848
|
return [
|
|
1889
1849
|
{
|
|
1890
|
-
files: [`**/scripts/${GLOB_SRC}`],
|
|
1891
1850
|
name: "whoj/disables/scripts",
|
|
1851
|
+
files: [`**/scripts/${GLOB_SRC}`],
|
|
1892
1852
|
rules: {
|
|
1893
1853
|
"no-console": "off",
|
|
1894
|
-
"
|
|
1895
|
-
"
|
|
1854
|
+
"whoj/no-top-level-await": "off",
|
|
1855
|
+
"ts/explicit-function-return-type": "off"
|
|
1896
1856
|
}
|
|
1897
1857
|
},
|
|
1898
1858
|
{
|
|
1899
|
-
files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
1900
1859
|
name: "whoj/disables/cli",
|
|
1860
|
+
files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
1901
1861
|
rules: {
|
|
1902
1862
|
"no-console": "off",
|
|
1903
1863
|
"whoj/no-top-level-await": "off"
|
|
1904
1864
|
}
|
|
1905
1865
|
},
|
|
1906
1866
|
{
|
|
1907
|
-
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
|
|
1908
1867
|
name: "whoj/disables/bin",
|
|
1868
|
+
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
|
|
1909
1869
|
rules: {
|
|
1910
1870
|
"whoj/no-import-dist": "off",
|
|
1911
1871
|
"whoj/no-import-node-modules-by-path": "off"
|
|
1912
1872
|
}
|
|
1913
1873
|
},
|
|
1914
1874
|
{
|
|
1915
|
-
files: ["**/*.d.?([cm])ts"],
|
|
1916
1875
|
name: "whoj/disables/dts",
|
|
1876
|
+
files: ["**/*.d.?([cm])ts"],
|
|
1917
1877
|
rules: {
|
|
1918
|
-
"eslint-comments/no-unlimited-disable": "off",
|
|
1919
1878
|
"import/no-duplicates": "off",
|
|
1920
1879
|
"no-restricted-syntax": "off",
|
|
1921
|
-
"unused-imports/no-unused-vars": "off"
|
|
1880
|
+
"unused-imports/no-unused-vars": "off",
|
|
1881
|
+
"eslint-comments/no-unlimited-disable": "off"
|
|
1922
1882
|
}
|
|
1923
1883
|
},
|
|
1924
1884
|
{
|
|
1925
|
-
files: ["**/*.js", "**/*.cjs"],
|
|
1926
1885
|
name: "whoj/disables/cjs",
|
|
1886
|
+
files: ["**/*.js", "**/*.cjs"],
|
|
1927
1887
|
rules: {
|
|
1928
1888
|
"ts/no-require-imports": "off"
|
|
1929
1889
|
}
|
|
1930
1890
|
},
|
|
1931
1891
|
{
|
|
1932
|
-
files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
|
|
1933
1892
|
name: "whoj/disables/config-files",
|
|
1893
|
+
files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
|
|
1934
1894
|
rules: {
|
|
1935
1895
|
"no-console": "off",
|
|
1936
|
-
"
|
|
1937
|
-
"
|
|
1896
|
+
"whoj/no-top-level-await": "off",
|
|
1897
|
+
"ts/explicit-function-return-type": "off"
|
|
1938
1898
|
}
|
|
1939
1899
|
}
|
|
1940
1900
|
];
|
|
1941
1901
|
}
|
|
1942
1902
|
|
|
1943
1903
|
// src/configs/markdown.ts
|
|
1944
|
-
init_esm_shims();
|
|
1945
1904
|
import { mergeProcessors as mergeProcessors2, processorPassThrough } from "eslint-merge-processors";
|
|
1946
1905
|
async function markdown(options = {}) {
|
|
1947
1906
|
const {
|
|
1907
|
+
overrides = {},
|
|
1948
1908
|
componentExts = [],
|
|
1949
|
-
files = [GLOB_MARKDOWN]
|
|
1950
|
-
overrides = {}
|
|
1909
|
+
files = [GLOB_MARKDOWN]
|
|
1951
1910
|
} = options;
|
|
1952
1911
|
const markdown2 = await interopDefault(import("@eslint/markdown"));
|
|
1953
1912
|
return [
|
|
@@ -1959,8 +1918,8 @@ async function markdown(options = {}) {
|
|
|
1959
1918
|
},
|
|
1960
1919
|
{
|
|
1961
1920
|
files,
|
|
1962
|
-
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
|
|
1963
1921
|
name: "whoj/markdown/processor",
|
|
1922
|
+
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
|
|
1964
1923
|
// `eslint-plugin-markdown` only creates virtual files for code blocks,
|
|
1965
1924
|
// but not the markdown file itself. We use `eslint-merge-processors` to
|
|
1966
1925
|
// add a pass-through processor for the markdown file itself.
|
|
@@ -1971,12 +1930,13 @@ async function markdown(options = {}) {
|
|
|
1971
1930
|
},
|
|
1972
1931
|
{
|
|
1973
1932
|
files,
|
|
1933
|
+
name: "whoj/markdown/parser",
|
|
1974
1934
|
languageOptions: {
|
|
1975
1935
|
parser: parserPlain
|
|
1976
|
-
}
|
|
1977
|
-
name: "whoj/markdown/parser"
|
|
1936
|
+
}
|
|
1978
1937
|
},
|
|
1979
1938
|
{
|
|
1939
|
+
name: "whoj/markdown/disables",
|
|
1980
1940
|
files: [
|
|
1981
1941
|
GLOB_MARKDOWN_CODE,
|
|
1982
1942
|
...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
@@ -1988,33 +1948,32 @@ async function markdown(options = {}) {
|
|
|
1988
1948
|
}
|
|
1989
1949
|
}
|
|
1990
1950
|
},
|
|
1991
|
-
name: "whoj/markdown/disables",
|
|
1992
1951
|
rules: {
|
|
1993
|
-
"import/newline-after-import": "off",
|
|
1994
1952
|
"no-alert": "off",
|
|
1995
|
-
"no-
|
|
1953
|
+
"no-undef": "off",
|
|
1996
1954
|
"no-labels": "off",
|
|
1955
|
+
"no-console": "off",
|
|
1956
|
+
"unicode-bom": "off",
|
|
1997
1957
|
"no-lone-blocks": "off",
|
|
1998
|
-
"no-restricted-syntax": "off",
|
|
1999
|
-
"no-undef": "off",
|
|
2000
|
-
"no-unused-expressions": "off",
|
|
2001
|
-
"no-unused-labels": "off",
|
|
2002
1958
|
"no-unused-vars": "off",
|
|
2003
|
-
"node/prefer-global/process": "off",
|
|
2004
|
-
"style/comma-dangle": "off",
|
|
2005
1959
|
"style/eol-last": "off",
|
|
2006
|
-
"ts/consistent-type-imports": "off",
|
|
2007
|
-
"ts/explicit-function-return-type": "off",
|
|
2008
1960
|
"ts/no-namespace": "off",
|
|
2009
1961
|
"ts/no-redeclare": "off",
|
|
2010
|
-
"
|
|
2011
|
-
"ts/no-unused-expressions": "off",
|
|
1962
|
+
"no-unused-labels": "off",
|
|
2012
1963
|
"ts/no-unused-vars": "off",
|
|
1964
|
+
"style/comma-dangle": "off",
|
|
1965
|
+
"no-restricted-syntax": "off",
|
|
1966
|
+
"no-unused-expressions": "off",
|
|
1967
|
+
"ts/no-require-imports": "off",
|
|
2013
1968
|
"ts/no-use-before-define": "off",
|
|
2014
|
-
"unicode-bom": "off",
|
|
2015
|
-
"unused-imports/no-unused-imports": "off",
|
|
2016
|
-
"unused-imports/no-unused-vars": "off",
|
|
2017
1969
|
"whoj/no-top-level-await": "off",
|
|
1970
|
+
"ts/no-unused-expressions": "off",
|
|
1971
|
+
"node/prefer-global/process": "off",
|
|
1972
|
+
"ts/consistent-type-imports": "off",
|
|
1973
|
+
"import/newline-after-import": "off",
|
|
1974
|
+
"unused-imports/no-unused-vars": "off",
|
|
1975
|
+
"ts/explicit-function-return-type": "off",
|
|
1976
|
+
"unused-imports/no-unused-imports": "off",
|
|
2018
1977
|
...overrides
|
|
2019
1978
|
}
|
|
2020
1979
|
}
|
|
@@ -2022,173 +1981,173 @@ async function markdown(options = {}) {
|
|
|
2022
1981
|
}
|
|
2023
1982
|
|
|
2024
1983
|
// src/configs/javascript.ts
|
|
2025
|
-
init_esm_shims();
|
|
2026
1984
|
import globals from "globals";
|
|
2027
1985
|
async function javascript(options = {}) {
|
|
2028
1986
|
const {
|
|
2029
|
-
|
|
2030
|
-
|
|
1987
|
+
overrides = {},
|
|
1988
|
+
isInEditor = false
|
|
2031
1989
|
} = options;
|
|
2032
1990
|
return [
|
|
2033
1991
|
{
|
|
1992
|
+
name: "whoj/javascript/setup",
|
|
1993
|
+
linterOptions: {
|
|
1994
|
+
reportUnusedDisableDirectives: true
|
|
1995
|
+
},
|
|
2034
1996
|
languageOptions: {
|
|
2035
1997
|
ecmaVersion: 2022,
|
|
1998
|
+
sourceType: "module",
|
|
1999
|
+
parserOptions: {
|
|
2000
|
+
ecmaVersion: 2022,
|
|
2001
|
+
sourceType: "module",
|
|
2002
|
+
ecmaFeatures: {
|
|
2003
|
+
jsx: true
|
|
2004
|
+
}
|
|
2005
|
+
},
|
|
2036
2006
|
globals: {
|
|
2037
2007
|
...globals.browser,
|
|
2038
2008
|
...globals.es2021,
|
|
2039
2009
|
...globals.node,
|
|
2010
|
+
window: "readonly",
|
|
2040
2011
|
document: "readonly",
|
|
2041
|
-
navigator: "readonly"
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
parserOptions: {
|
|
2045
|
-
ecmaFeatures: {
|
|
2046
|
-
jsx: true
|
|
2047
|
-
},
|
|
2048
|
-
ecmaVersion: 2022,
|
|
2049
|
-
sourceType: "module"
|
|
2050
|
-
},
|
|
2051
|
-
sourceType: "module"
|
|
2052
|
-
},
|
|
2053
|
-
linterOptions: {
|
|
2054
|
-
reportUnusedDisableDirectives: true
|
|
2055
|
-
},
|
|
2056
|
-
name: "whoj/javascript/setup"
|
|
2012
|
+
navigator: "readonly"
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2057
2015
|
},
|
|
2058
2016
|
{
|
|
2059
2017
|
name: "whoj/javascript/rules",
|
|
2060
2018
|
plugins: {
|
|
2061
|
-
"
|
|
2062
|
-
"
|
|
2019
|
+
"whoj": default3,
|
|
2020
|
+
"unused-imports": default6
|
|
2063
2021
|
},
|
|
2064
2022
|
rules: {
|
|
2065
|
-
"
|
|
2066
|
-
"
|
|
2067
|
-
"
|
|
2068
|
-
"
|
|
2069
|
-
"default-case-last": "error",
|
|
2070
|
-
"dot-notation": ["error", { allowKeywords: true }],
|
|
2071
|
-
"eqeqeq": ["error", "smart"],
|
|
2072
|
-
"new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
|
|
2023
|
+
"no-new": "error",
|
|
2024
|
+
"no-var": "error",
|
|
2025
|
+
"no-eval": "error",
|
|
2026
|
+
"no-with": "error",
|
|
2073
2027
|
"no-alert": "error",
|
|
2074
|
-
"no-
|
|
2075
|
-
"no-
|
|
2028
|
+
"no-octal": "error",
|
|
2029
|
+
"no-proto": "error",
|
|
2030
|
+
"no-undef": "error",
|
|
2076
2031
|
"no-caller": "error",
|
|
2077
|
-
"no-case-declarations": "error",
|
|
2078
|
-
"no-class-assign": "error",
|
|
2079
|
-
"no-compare-neg-zero": "error",
|
|
2080
|
-
"no-cond-assign": ["error", "always"],
|
|
2081
|
-
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
2082
|
-
"no-const-assign": "error",
|
|
2083
|
-
"no-control-regex": "error",
|
|
2084
2032
|
"no-debugger": "error",
|
|
2085
|
-
"no-
|
|
2033
|
+
"no-iterator": "error",
|
|
2034
|
+
"no-new-func": "error",
|
|
2035
|
+
"vars-on-top": "error",
|
|
2086
2036
|
"no-dupe-args": "error",
|
|
2087
|
-
"no-dupe-class-members": "error",
|
|
2088
2037
|
"no-dupe-keys": "error",
|
|
2089
|
-
"no-duplicate-case": "error",
|
|
2090
|
-
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
2091
|
-
"no-empty-character-class": "error",
|
|
2092
|
-
"no-empty-pattern": "error",
|
|
2093
|
-
"no-eval": "error",
|
|
2094
2038
|
"no-ex-assign": "error",
|
|
2095
|
-
"no-
|
|
2039
|
+
"no-multi-str": "error",
|
|
2040
|
+
"no-obj-calls": "error",
|
|
2041
|
+
"no-sequences": "error",
|
|
2042
|
+
"no-delete-var": "error",
|
|
2096
2043
|
"no-extra-bind": "error",
|
|
2097
|
-
"no-
|
|
2044
|
+
"no-undef-init": "error",
|
|
2045
|
+
"prefer-spread": "error",
|
|
2098
2046
|
"no-fallthrough": "error",
|
|
2099
2047
|
"no-func-assign": "error",
|
|
2048
|
+
"no-lone-blocks": "error",
|
|
2049
|
+
"no-unreachable": "error",
|
|
2050
|
+
"no-class-assign": "error",
|
|
2051
|
+
"no-const-assign": "error",
|
|
2052
|
+
"no-implied-eval": "error",
|
|
2053
|
+
"no-new-wrappers": "error",
|
|
2054
|
+
"no-octal-escape": "error",
|
|
2055
|
+
"no-regex-spaces": "error",
|
|
2056
|
+
"no-self-compare": "error",
|
|
2057
|
+
"no-useless-call": "error",
|
|
2058
|
+
"prefer-template": "error",
|
|
2059
|
+
"yoda": ["error", "never"],
|
|
2060
|
+
"block-scoped-var": "error",
|
|
2061
|
+
"no-control-regex": "error",
|
|
2062
|
+
"no-empty-pattern": "error",
|
|
2063
|
+
"no-extend-native": "error",
|
|
2100
2064
|
"no-global-assign": "error",
|
|
2101
|
-
"no-implied-eval": "error",
|
|
2102
2065
|
"no-import-assign": "error",
|
|
2066
|
+
"no-sparse-arrays": "error",
|
|
2067
|
+
"no-throw-literal": "error",
|
|
2068
|
+
"no-useless-catch": "error",
|
|
2069
|
+
"constructor-super": "error",
|
|
2070
|
+
"default-case-last": "error",
|
|
2071
|
+
"eqeqeq": ["error", "smart"],
|
|
2072
|
+
"no-duplicate-case": "error",
|
|
2103
2073
|
"no-invalid-regexp": "error",
|
|
2104
|
-
"no-
|
|
2105
|
-
"no-
|
|
2106
|
-
"no-
|
|
2107
|
-
"no-
|
|
2074
|
+
"no-unsafe-finally": "error",
|
|
2075
|
+
"no-useless-rename": "error",
|
|
2076
|
+
"no-useless-return": "error",
|
|
2077
|
+
"no-unsafe-negation": "error",
|
|
2078
|
+
"prefer-rest-params": "error",
|
|
2079
|
+
"symbol-description": "error",
|
|
2080
|
+
"no-compare-neg-zero": "error",
|
|
2081
|
+
"no-unreachable-loop": "error",
|
|
2082
|
+
"no-array-constructor": "error",
|
|
2083
|
+
"no-case-declarations": "error",
|
|
2108
2084
|
"no-loss-of-precision": "error",
|
|
2109
|
-
"no-
|
|
2110
|
-
"
|
|
2111
|
-
"no-
|
|
2112
|
-
"no-
|
|
2113
|
-
"no-new-native-nonconstructor": "error",
|
|
2114
|
-
"no-new-wrappers": "error",
|
|
2115
|
-
"no-obj-calls": "error",
|
|
2116
|
-
"no-octal": "error",
|
|
2117
|
-
"no-octal-escape": "error",
|
|
2118
|
-
"no-proto": "error",
|
|
2085
|
+
"no-this-before-super": "error",
|
|
2086
|
+
"array-callback-return": "error",
|
|
2087
|
+
"no-dupe-class-members": "error",
|
|
2088
|
+
"no-extra-boolean-cast": "error",
|
|
2119
2089
|
"no-prototype-builtins": "error",
|
|
2090
|
+
"no-useless-constructor": "error",
|
|
2091
|
+
"unicode-bom": ["error", "never"],
|
|
2092
|
+
"no-irregular-whitespace": "error",
|
|
2093
|
+
"no-unexpected-multiline": "error",
|
|
2094
|
+
"no-useless-computed-key": "error",
|
|
2095
|
+
"whoj/no-top-level-await": "error",
|
|
2096
|
+
"no-empty-character-class": "error",
|
|
2097
|
+
"no-useless-backreference": "error",
|
|
2098
|
+
"no-async-promise-executor": "error",
|
|
2099
|
+
"no-cond-assign": ["error", "always"],
|
|
2100
|
+
"no-shadow-restricted-names": "error",
|
|
2101
|
+
"no-template-curly-in-string": "error",
|
|
2102
|
+
"no-new-native-nonconstructor": "error",
|
|
2103
|
+
"no-unmodified-loop-condition": "error",
|
|
2104
|
+
"prefer-promise-reject-errors": "error",
|
|
2105
|
+
"no-misleading-character-class": "error",
|
|
2106
|
+
"prefer-exponentiation-operator": "error",
|
|
2107
|
+
"no-self-assign": ["error", { props: true }],
|
|
2108
|
+
"one-var": ["error", { initialized: "never" }],
|
|
2109
|
+
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
2110
|
+
"dot-notation": ["error", { allowKeywords: true }],
|
|
2120
2111
|
"no-redeclare": ["error", { builtinGlobals: false }],
|
|
2121
|
-
"no-
|
|
2122
|
-
"
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
],
|
|
2127
|
-
"
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
{ message: "Use `Object.defineProperty` instead.", property: "__defineSetter__" },
|
|
2132
|
-
{ message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupGetter__" },
|
|
2133
|
-
{ message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupSetter__" }
|
|
2134
|
-
],
|
|
2112
|
+
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
2113
|
+
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
2114
|
+
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
2115
|
+
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
|
2116
|
+
"unused-imports/no-unused-imports": isInEditor ? "warn" : "error",
|
|
2117
|
+
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
2118
|
+
"new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }],
|
|
2119
|
+
"use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
|
|
2120
|
+
"accessor-pairs": ["error", { setWithoutGet: true, enforceForClassMembers: true }],
|
|
2121
|
+
"no-use-before-define": ["error", { classes: false, variables: true, functions: false }],
|
|
2135
2122
|
"no-restricted-syntax": [
|
|
2136
2123
|
"error",
|
|
2137
2124
|
"TSEnumDeclaration[const=true]",
|
|
2138
2125
|
"TSExportAssignment"
|
|
2139
2126
|
],
|
|
2140
|
-
"no-self-assign": ["error", { props: true }],
|
|
2141
|
-
"no-self-compare": "error",
|
|
2142
|
-
"no-sequences": "error",
|
|
2143
|
-
"no-shadow-restricted-names": "error",
|
|
2144
|
-
"no-sparse-arrays": "error",
|
|
2145
|
-
"no-template-curly-in-string": "error",
|
|
2146
|
-
"no-this-before-super": "error",
|
|
2147
|
-
"no-throw-literal": "error",
|
|
2148
|
-
"no-undef": "error",
|
|
2149
|
-
"no-undef-init": "error",
|
|
2150
|
-
"no-unexpected-multiline": "error",
|
|
2151
|
-
"no-unmodified-loop-condition": "error",
|
|
2152
|
-
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
2153
|
-
"no-unreachable": "error",
|
|
2154
|
-
"no-unreachable-loop": "error",
|
|
2155
|
-
"no-unsafe-finally": "error",
|
|
2156
|
-
"no-unsafe-negation": "error",
|
|
2157
2127
|
"no-unused-expressions": ["error", {
|
|
2128
|
+
allowTernary: true,
|
|
2158
2129
|
allowShortCircuit: true,
|
|
2159
|
-
allowTaggedTemplates: true
|
|
2160
|
-
allowTernary: true
|
|
2130
|
+
allowTaggedTemplates: true
|
|
2161
2131
|
}],
|
|
2162
2132
|
"no-unused-vars": ["error", {
|
|
2133
|
+
vars: "all",
|
|
2163
2134
|
args: "none",
|
|
2164
2135
|
caughtErrors: "none",
|
|
2165
|
-
ignoreRestSiblings: true
|
|
2166
|
-
vars: "all"
|
|
2136
|
+
ignoreRestSiblings: true
|
|
2167
2137
|
}],
|
|
2168
|
-
"
|
|
2169
|
-
"no-useless-backreference": "error",
|
|
2170
|
-
"no-useless-call": "error",
|
|
2171
|
-
"no-useless-catch": "error",
|
|
2172
|
-
"no-useless-computed-key": "error",
|
|
2173
|
-
"no-useless-constructor": "error",
|
|
2174
|
-
"no-useless-rename": "error",
|
|
2175
|
-
"no-useless-return": "error",
|
|
2176
|
-
"no-var": "error",
|
|
2177
|
-
"no-with": "error",
|
|
2178
|
-
"object-shorthand": [
|
|
2138
|
+
"prefer-arrow-callback": [
|
|
2179
2139
|
"error",
|
|
2180
|
-
"always",
|
|
2181
2140
|
{
|
|
2182
|
-
|
|
2183
|
-
|
|
2141
|
+
allowUnboundThis: true,
|
|
2142
|
+
allowNamedFunctions: false
|
|
2184
2143
|
}
|
|
2185
2144
|
],
|
|
2186
|
-
"
|
|
2187
|
-
"prefer-arrow-callback": [
|
|
2145
|
+
"object-shorthand": [
|
|
2188
2146
|
"error",
|
|
2147
|
+
"always",
|
|
2189
2148
|
{
|
|
2190
|
-
|
|
2191
|
-
|
|
2149
|
+
avoidQuotes: true,
|
|
2150
|
+
ignoreConstructors: false
|
|
2192
2151
|
}
|
|
2193
2152
|
],
|
|
2194
2153
|
"prefer-const": [
|
|
@@ -2198,30 +2157,29 @@ async function javascript(options = {}) {
|
|
|
2198
2157
|
ignoreReadBeforeAssign: true
|
|
2199
2158
|
}
|
|
2200
2159
|
],
|
|
2201
|
-
"
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
"prefer-template": "error",
|
|
2207
|
-
"symbol-description": "error",
|
|
2208
|
-
"unicode-bom": ["error", "never"],
|
|
2209
|
-
"unused-imports/no-unused-imports": isInEditor ? "warn" : "error",
|
|
2160
|
+
"no-restricted-globals": [
|
|
2161
|
+
"error",
|
|
2162
|
+
{ name: "global", message: "Use `globalThis` instead." },
|
|
2163
|
+
{ name: "self", message: "Use `globalThis` instead." }
|
|
2164
|
+
],
|
|
2210
2165
|
"unused-imports/no-unused-vars": [
|
|
2211
2166
|
"error",
|
|
2212
2167
|
{
|
|
2168
|
+
vars: "all",
|
|
2213
2169
|
args: "after-used",
|
|
2214
2170
|
argsIgnorePattern: "^_",
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
varsIgnorePattern: "^_"
|
|
2171
|
+
varsIgnorePattern: "^_",
|
|
2172
|
+
ignoreRestSiblings: true
|
|
2218
2173
|
}
|
|
2219
2174
|
],
|
|
2220
|
-
"
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2175
|
+
"no-restricted-properties": [
|
|
2176
|
+
"error",
|
|
2177
|
+
{ property: "__proto__", message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead." },
|
|
2178
|
+
{ property: "__defineGetter__", message: "Use `Object.defineProperty` instead." },
|
|
2179
|
+
{ property: "__defineSetter__", message: "Use `Object.defineProperty` instead." },
|
|
2180
|
+
{ property: "__lookupGetter__", message: "Use `Object.getOwnPropertyDescriptor` instead." },
|
|
2181
|
+
{ property: "__lookupSetter__", message: "Use `Object.getOwnPropertyDescriptor` instead." }
|
|
2182
|
+
],
|
|
2225
2183
|
...overrides
|
|
2226
2184
|
}
|
|
2227
2185
|
}
|
|
@@ -2229,15 +2187,14 @@ async function javascript(options = {}) {
|
|
|
2229
2187
|
}
|
|
2230
2188
|
|
|
2231
2189
|
// src/configs/typescript.ts
|
|
2232
|
-
init_esm_shims();
|
|
2233
2190
|
import process2 from "node:process";
|
|
2234
2191
|
async function typescript(options = {}) {
|
|
2235
2192
|
const {
|
|
2236
|
-
|
|
2193
|
+
type = "app",
|
|
2237
2194
|
overrides = {},
|
|
2238
|
-
|
|
2195
|
+
componentExts = [],
|
|
2239
2196
|
parserOptions = {},
|
|
2240
|
-
|
|
2197
|
+
overridesTypeAware = {}
|
|
2241
2198
|
} = options;
|
|
2242
2199
|
const files = options.files ?? [
|
|
2243
2200
|
GLOB_TS,
|
|
@@ -2255,24 +2212,24 @@ async function typescript(options = {}) {
|
|
|
2255
2212
|
"dot-notation": "off",
|
|
2256
2213
|
"no-implied-eval": "off",
|
|
2257
2214
|
"ts/await-thenable": "error",
|
|
2258
|
-
"ts/
|
|
2259
|
-
"ts/
|
|
2215
|
+
"ts/no-unsafe-call": "error",
|
|
2216
|
+
"ts/unbound-method": "error",
|
|
2260
2217
|
"ts/no-for-in-array": "error",
|
|
2261
2218
|
"ts/no-implied-eval": "error",
|
|
2262
|
-
"ts/no-
|
|
2263
|
-
"ts/no-unnecessary-type-assertion": "error",
|
|
2219
|
+
"ts/no-unsafe-return": "error",
|
|
2264
2220
|
"ts/no-unsafe-argument": "error",
|
|
2221
|
+
"ts/no-misused-promises": "error",
|
|
2222
|
+
"ts/no-floating-promises": "error",
|
|
2265
2223
|
"ts/no-unsafe-assignment": "error",
|
|
2266
|
-
"ts/no-unsafe-call": "error",
|
|
2267
|
-
"ts/no-unsafe-member-access": "error",
|
|
2268
|
-
"ts/no-unsafe-return": "error",
|
|
2269
2224
|
"ts/promise-function-async": "error",
|
|
2270
2225
|
"ts/restrict-plus-operands": "error",
|
|
2226
|
+
"ts/no-unsafe-member-access": "error",
|
|
2227
|
+
"ts/switch-exhaustiveness-check": "error",
|
|
2228
|
+
"ts/no-unnecessary-type-assertion": "error",
|
|
2271
2229
|
"ts/restrict-template-expressions": "error",
|
|
2272
2230
|
"ts/return-await": ["error", "in-try-catch"],
|
|
2273
|
-
"ts/
|
|
2274
|
-
"ts/
|
|
2275
|
-
"ts/unbound-method": "error"
|
|
2231
|
+
"ts/dot-notation": ["error", { allowKeywords: true }],
|
|
2232
|
+
"ts/strict-boolean-expressions": ["error", { allowNullableObject: true, allowNullableBoolean: true }]
|
|
2276
2233
|
};
|
|
2277
2234
|
const [
|
|
2278
2235
|
pluginTs,
|
|
@@ -2285,22 +2242,22 @@ async function typescript(options = {}) {
|
|
|
2285
2242
|
return {
|
|
2286
2243
|
files: files2,
|
|
2287
2244
|
...ignores2 ? { ignores: ignores2 } : {},
|
|
2245
|
+
name: `whoj/typescript/${typeAware ? "type-aware-parser" : "parser"}`,
|
|
2288
2246
|
languageOptions: {
|
|
2289
2247
|
parser: parserTs,
|
|
2290
2248
|
parserOptions: {
|
|
2291
|
-
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
2292
2249
|
sourceType: "module",
|
|
2250
|
+
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
2293
2251
|
...typeAware ? {
|
|
2252
|
+
tsconfigRootDir: process2.cwd(),
|
|
2294
2253
|
projectService: {
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
}
|
|
2298
|
-
tsconfigRootDir: process2.cwd()
|
|
2254
|
+
defaultProject: tsconfigPath,
|
|
2255
|
+
allowDefaultProject: ["./*.js"]
|
|
2256
|
+
}
|
|
2299
2257
|
} : {},
|
|
2300
2258
|
...parserOptions
|
|
2301
2259
|
}
|
|
2302
|
-
}
|
|
2303
|
-
name: `whoj/typescript/${typeAware ? "type-aware-parser" : "parser"}`
|
|
2260
|
+
}
|
|
2304
2261
|
};
|
|
2305
2262
|
}
|
|
2306
2263
|
return [
|
|
@@ -2308,8 +2265,8 @@ async function typescript(options = {}) {
|
|
|
2308
2265
|
// Install the plugins without globs, so they can be configured separately.
|
|
2309
2266
|
name: "whoj/typescript/setup",
|
|
2310
2267
|
plugins: {
|
|
2311
|
-
|
|
2312
|
-
|
|
2268
|
+
whoj: default3,
|
|
2269
|
+
ts: pluginTs
|
|
2313
2270
|
}
|
|
2314
2271
|
},
|
|
2315
2272
|
// assign type-aware parser for type-aware files and type-unaware parser for the rest
|
|
@@ -2331,47 +2288,47 @@ async function typescript(options = {}) {
|
|
|
2331
2288
|
pluginTs.configs.strict.rules,
|
|
2332
2289
|
{ "@typescript-eslint": "ts" }
|
|
2333
2290
|
),
|
|
2334
|
-
"no-dupe-class-members": "off",
|
|
2335
2291
|
"no-redeclare": "off",
|
|
2336
|
-
"no-use-before-define": "off",
|
|
2337
|
-
"no-useless-constructor": "off",
|
|
2338
2292
|
"ts/ban-ts-comment": "off",
|
|
2339
|
-
"ts/
|
|
2340
|
-
"ts/consistent-type-imports": ["error", {
|
|
2341
|
-
disallowTypeAnnotations: false,
|
|
2342
|
-
fixStyle: "separate-type-imports",
|
|
2343
|
-
prefer: "type-imports"
|
|
2344
|
-
}],
|
|
2345
|
-
"ts/explicit-function-return-type": ["off"],
|
|
2346
|
-
"ts/method-signature-style": ["warn", "property"],
|
|
2347
|
-
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
2348
|
-
"ts/no-dupe-class-members": "error",
|
|
2349
|
-
"ts/no-dynamic-delete": "off",
|
|
2350
|
-
"ts/no-empty-object-type": ["warn", { allowInterfaces: "always" }],
|
|
2293
|
+
"ts/no-unused-vars": "off",
|
|
2351
2294
|
"ts/no-explicit-any": "off",
|
|
2295
|
+
"no-use-before-define": "off",
|
|
2296
|
+
"ts/no-dynamic-delete": "off",
|
|
2297
|
+
"no-dupe-class-members": "off",
|
|
2298
|
+
"ts/unified-signatures": "off",
|
|
2299
|
+
"no-useless-constructor": "off",
|
|
2352
2300
|
"ts/no-extraneous-class": "off",
|
|
2353
|
-
"ts/no-import-type-side-effects": "error",
|
|
2354
2301
|
"ts/no-invalid-void-type": "off",
|
|
2355
|
-
"ts/no-non-null-assertion": "off",
|
|
2356
|
-
"ts/no-redeclare": ["error", { builtinGlobals: false }],
|
|
2357
2302
|
"ts/no-require-imports": "error",
|
|
2303
|
+
"ts/no-non-null-assertion": "off",
|
|
2304
|
+
"ts/no-useless-constructor": "off",
|
|
2305
|
+
"ts/triple-slash-reference": "off",
|
|
2306
|
+
"ts/no-dupe-class-members": "error",
|
|
2358
2307
|
"ts/no-unsafe-function-type": ["off"],
|
|
2308
|
+
"ts/no-wrapper-object-types": "error",
|
|
2309
|
+
"ts/no-import-type-side-effects": "error",
|
|
2310
|
+
"ts/explicit-function-return-type": ["off"],
|
|
2311
|
+
"ts/method-signature-style": ["warn", "property"],
|
|
2312
|
+
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
2313
|
+
"ts/no-redeclare": ["error", { builtinGlobals: false }],
|
|
2314
|
+
"ts/consistent-type-definitions": ["error", "interface"],
|
|
2315
|
+
"ts/no-empty-object-type": ["warn", { allowInterfaces: "always" }],
|
|
2316
|
+
"ts/no-use-before-define": ["error", { classes: false, variables: true, functions: false }],
|
|
2359
2317
|
"ts/no-unused-expressions": ["warn", {
|
|
2318
|
+
allowTernary: true,
|
|
2360
2319
|
allowShortCircuit: true,
|
|
2361
|
-
allowTaggedTemplates: true
|
|
2362
|
-
|
|
2320
|
+
allowTaggedTemplates: true
|
|
2321
|
+
}],
|
|
2322
|
+
"ts/consistent-type-imports": ["error", {
|
|
2323
|
+
prefer: "type-imports",
|
|
2324
|
+
disallowTypeAnnotations: false,
|
|
2325
|
+
fixStyle: "separate-type-imports"
|
|
2363
2326
|
}],
|
|
2364
|
-
"ts/no-unused-vars": "off",
|
|
2365
|
-
"ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
2366
|
-
"ts/no-useless-constructor": "off",
|
|
2367
|
-
"ts/no-wrapper-object-types": "error",
|
|
2368
|
-
"ts/triple-slash-reference": "off",
|
|
2369
|
-
"ts/unified-signatures": "off",
|
|
2370
2327
|
...type === "lib" ? {
|
|
2371
2328
|
"ts/explicit-function-return-type": ["error", {
|
|
2329
|
+
allowIIFEs: true,
|
|
2372
2330
|
allowExpressions: true,
|
|
2373
|
-
allowHigherOrderFunctions: true
|
|
2374
|
-
allowIIFEs: true
|
|
2331
|
+
allowHigherOrderFunctions: true
|
|
2375
2332
|
}]
|
|
2376
2333
|
} : {},
|
|
2377
2334
|
...overrides
|
|
@@ -2390,37 +2347,39 @@ async function typescript(options = {}) {
|
|
|
2390
2347
|
}
|
|
2391
2348
|
|
|
2392
2349
|
// src/configs/perfectionist.ts
|
|
2393
|
-
init_esm_shims();
|
|
2394
2350
|
function perfectionist() {
|
|
2351
|
+
const { name, rules, ...config } = default5.configs["recommended-line-length"];
|
|
2395
2352
|
return [
|
|
2396
2353
|
{
|
|
2354
|
+
...config,
|
|
2397
2355
|
name: "whoj/perfectionist/setup",
|
|
2398
|
-
plugins: {
|
|
2399
|
-
perfectionist: default5
|
|
2400
|
-
},
|
|
2401
2356
|
rules: {
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2357
|
+
// @ts-ignore
|
|
2358
|
+
...Object.entries(rules).reduce((_rules, [rule, [severity, options]]) => {
|
|
2359
|
+
_rules[rule] = [severity, { ...options, order: "asc" }];
|
|
2360
|
+
return _rules;
|
|
2361
|
+
}, {})
|
|
2362
|
+
// 'perfectionist/sort-exports': ['error', { order: 'asc', type: 'line-length' }],
|
|
2363
|
+
// 'perfectionist/sort-objects': ['error', { order: 'asc', type: 'line-length' }],
|
|
2364
|
+
// 'perfectionist/sort-interfaces': ['error', { order: 'asc', type: 'line-length' }],
|
|
2365
|
+
// 'perfectionist/sort-object-types': ['error', { order: 'asc', type: 'line-length' }],
|
|
2366
|
+
// 'perfectionist/sort-named-exports': ['error', { order: 'asc', type: 'line-length' }],
|
|
2367
|
+
// 'perfectionist/sort-named-imports': ['error', { order: 'asc', type: 'line-length' }],
|
|
2368
|
+
// 'perfectionist/sort-intersection-types': ['error', { order: 'asc', type: 'alphabetical' }],
|
|
2369
|
+
// 'perfectionist/sort-imports': ['error', {
|
|
2370
|
+
// order: 'asc',
|
|
2371
|
+
// type: 'line-length',
|
|
2372
|
+
// newlinesBetween: 'ignore',
|
|
2373
|
+
// groups: [
|
|
2374
|
+
// ['type', 'parent-type', 'sibling-type', 'index-type', 'internal-type'],
|
|
2375
|
+
//
|
|
2376
|
+
// ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
2377
|
+
//
|
|
2378
|
+
// 'side-effect',
|
|
2379
|
+
// 'object',
|
|
2380
|
+
// 'unknown'
|
|
2381
|
+
// ]
|
|
2382
|
+
// }]
|
|
2424
2383
|
}
|
|
2425
2384
|
}
|
|
2426
2385
|
];
|
|
@@ -2449,32 +2408,42 @@ var VuePackages = [
|
|
|
2449
2408
|
"@slidev/cli"
|
|
2450
2409
|
];
|
|
2451
2410
|
var defaultPluginRenaming = {
|
|
2411
|
+
"n": "node",
|
|
2412
|
+
"yml": "yaml",
|
|
2413
|
+
"vitest": "test",
|
|
2414
|
+
"import-x": "import",
|
|
2415
|
+
"@stylistic": "style",
|
|
2452
2416
|
"@eslint-react": "react",
|
|
2417
|
+
"@typescript-eslint": "ts",
|
|
2453
2418
|
"@eslint-react/dom": "react-dom",
|
|
2454
2419
|
"@eslint-react/hooks-extra": "react-hooks-extra",
|
|
2455
|
-
"@eslint-react/naming-convention": "react-naming-convention"
|
|
2456
|
-
"@stylistic": "style",
|
|
2457
|
-
"@typescript-eslint": "ts",
|
|
2458
|
-
"import-x": "import",
|
|
2459
|
-
"n": "node",
|
|
2460
|
-
"vitest": "test",
|
|
2461
|
-
"yml": "yaml"
|
|
2420
|
+
"@eslint-react/naming-convention": "react-naming-convention"
|
|
2462
2421
|
};
|
|
2422
|
+
function resolveSubOptions(options, key) {
|
|
2423
|
+
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
2424
|
+
}
|
|
2425
|
+
function getOverrides(options, key) {
|
|
2426
|
+
const sub = resolveSubOptions(options, key);
|
|
2427
|
+
return {
|
|
2428
|
+
...options.overrides?.[key],
|
|
2429
|
+
..."overrides" in sub ? sub.overrides : {}
|
|
2430
|
+
};
|
|
2431
|
+
}
|
|
2463
2432
|
function whoj(options = {}, ...userConfigs) {
|
|
2464
2433
|
const {
|
|
2465
|
-
astro: enableAstro = false,
|
|
2466
|
-
autoRenamePlugins = true,
|
|
2467
2434
|
componentExts = [],
|
|
2468
|
-
gitignore: enableGitignore = true,
|
|
2469
2435
|
jsx: enableJsx = true,
|
|
2470
|
-
|
|
2436
|
+
autoRenamePlugins = true,
|
|
2437
|
+
astro: enableAstro = false,
|
|
2471
2438
|
react: enableReact = false,
|
|
2472
|
-
regexp: enableRegexp = true,
|
|
2473
2439
|
solid: enableSolid = false,
|
|
2440
|
+
regexp: enableRegexp = true,
|
|
2474
2441
|
svelte: enableSvelte = false,
|
|
2475
|
-
typescript: enableTypeScript = isPackageExists4("typescript"),
|
|
2476
|
-
unicorn: enableUnicorn = true,
|
|
2477
2442
|
unocss: enableUnoCSS = false,
|
|
2443
|
+
unicorn: enableUnicorn = true,
|
|
2444
|
+
gitignore: enableGitignore = true,
|
|
2445
|
+
typescript: enableTypeScript = isPackageExists4("typescript"),
|
|
2446
|
+
nuxt: enableNuxt = NuxtPackages.some((i) => isPackageExists4(i)),
|
|
2478
2447
|
vue: enableVue = enableNuxt !== false && VuePackages.some((i) => isPackageExists4(i))
|
|
2479
2448
|
} = options;
|
|
2480
2449
|
let isInEditor = options.isInEditor;
|
|
@@ -2487,10 +2456,10 @@ function whoj(options = {}, ...userConfigs) {
|
|
|
2487
2456
|
if (stylisticOptions) {
|
|
2488
2457
|
stylisticOptions.overrides = {
|
|
2489
2458
|
...stylisticOptions.overrides || {},
|
|
2490
|
-
"style/comma-dangle": ["error", "never"],
|
|
2491
|
-
"style/quotes": ["error", "single"],
|
|
2492
2459
|
"style/semi": [2, "always"],
|
|
2493
|
-
"style/
|
|
2460
|
+
"style/comma-dangle": ["off"],
|
|
2461
|
+
"style/spaced-comment": "off",
|
|
2462
|
+
"style/quotes": ["error", "single"]
|
|
2494
2463
|
};
|
|
2495
2464
|
}
|
|
2496
2465
|
if (stylisticOptions && !("jsx" in stylisticOptions))
|
|
@@ -2504,8 +2473,8 @@ function whoj(options = {}, ...userConfigs) {
|
|
|
2504
2473
|
})]));
|
|
2505
2474
|
} else {
|
|
2506
2475
|
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
|
|
2507
|
-
|
|
2508
|
-
|
|
2476
|
+
strict: false,
|
|
2477
|
+
name: "whoj/gitignore"
|
|
2509
2478
|
})]));
|
|
2510
2479
|
}
|
|
2511
2480
|
}
|
|
@@ -2542,8 +2511,8 @@ function whoj(options = {}, ...userConfigs) {
|
|
|
2542
2511
|
configs2.push(typescript({
|
|
2543
2512
|
...typescriptOptions,
|
|
2544
2513
|
componentExts,
|
|
2545
|
-
|
|
2546
|
-
|
|
2514
|
+
type: options.type,
|
|
2515
|
+
overrides: getOverrides(options, "typescript")
|
|
2547
2516
|
}));
|
|
2548
2517
|
}
|
|
2549
2518
|
if (stylisticOptions) {
|
|
@@ -2565,30 +2534,30 @@ function whoj(options = {}, ...userConfigs) {
|
|
|
2565
2534
|
if (enableVue) {
|
|
2566
2535
|
configs2.push(vue({
|
|
2567
2536
|
...resolveSubOptions(options, "vue"),
|
|
2568
|
-
overrides: getOverrides(options, "vue"),
|
|
2569
2537
|
stylistic: stylisticOptions,
|
|
2570
|
-
typescript: !!enableTypeScript
|
|
2538
|
+
typescript: !!enableTypeScript,
|
|
2539
|
+
overrides: getOverrides(options, "vue")
|
|
2571
2540
|
}));
|
|
2572
2541
|
}
|
|
2573
2542
|
if (enableReact) {
|
|
2574
2543
|
configs2.push(react({
|
|
2575
2544
|
...typescriptOptions,
|
|
2576
|
-
|
|
2577
|
-
|
|
2545
|
+
tsconfigPath,
|
|
2546
|
+
overrides: getOverrides(options, "react")
|
|
2578
2547
|
}));
|
|
2579
2548
|
}
|
|
2580
2549
|
if (enableSolid) {
|
|
2581
2550
|
configs2.push(solid({
|
|
2582
|
-
overrides: getOverrides(options, "solid"),
|
|
2583
2551
|
tsconfigPath,
|
|
2584
|
-
typescript: !!enableTypeScript
|
|
2552
|
+
typescript: !!enableTypeScript,
|
|
2553
|
+
overrides: getOverrides(options, "solid")
|
|
2585
2554
|
}));
|
|
2586
2555
|
}
|
|
2587
2556
|
if (enableSvelte) {
|
|
2588
2557
|
configs2.push(svelte({
|
|
2589
|
-
overrides: getOverrides(options, "svelte"),
|
|
2590
2558
|
stylistic: stylisticOptions,
|
|
2591
|
-
typescript: !!enableTypeScript
|
|
2559
|
+
typescript: !!enableTypeScript,
|
|
2560
|
+
overrides: getOverrides(options, "svelte")
|
|
2592
2561
|
}));
|
|
2593
2562
|
}
|
|
2594
2563
|
if (enableUnoCSS) {
|
|
@@ -2599,15 +2568,15 @@ function whoj(options = {}, ...userConfigs) {
|
|
|
2599
2568
|
}
|
|
2600
2569
|
if (enableAstro) {
|
|
2601
2570
|
configs2.push(astro({
|
|
2602
|
-
|
|
2603
|
-
|
|
2571
|
+
stylistic: stylisticOptions,
|
|
2572
|
+
overrides: getOverrides(options, "astro")
|
|
2604
2573
|
}));
|
|
2605
2574
|
}
|
|
2606
2575
|
if (options.jsonc ?? true) {
|
|
2607
2576
|
configs2.push(
|
|
2608
2577
|
jsonc({
|
|
2609
|
-
|
|
2610
|
-
|
|
2578
|
+
stylistic: stylisticOptions,
|
|
2579
|
+
overrides: getOverrides(options, "jsonc")
|
|
2611
2580
|
}),
|
|
2612
2581
|
sortPackageJson(),
|
|
2613
2582
|
sortTsconfig()
|
|
@@ -2615,14 +2584,14 @@ function whoj(options = {}, ...userConfigs) {
|
|
|
2615
2584
|
}
|
|
2616
2585
|
if (options.yaml ?? true) {
|
|
2617
2586
|
configs2.push(yaml({
|
|
2618
|
-
|
|
2619
|
-
|
|
2587
|
+
stylistic: stylisticOptions,
|
|
2588
|
+
overrides: getOverrides(options, "yaml")
|
|
2620
2589
|
}));
|
|
2621
2590
|
}
|
|
2622
2591
|
if (options.toml ?? true) {
|
|
2623
2592
|
configs2.push(toml({
|
|
2624
|
-
|
|
2625
|
-
|
|
2593
|
+
stylistic: stylisticOptions,
|
|
2594
|
+
overrides: getOverrides(options, "toml")
|
|
2626
2595
|
}));
|
|
2627
2596
|
}
|
|
2628
2597
|
if (options.markdown ?? true) {
|
|
@@ -2657,21 +2626,17 @@ function whoj(options = {}, ...userConfigs) {
|
|
|
2657
2626
|
configs2.push([{
|
|
2658
2627
|
rules: {
|
|
2659
2628
|
"eqeqeq": "warn",
|
|
2660
|
-
"
|
|
2661
|
-
"no-useless-escape": "warn"
|
|
2662
|
-
"require-await": "warn"
|
|
2629
|
+
"require-await": "off",
|
|
2630
|
+
"no-useless-escape": "warn"
|
|
2663
2631
|
}
|
|
2664
2632
|
}]);
|
|
2665
2633
|
if (enableNuxt) {
|
|
2666
2634
|
const { dirs, features = {} } = resolveSubOptions(options, "nuxt");
|
|
2667
|
-
configs2.
|
|
2635
|
+
configs2.unshift(nuxt({
|
|
2668
2636
|
dirs,
|
|
2669
2637
|
features: {
|
|
2670
2638
|
...features,
|
|
2671
|
-
stylistic:
|
|
2672
|
-
...stylisticOptions,
|
|
2673
|
-
...typeof features.stylistic !== "object" ? {} : features.stylistic
|
|
2674
|
-
}
|
|
2639
|
+
stylistic: stylisticOptions
|
|
2675
2640
|
}
|
|
2676
2641
|
}));
|
|
2677
2642
|
}
|
|
@@ -2694,19 +2659,6 @@ function whoj(options = {}, ...userConfigs) {
|
|
|
2694
2659
|
}
|
|
2695
2660
|
return composer;
|
|
2696
2661
|
}
|
|
2697
|
-
function resolveSubOptions(options, key) {
|
|
2698
|
-
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
2699
|
-
}
|
|
2700
|
-
function getOverrides(options, key) {
|
|
2701
|
-
const sub = resolveSubOptions(options, key);
|
|
2702
|
-
return {
|
|
2703
|
-
...options.overrides?.[key],
|
|
2704
|
-
..."overrides" in sub ? sub.overrides : {}
|
|
2705
|
-
};
|
|
2706
|
-
}
|
|
2707
|
-
|
|
2708
|
-
// src/types.ts
|
|
2709
|
-
init_esm_shims();
|
|
2710
2662
|
|
|
2711
2663
|
// src/index.ts
|
|
2712
2664
|
var index_default = whoj;
|