@debbl/eslint-config 3.10.2 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.cjs +41 -153
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +41 -153
- package/package.json +23 -24
package/README.md
CHANGED
|
@@ -32,22 +32,22 @@ pnpm i eslint @debbl/eslint-config -D
|
|
|
32
32
|
- prettier
|
|
33
33
|
|
|
34
34
|
```js
|
|
35
|
-
import { defineConfig } from
|
|
35
|
+
import { defineConfig } from '@debbl/eslint-config'
|
|
36
36
|
|
|
37
|
-
export default defineConfig()
|
|
37
|
+
export default defineConfig()
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## Config `Prettier`, will override default rules
|
|
41
41
|
|
|
42
42
|
```js
|
|
43
|
-
import { defineConfig } from
|
|
43
|
+
import { defineConfig } from '@debbl/eslint-config'
|
|
44
44
|
|
|
45
45
|
export default defineConfig({
|
|
46
46
|
typescript: true,
|
|
47
47
|
prettier: {
|
|
48
48
|
semi: false,
|
|
49
49
|
},
|
|
50
|
-
})
|
|
50
|
+
})
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
## Full OptionConfig
|
package/dist/index.cjs
CHANGED
|
@@ -167,16 +167,7 @@ var GLOB_TESTS = [
|
|
|
167
167
|
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
168
168
|
`**/*.benchmark.${GLOB_SRC_EXT}`
|
|
169
169
|
];
|
|
170
|
-
var GLOB_ALL_SRC = [
|
|
171
|
-
GLOB_SRC,
|
|
172
|
-
GLOB_STYLE,
|
|
173
|
-
GLOB_JSON,
|
|
174
|
-
GLOB_JSON5,
|
|
175
|
-
GLOB_MARKDOWN,
|
|
176
|
-
GLOB_VUE,
|
|
177
|
-
GLOB_YAML,
|
|
178
|
-
GLOB_HTML
|
|
179
|
-
];
|
|
170
|
+
var GLOB_ALL_SRC = [GLOB_SRC, GLOB_STYLE, GLOB_JSON, GLOB_JSON5, GLOB_MARKDOWN, GLOB_VUE, GLOB_YAML, GLOB_HTML];
|
|
180
171
|
var GLOB_EXCLUDE = [
|
|
181
172
|
"**/node_modules",
|
|
182
173
|
"**/dist",
|
|
@@ -210,9 +201,7 @@ var ignores = async (options) => {
|
|
|
210
201
|
const { enableGitignore = true, files = [] } = options;
|
|
211
202
|
const gitIgnores = [];
|
|
212
203
|
if (enableGitignore) {
|
|
213
|
-
const gitignore = await interopDefault(
|
|
214
|
-
import("eslint-config-flat-gitignore")
|
|
215
|
-
);
|
|
204
|
+
const gitignore = await interopDefault(import("eslint-config-flat-gitignore"));
|
|
216
205
|
gitIgnores.push(...gitignore(getConfigOptions(enableGitignore)).ignores);
|
|
217
206
|
}
|
|
218
207
|
let ignores2 = [...GLOB_EXCLUDE, ...gitIgnores];
|
|
@@ -256,9 +245,7 @@ async function imports() {
|
|
|
256
245
|
var import_globals = __toESM(require("globals"), 1);
|
|
257
246
|
var javascript = async (options) => {
|
|
258
247
|
const { overrides = {} } = options;
|
|
259
|
-
const pluginUnusedImports = await interopDefault(
|
|
260
|
-
import("eslint-plugin-unused-imports")
|
|
261
|
-
);
|
|
248
|
+
const pluginUnusedImports = await interopDefault(import("eslint-plugin-unused-imports"));
|
|
262
249
|
return [
|
|
263
250
|
{
|
|
264
251
|
name: "eslint/javascript/rules",
|
|
@@ -288,20 +275,14 @@ var javascript = async (options) => {
|
|
|
288
275
|
"unused-imports": pluginUnusedImports
|
|
289
276
|
},
|
|
290
277
|
rules: {
|
|
291
|
-
"accessor-pairs": [
|
|
292
|
-
"error",
|
|
293
|
-
{ enforceForClassMembers: true, setWithoutGet: true }
|
|
294
|
-
],
|
|
278
|
+
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
295
279
|
"array-callback-return": "error",
|
|
296
280
|
"block-scoped-var": "error",
|
|
297
281
|
"constructor-super": "error",
|
|
298
282
|
"default-case-last": "error",
|
|
299
283
|
"dot-notation": ["error", { allowKeywords: true }],
|
|
300
284
|
"eqeqeq": ["error", "smart"],
|
|
301
|
-
"new-cap": [
|
|
302
|
-
"error",
|
|
303
|
-
{ capIsNew: false, newIsCap: true, properties: true }
|
|
304
|
-
],
|
|
285
|
+
"new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
|
|
305
286
|
"no-alert": "error",
|
|
306
287
|
"no-array-constructor": "error",
|
|
307
288
|
"no-async-promise-executor": "error",
|
|
@@ -380,11 +361,7 @@ var javascript = async (options) => {
|
|
|
380
361
|
property: "__lookupSetter__"
|
|
381
362
|
}
|
|
382
363
|
],
|
|
383
|
-
"no-restricted-syntax": [
|
|
384
|
-
"error",
|
|
385
|
-
"TSEnumDeclaration[const=true]",
|
|
386
|
-
"TSExportAssignment"
|
|
387
|
-
],
|
|
364
|
+
"no-restricted-syntax": ["error", "TSEnumDeclaration[const=true]", "TSExportAssignment"],
|
|
388
365
|
"no-self-assign": ["error", { props: true }],
|
|
389
366
|
"no-self-compare": "error",
|
|
390
367
|
"no-sequences": "error",
|
|
@@ -419,10 +396,7 @@ var javascript = async (options) => {
|
|
|
419
396
|
vars: "all"
|
|
420
397
|
}
|
|
421
398
|
],
|
|
422
|
-
"no-use-before-define": [
|
|
423
|
-
"error",
|
|
424
|
-
{ classes: false, functions: false, variables: true }
|
|
425
|
-
],
|
|
399
|
+
"no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
426
400
|
"no-useless-backreference": "error",
|
|
427
401
|
"no-useless-call": "error",
|
|
428
402
|
"no-useless-catch": "error",
|
|
@@ -473,10 +447,7 @@ var javascript = async (options) => {
|
|
|
473
447
|
varsIgnorePattern: "^_"
|
|
474
448
|
}
|
|
475
449
|
],
|
|
476
|
-
"use-isnan": [
|
|
477
|
-
"error",
|
|
478
|
-
{ enforceForIndexOf: true, enforceForSwitchCase: true }
|
|
479
|
-
],
|
|
450
|
+
"use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
|
|
480
451
|
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
481
452
|
"vars-on-top": "error",
|
|
482
453
|
"yoda": ["error", "never"],
|
|
@@ -573,19 +544,10 @@ var jsonc = async (options) => {
|
|
|
573
544
|
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
574
545
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
575
546
|
"jsonc/comma-style": ["error", "last"],
|
|
576
|
-
"jsonc/key-spacing": [
|
|
577
|
-
|
|
578
|
-
{ afterColon: true, beforeColon: false }
|
|
579
|
-
],
|
|
580
|
-
"jsonc/object-curly-newline": [
|
|
581
|
-
"error",
|
|
582
|
-
{ consistent: true, multiline: true }
|
|
583
|
-
],
|
|
547
|
+
"jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
|
|
548
|
+
"jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
|
|
584
549
|
"jsonc/object-curly-spacing": ["error", "always"],
|
|
585
|
-
"jsonc/object-property-newline": [
|
|
586
|
-
"error",
|
|
587
|
-
{ allowMultiplePropertiesPerLine: true }
|
|
588
|
-
],
|
|
550
|
+
"jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
|
|
589
551
|
"jsonc/quote-props": "error",
|
|
590
552
|
"jsonc/quotes": "error",
|
|
591
553
|
...overrides
|
|
@@ -596,11 +558,7 @@ var jsonc = async (options) => {
|
|
|
596
558
|
|
|
597
559
|
// src/configs/markdown.ts
|
|
598
560
|
var markdown = async (options) => {
|
|
599
|
-
const {
|
|
600
|
-
mdx: _enableMdx = false,
|
|
601
|
-
componentExts = [],
|
|
602
|
-
overrides = {}
|
|
603
|
-
} = options;
|
|
561
|
+
const { mdx: _enableMdx = false, componentExts = [], overrides = {} } = options;
|
|
604
562
|
const pluginMarkdown = await interopDefault(import("@eslint/markdown"));
|
|
605
563
|
const _markdown = [
|
|
606
564
|
{
|
|
@@ -620,10 +578,7 @@ var markdown = async (options) => {
|
|
|
620
578
|
},
|
|
621
579
|
{
|
|
622
580
|
name: "eslint/markdown/disables",
|
|
623
|
-
files: [
|
|
624
|
-
GLOB_MARKDOWN_CODE,
|
|
625
|
-
...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
626
|
-
],
|
|
581
|
+
files: [GLOB_MARKDOWN_CODE, ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)],
|
|
627
582
|
languageOptions: {
|
|
628
583
|
parserOptions: {
|
|
629
584
|
ecmaFeatures: {
|
|
@@ -696,9 +651,7 @@ async function node() {
|
|
|
696
651
|
|
|
697
652
|
// src/configs/perfectionist.ts
|
|
698
653
|
async function perfectionist() {
|
|
699
|
-
const pluginPerfectionist = await interopDefault(
|
|
700
|
-
import("eslint-plugin-perfectionist")
|
|
701
|
-
);
|
|
654
|
+
const pluginPerfectionist = await interopDefault(import("eslint-plugin-perfectionist"));
|
|
702
655
|
return [
|
|
703
656
|
{
|
|
704
657
|
name: "eslint/perfectionist/setup",
|
|
@@ -706,10 +659,7 @@ async function perfectionist() {
|
|
|
706
659
|
perfectionist: pluginPerfectionist
|
|
707
660
|
},
|
|
708
661
|
rules: {
|
|
709
|
-
"perfectionist/sort-exports": [
|
|
710
|
-
"error",
|
|
711
|
-
{ order: "asc", type: "natural" }
|
|
712
|
-
],
|
|
662
|
+
"perfectionist/sort-exports": ["error", { order: "asc", type: "natural" }],
|
|
713
663
|
"perfectionist/sort-imports": [
|
|
714
664
|
"error",
|
|
715
665
|
{
|
|
@@ -738,14 +688,8 @@ async function perfectionist() {
|
|
|
738
688
|
type: "natural"
|
|
739
689
|
}
|
|
740
690
|
],
|
|
741
|
-
"perfectionist/sort-named-exports": [
|
|
742
|
-
|
|
743
|
-
{ order: "asc", type: "natural" }
|
|
744
|
-
],
|
|
745
|
-
"perfectionist/sort-named-imports": [
|
|
746
|
-
"error",
|
|
747
|
-
{ order: "asc", type: "natural" }
|
|
748
|
-
]
|
|
691
|
+
"perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
|
|
692
|
+
"perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
|
|
749
693
|
}
|
|
750
694
|
}
|
|
751
695
|
];
|
|
@@ -753,12 +697,16 @@ async function perfectionist() {
|
|
|
753
697
|
|
|
754
698
|
// src/configs/prettier.ts
|
|
755
699
|
var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
756
|
-
const [pluginPrettier,
|
|
700
|
+
const [pluginPrettier, recommendedPrettier] = await Promise.all([
|
|
757
701
|
interopDefault(import("eslint-plugin-prettier")),
|
|
758
|
-
interopDefault(import("eslint-
|
|
702
|
+
interopDefault(import("eslint-plugin-prettier/recommended"))
|
|
759
703
|
]);
|
|
760
704
|
const defaultPrettierOptions = {
|
|
761
|
-
quoteProps: "consistent"
|
|
705
|
+
quoteProps: "consistent",
|
|
706
|
+
semi: false,
|
|
707
|
+
singleQuote: true,
|
|
708
|
+
jsxSingleQuote: true,
|
|
709
|
+
printWidth: 120
|
|
762
710
|
};
|
|
763
711
|
const plainFileRules = [
|
|
764
712
|
{
|
|
@@ -830,7 +778,7 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
|
830
778
|
ignores: [GLOB_TOML],
|
|
831
779
|
rules: {
|
|
832
780
|
// disable rules with prettier conflicts
|
|
833
|
-
...
|
|
781
|
+
...recommendedPrettier.rules,
|
|
834
782
|
// eslint-plugin-prettier recommended rules
|
|
835
783
|
...{
|
|
836
784
|
"prettier/prettier": "error",
|
|
@@ -941,14 +889,7 @@ async function sortTsconfig() {
|
|
|
941
889
|
"jsonc/sort-keys": [
|
|
942
890
|
"error",
|
|
943
891
|
{
|
|
944
|
-
order: [
|
|
945
|
-
"extends",
|
|
946
|
-
"compilerOptions",
|
|
947
|
-
"references",
|
|
948
|
-
"files",
|
|
949
|
-
"include",
|
|
950
|
-
"exclude"
|
|
951
|
-
],
|
|
892
|
+
order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
|
|
952
893
|
pathPattern: "^$"
|
|
953
894
|
},
|
|
954
895
|
{
|
|
@@ -1085,10 +1026,7 @@ var test = async (options) => {
|
|
|
1085
1026
|
files: GLOB_TESTS,
|
|
1086
1027
|
rules: {
|
|
1087
1028
|
"node/prefer-global/process": "off",
|
|
1088
|
-
"test/consistent-test-it": [
|
|
1089
|
-
"error",
|
|
1090
|
-
{ fn: "it", withinDescribe: "it" }
|
|
1091
|
-
],
|
|
1029
|
+
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1092
1030
|
"test/no-identical-title": "error",
|
|
1093
1031
|
"test/no-import-node-test": "error",
|
|
1094
1032
|
"test/no-only-tests": "error",
|
|
@@ -1168,21 +1106,12 @@ var typeAwareRules = {
|
|
|
1168
1106
|
"@typescript-eslint/restrict-plus-operands": "error",
|
|
1169
1107
|
"@typescript-eslint/restrict-template-expressions": "error",
|
|
1170
1108
|
"@typescript-eslint/return-await": ["error", "in-try-catch"],
|
|
1171
|
-
"@typescript-eslint/strict-boolean-expressions": [
|
|
1172
|
-
"error",
|
|
1173
|
-
{ allowNullableBoolean: true, allowNullableObject: true }
|
|
1174
|
-
],
|
|
1109
|
+
"@typescript-eslint/strict-boolean-expressions": ["error", { allowNullableBoolean: true, allowNullableObject: true }],
|
|
1175
1110
|
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
1176
1111
|
"@typescript-eslint/unbound-method": "error"
|
|
1177
1112
|
};
|
|
1178
1113
|
var typescript = async (options) => {
|
|
1179
|
-
const {
|
|
1180
|
-
overrides = {},
|
|
1181
|
-
componentExts = [],
|
|
1182
|
-
parserOptions = {},
|
|
1183
|
-
tsconfigPath,
|
|
1184
|
-
enableSolid = false
|
|
1185
|
-
} = options ?? {};
|
|
1114
|
+
const { overrides = {}, componentExts = [], parserOptions = {}, tsconfigPath, enableSolid = false } = options ?? {};
|
|
1186
1115
|
const isTypeAware = !!tsconfigPath;
|
|
1187
1116
|
const [pluginTs, parserTs] = await Promise.all([
|
|
1188
1117
|
interopDefault(import("@typescript-eslint/eslint-plugin")),
|
|
@@ -1225,14 +1154,8 @@ var typescript = async (options) => {
|
|
|
1225
1154
|
"no-redeclare": "off",
|
|
1226
1155
|
"no-use-before-define": "off",
|
|
1227
1156
|
"no-useless-constructor": "off",
|
|
1228
|
-
"@typescript-eslint/ban-ts-comment": [
|
|
1229
|
-
|
|
1230
|
-
{ "ts-expect-error": "allow-with-description" }
|
|
1231
|
-
],
|
|
1232
|
-
"@typescript-eslint/consistent-type-definitions": [
|
|
1233
|
-
"error",
|
|
1234
|
-
"interface"
|
|
1235
|
-
],
|
|
1157
|
+
"@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
|
|
1158
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
1236
1159
|
"@typescript-eslint/consistent-type-imports": [
|
|
1237
1160
|
"error",
|
|
1238
1161
|
{
|
|
@@ -1245,10 +1168,7 @@ var typescript = async (options) => {
|
|
|
1245
1168
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
1246
1169
|
"@typescript-eslint/no-dupe-class-members": "error",
|
|
1247
1170
|
"@typescript-eslint/no-dynamic-delete": "off",
|
|
1248
|
-
"@typescript-eslint/no-empty-object-type": [
|
|
1249
|
-
"error",
|
|
1250
|
-
{ allowInterfaces: "always" }
|
|
1251
|
-
],
|
|
1171
|
+
"@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "always" }],
|
|
1252
1172
|
"@typescript-eslint/no-explicit-any": "off",
|
|
1253
1173
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
1254
1174
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
@@ -1265,10 +1185,7 @@ var typescript = async (options) => {
|
|
|
1265
1185
|
}
|
|
1266
1186
|
],
|
|
1267
1187
|
"@typescript-eslint/no-unused-vars": "off",
|
|
1268
|
-
"@typescript-eslint/no-use-before-define": [
|
|
1269
|
-
"error",
|
|
1270
|
-
{ classes: false, functions: false, variables: true }
|
|
1271
|
-
],
|
|
1188
|
+
"@typescript-eslint/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
1272
1189
|
"@typescript-eslint/no-useless-constructor": "off",
|
|
1273
1190
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
1274
1191
|
"@typescript-eslint/triple-slash-reference": "off",
|
|
@@ -1330,10 +1247,7 @@ async function unicorn() {
|
|
|
1330
1247
|
// Pass error message when throwing errors
|
|
1331
1248
|
"unicorn/error-message": "error",
|
|
1332
1249
|
// Uppercase regex escapes
|
|
1333
|
-
"unicorn/consistent-function-scoping": [
|
|
1334
|
-
"error",
|
|
1335
|
-
{ checkArrowFunctions: false }
|
|
1336
|
-
],
|
|
1250
|
+
"unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
|
|
1337
1251
|
"unicorn/no-instanceof-builtins": "error",
|
|
1338
1252
|
// Ban `new Array` as `Array` constructor's params are ambiguous
|
|
1339
1253
|
"unicorn/no-new-array": "error",
|
|
@@ -1384,9 +1298,7 @@ var vue = async (options = {}) => {
|
|
|
1384
1298
|
jsx: true
|
|
1385
1299
|
},
|
|
1386
1300
|
extraFileExtensions: [".vue"],
|
|
1387
|
-
parser: isTypescript ? await interopDefault(
|
|
1388
|
-
import("@typescript-eslint/parser")
|
|
1389
|
-
) : null,
|
|
1301
|
+
parser: isTypescript ? await interopDefault(import("@typescript-eslint/parser")) : null,
|
|
1390
1302
|
sourceType: "module"
|
|
1391
1303
|
}
|
|
1392
1304
|
},
|
|
@@ -1415,12 +1327,7 @@ var vue = async (options = {}) => {
|
|
|
1415
1327
|
"vue/define-macros-order": [
|
|
1416
1328
|
"error",
|
|
1417
1329
|
{
|
|
1418
|
-
order: [
|
|
1419
|
-
"defineOptions",
|
|
1420
|
-
"defineProps",
|
|
1421
|
-
"defineEmits",
|
|
1422
|
-
"defineSlots"
|
|
1423
|
-
]
|
|
1330
|
+
order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
|
|
1424
1331
|
}
|
|
1425
1332
|
],
|
|
1426
1333
|
"vue/dot-location": ["error", "property"],
|
|
@@ -1434,12 +1341,7 @@ var vue = async (options = {}) => {
|
|
|
1434
1341
|
"vue/no-empty-pattern": "error",
|
|
1435
1342
|
"vue/no-irregular-whitespace": "error",
|
|
1436
1343
|
"vue/no-loss-of-precision": "error",
|
|
1437
|
-
"vue/no-restricted-syntax": [
|
|
1438
|
-
"error",
|
|
1439
|
-
"DebuggerStatement",
|
|
1440
|
-
"LabeledStatement",
|
|
1441
|
-
"WithStatement"
|
|
1442
|
-
],
|
|
1344
|
+
"vue/no-restricted-syntax": ["error", "DebuggerStatement", "LabeledStatement", "WithStatement"],
|
|
1443
1345
|
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
1444
1346
|
"vue/no-setup-props-reactivity-loss": "off",
|
|
1445
1347
|
"vue/no-sparse-arrays": "error",
|
|
@@ -1485,10 +1387,7 @@ var vue = async (options = {}) => {
|
|
|
1485
1387
|
"vue/keyword-spacing": ["error", { after: true, before: true }],
|
|
1486
1388
|
"vue/object-curly-newline": "off",
|
|
1487
1389
|
"vue/object-curly-spacing": ["error", "always"],
|
|
1488
|
-
"vue/object-property-newline": [
|
|
1489
|
-
"error",
|
|
1490
|
-
{ allowMultiplePropertiesPerLine: true }
|
|
1491
|
-
],
|
|
1390
|
+
"vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
|
|
1492
1391
|
"vue/operator-linebreak": ["error", "before"],
|
|
1493
1392
|
"vue/padding-line-between-blocks": ["error", "always"],
|
|
1494
1393
|
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
@@ -1591,11 +1490,7 @@ async function next() {
|
|
|
1591
1490
|
];
|
|
1592
1491
|
}
|
|
1593
1492
|
var react = async (options) => {
|
|
1594
|
-
const {
|
|
1595
|
-
next: enableNext = false,
|
|
1596
|
-
compiler: enableCompiler = false,
|
|
1597
|
-
overrides = {}
|
|
1598
|
-
} = options;
|
|
1493
|
+
const { next: enableNext = false, compiler: enableCompiler = false, overrides = {} } = options;
|
|
1599
1494
|
const [pluginsReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
|
|
1600
1495
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1601
1496
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
@@ -1722,10 +1617,7 @@ var react = async (options) => {
|
|
|
1722
1617
|
"react/react-in-jsx-scope": "off",
|
|
1723
1618
|
"react/jsx-indent": [1, 2],
|
|
1724
1619
|
"react/jsx-indent-props": [1, 2],
|
|
1725
|
-
"react/jsx-closing-bracket-location": [
|
|
1726
|
-
1,
|
|
1727
|
-
{ selfClosing: "tag-aligned", nonEmpty: "tag-aligned" }
|
|
1728
|
-
],
|
|
1620
|
+
"react/jsx-closing-bracket-location": [1, { selfClosing: "tag-aligned", nonEmpty: "tag-aligned" }],
|
|
1729
1621
|
...overrides
|
|
1730
1622
|
}
|
|
1731
1623
|
}
|
|
@@ -1799,11 +1691,7 @@ function defineConfig(options = {}, ...userConfigs) {
|
|
|
1799
1691
|
configs.push(react(getConfigOptions(enableReact)));
|
|
1800
1692
|
}
|
|
1801
1693
|
if (options.jsonc ?? true) {
|
|
1802
|
-
configs.push(
|
|
1803
|
-
jsonc(getConfigOptions(options.jsonc)),
|
|
1804
|
-
sortPackageJson(),
|
|
1805
|
-
sortTsconfig()
|
|
1806
|
-
);
|
|
1694
|
+
configs.push(jsonc(getConfigOptions(options.jsonc)), sortPackageJson(), sortTsconfig());
|
|
1807
1695
|
}
|
|
1808
1696
|
if (options.yml ?? true) {
|
|
1809
1697
|
configs.push(yml(getConfigOptions(options.yml)));
|
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ import { RequiredOptions } from 'prettier';
|
|
|
6
6
|
declare function comments(): Promise<ConfigItem[]>;
|
|
7
7
|
|
|
8
8
|
type IgnoresConfig = (options: {
|
|
9
|
-
enableGitignore?: boolean | Omit<FlatGitignoreOptions,
|
|
9
|
+
enableGitignore?: boolean | Omit<FlatGitignoreOptions, 'name'>;
|
|
10
10
|
files?: ((files: string[]) => string[]) | string[];
|
|
11
11
|
}) => ReturnType<ConfigFn>;
|
|
12
12
|
declare const ignores: IgnoresConfig;
|
|
@@ -93,7 +93,7 @@ interface ConfigItem extends Linter.Config {
|
|
|
93
93
|
plugins?: Record<string, any>;
|
|
94
94
|
}
|
|
95
95
|
interface OptionsOverrides {
|
|
96
|
-
overrides?: ConfigItem[
|
|
96
|
+
overrides?: ConfigItem['rules'];
|
|
97
97
|
}
|
|
98
98
|
type ConfigFn = (options: OptionsOverrides) => Awaitable<ConfigItem[]>;
|
|
99
99
|
interface OptionsComponentExts {
|
|
@@ -200,7 +200,7 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
200
200
|
*
|
|
201
201
|
* @default true
|
|
202
202
|
*/
|
|
203
|
-
prettier?: boolean | Omit<GetConfigOption<PrettierConfig>,
|
|
203
|
+
prettier?: boolean | Omit<GetConfigOption<PrettierConfig>, 'tailwindcss'>;
|
|
204
204
|
/**
|
|
205
205
|
* Enable Tailwind CSS support.
|
|
206
206
|
*
|
|
@@ -209,7 +209,7 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
209
209
|
*
|
|
210
210
|
* @default false
|
|
211
211
|
*/
|
|
212
|
-
tailwindcss?: boolean |
|
|
212
|
+
tailwindcss?: boolean | 'prettier';
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { RequiredOptions } from 'prettier';
|
|
|
6
6
|
declare function comments(): Promise<ConfigItem[]>;
|
|
7
7
|
|
|
8
8
|
type IgnoresConfig = (options: {
|
|
9
|
-
enableGitignore?: boolean | Omit<FlatGitignoreOptions,
|
|
9
|
+
enableGitignore?: boolean | Omit<FlatGitignoreOptions, 'name'>;
|
|
10
10
|
files?: ((files: string[]) => string[]) | string[];
|
|
11
11
|
}) => ReturnType<ConfigFn>;
|
|
12
12
|
declare const ignores: IgnoresConfig;
|
|
@@ -93,7 +93,7 @@ interface ConfigItem extends Linter.Config {
|
|
|
93
93
|
plugins?: Record<string, any>;
|
|
94
94
|
}
|
|
95
95
|
interface OptionsOverrides {
|
|
96
|
-
overrides?: ConfigItem[
|
|
96
|
+
overrides?: ConfigItem['rules'];
|
|
97
97
|
}
|
|
98
98
|
type ConfigFn = (options: OptionsOverrides) => Awaitable<ConfigItem[]>;
|
|
99
99
|
interface OptionsComponentExts {
|
|
@@ -200,7 +200,7 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
200
200
|
*
|
|
201
201
|
* @default true
|
|
202
202
|
*/
|
|
203
|
-
prettier?: boolean | Omit<GetConfigOption<PrettierConfig>,
|
|
203
|
+
prettier?: boolean | Omit<GetConfigOption<PrettierConfig>, 'tailwindcss'>;
|
|
204
204
|
/**
|
|
205
205
|
* Enable Tailwind CSS support.
|
|
206
206
|
*
|
|
@@ -209,7 +209,7 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
209
209
|
*
|
|
210
210
|
* @default false
|
|
211
211
|
*/
|
|
212
|
-
tailwindcss?: boolean |
|
|
212
|
+
tailwindcss?: boolean | 'prettier';
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
/**
|
package/dist/index.js
CHANGED
|
@@ -83,16 +83,7 @@ var GLOB_TESTS = [
|
|
|
83
83
|
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
84
84
|
`**/*.benchmark.${GLOB_SRC_EXT}`
|
|
85
85
|
];
|
|
86
|
-
var GLOB_ALL_SRC = [
|
|
87
|
-
GLOB_SRC,
|
|
88
|
-
GLOB_STYLE,
|
|
89
|
-
GLOB_JSON,
|
|
90
|
-
GLOB_JSON5,
|
|
91
|
-
GLOB_MARKDOWN,
|
|
92
|
-
GLOB_VUE,
|
|
93
|
-
GLOB_YAML,
|
|
94
|
-
GLOB_HTML
|
|
95
|
-
];
|
|
86
|
+
var GLOB_ALL_SRC = [GLOB_SRC, GLOB_STYLE, GLOB_JSON, GLOB_JSON5, GLOB_MARKDOWN, GLOB_VUE, GLOB_YAML, GLOB_HTML];
|
|
96
87
|
var GLOB_EXCLUDE = [
|
|
97
88
|
"**/node_modules",
|
|
98
89
|
"**/dist",
|
|
@@ -126,9 +117,7 @@ var ignores = async (options) => {
|
|
|
126
117
|
const { enableGitignore = true, files = [] } = options;
|
|
127
118
|
const gitIgnores = [];
|
|
128
119
|
if (enableGitignore) {
|
|
129
|
-
const gitignore = await interopDefault(
|
|
130
|
-
import("eslint-config-flat-gitignore")
|
|
131
|
-
);
|
|
120
|
+
const gitignore = await interopDefault(import("eslint-config-flat-gitignore"));
|
|
132
121
|
gitIgnores.push(...gitignore(getConfigOptions(enableGitignore)).ignores);
|
|
133
122
|
}
|
|
134
123
|
let ignores2 = [...GLOB_EXCLUDE, ...gitIgnores];
|
|
@@ -172,9 +161,7 @@ async function imports() {
|
|
|
172
161
|
import globals from "globals";
|
|
173
162
|
var javascript = async (options) => {
|
|
174
163
|
const { overrides = {} } = options;
|
|
175
|
-
const pluginUnusedImports = await interopDefault(
|
|
176
|
-
import("eslint-plugin-unused-imports")
|
|
177
|
-
);
|
|
164
|
+
const pluginUnusedImports = await interopDefault(import("eslint-plugin-unused-imports"));
|
|
178
165
|
return [
|
|
179
166
|
{
|
|
180
167
|
name: "eslint/javascript/rules",
|
|
@@ -204,20 +191,14 @@ var javascript = async (options) => {
|
|
|
204
191
|
"unused-imports": pluginUnusedImports
|
|
205
192
|
},
|
|
206
193
|
rules: {
|
|
207
|
-
"accessor-pairs": [
|
|
208
|
-
"error",
|
|
209
|
-
{ enforceForClassMembers: true, setWithoutGet: true }
|
|
210
|
-
],
|
|
194
|
+
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
211
195
|
"array-callback-return": "error",
|
|
212
196
|
"block-scoped-var": "error",
|
|
213
197
|
"constructor-super": "error",
|
|
214
198
|
"default-case-last": "error",
|
|
215
199
|
"dot-notation": ["error", { allowKeywords: true }],
|
|
216
200
|
"eqeqeq": ["error", "smart"],
|
|
217
|
-
"new-cap": [
|
|
218
|
-
"error",
|
|
219
|
-
{ capIsNew: false, newIsCap: true, properties: true }
|
|
220
|
-
],
|
|
201
|
+
"new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
|
|
221
202
|
"no-alert": "error",
|
|
222
203
|
"no-array-constructor": "error",
|
|
223
204
|
"no-async-promise-executor": "error",
|
|
@@ -296,11 +277,7 @@ var javascript = async (options) => {
|
|
|
296
277
|
property: "__lookupSetter__"
|
|
297
278
|
}
|
|
298
279
|
],
|
|
299
|
-
"no-restricted-syntax": [
|
|
300
|
-
"error",
|
|
301
|
-
"TSEnumDeclaration[const=true]",
|
|
302
|
-
"TSExportAssignment"
|
|
303
|
-
],
|
|
280
|
+
"no-restricted-syntax": ["error", "TSEnumDeclaration[const=true]", "TSExportAssignment"],
|
|
304
281
|
"no-self-assign": ["error", { props: true }],
|
|
305
282
|
"no-self-compare": "error",
|
|
306
283
|
"no-sequences": "error",
|
|
@@ -335,10 +312,7 @@ var javascript = async (options) => {
|
|
|
335
312
|
vars: "all"
|
|
336
313
|
}
|
|
337
314
|
],
|
|
338
|
-
"no-use-before-define": [
|
|
339
|
-
"error",
|
|
340
|
-
{ classes: false, functions: false, variables: true }
|
|
341
|
-
],
|
|
315
|
+
"no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
342
316
|
"no-useless-backreference": "error",
|
|
343
317
|
"no-useless-call": "error",
|
|
344
318
|
"no-useless-catch": "error",
|
|
@@ -389,10 +363,7 @@ var javascript = async (options) => {
|
|
|
389
363
|
varsIgnorePattern: "^_"
|
|
390
364
|
}
|
|
391
365
|
],
|
|
392
|
-
"use-isnan": [
|
|
393
|
-
"error",
|
|
394
|
-
{ enforceForIndexOf: true, enforceForSwitchCase: true }
|
|
395
|
-
],
|
|
366
|
+
"use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
|
|
396
367
|
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
397
368
|
"vars-on-top": "error",
|
|
398
369
|
"yoda": ["error", "never"],
|
|
@@ -489,19 +460,10 @@ var jsonc = async (options) => {
|
|
|
489
460
|
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
490
461
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
491
462
|
"jsonc/comma-style": ["error", "last"],
|
|
492
|
-
"jsonc/key-spacing": [
|
|
493
|
-
|
|
494
|
-
{ afterColon: true, beforeColon: false }
|
|
495
|
-
],
|
|
496
|
-
"jsonc/object-curly-newline": [
|
|
497
|
-
"error",
|
|
498
|
-
{ consistent: true, multiline: true }
|
|
499
|
-
],
|
|
463
|
+
"jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
|
|
464
|
+
"jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
|
|
500
465
|
"jsonc/object-curly-spacing": ["error", "always"],
|
|
501
|
-
"jsonc/object-property-newline": [
|
|
502
|
-
"error",
|
|
503
|
-
{ allowMultiplePropertiesPerLine: true }
|
|
504
|
-
],
|
|
466
|
+
"jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
|
|
505
467
|
"jsonc/quote-props": "error",
|
|
506
468
|
"jsonc/quotes": "error",
|
|
507
469
|
...overrides
|
|
@@ -512,11 +474,7 @@ var jsonc = async (options) => {
|
|
|
512
474
|
|
|
513
475
|
// src/configs/markdown.ts
|
|
514
476
|
var markdown = async (options) => {
|
|
515
|
-
const {
|
|
516
|
-
mdx: _enableMdx = false,
|
|
517
|
-
componentExts = [],
|
|
518
|
-
overrides = {}
|
|
519
|
-
} = options;
|
|
477
|
+
const { mdx: _enableMdx = false, componentExts = [], overrides = {} } = options;
|
|
520
478
|
const pluginMarkdown = await interopDefault(import("@eslint/markdown"));
|
|
521
479
|
const _markdown = [
|
|
522
480
|
{
|
|
@@ -536,10 +494,7 @@ var markdown = async (options) => {
|
|
|
536
494
|
},
|
|
537
495
|
{
|
|
538
496
|
name: "eslint/markdown/disables",
|
|
539
|
-
files: [
|
|
540
|
-
GLOB_MARKDOWN_CODE,
|
|
541
|
-
...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
542
|
-
],
|
|
497
|
+
files: [GLOB_MARKDOWN_CODE, ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)],
|
|
543
498
|
languageOptions: {
|
|
544
499
|
parserOptions: {
|
|
545
500
|
ecmaFeatures: {
|
|
@@ -612,9 +567,7 @@ async function node() {
|
|
|
612
567
|
|
|
613
568
|
// src/configs/perfectionist.ts
|
|
614
569
|
async function perfectionist() {
|
|
615
|
-
const pluginPerfectionist = await interopDefault(
|
|
616
|
-
import("eslint-plugin-perfectionist")
|
|
617
|
-
);
|
|
570
|
+
const pluginPerfectionist = await interopDefault(import("eslint-plugin-perfectionist"));
|
|
618
571
|
return [
|
|
619
572
|
{
|
|
620
573
|
name: "eslint/perfectionist/setup",
|
|
@@ -622,10 +575,7 @@ async function perfectionist() {
|
|
|
622
575
|
perfectionist: pluginPerfectionist
|
|
623
576
|
},
|
|
624
577
|
rules: {
|
|
625
|
-
"perfectionist/sort-exports": [
|
|
626
|
-
"error",
|
|
627
|
-
{ order: "asc", type: "natural" }
|
|
628
|
-
],
|
|
578
|
+
"perfectionist/sort-exports": ["error", { order: "asc", type: "natural" }],
|
|
629
579
|
"perfectionist/sort-imports": [
|
|
630
580
|
"error",
|
|
631
581
|
{
|
|
@@ -654,14 +604,8 @@ async function perfectionist() {
|
|
|
654
604
|
type: "natural"
|
|
655
605
|
}
|
|
656
606
|
],
|
|
657
|
-
"perfectionist/sort-named-exports": [
|
|
658
|
-
|
|
659
|
-
{ order: "asc", type: "natural" }
|
|
660
|
-
],
|
|
661
|
-
"perfectionist/sort-named-imports": [
|
|
662
|
-
"error",
|
|
663
|
-
{ order: "asc", type: "natural" }
|
|
664
|
-
]
|
|
607
|
+
"perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
|
|
608
|
+
"perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
|
|
665
609
|
}
|
|
666
610
|
}
|
|
667
611
|
];
|
|
@@ -669,12 +613,16 @@ async function perfectionist() {
|
|
|
669
613
|
|
|
670
614
|
// src/configs/prettier.ts
|
|
671
615
|
var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
672
|
-
const [pluginPrettier,
|
|
616
|
+
const [pluginPrettier, recommendedPrettier] = await Promise.all([
|
|
673
617
|
interopDefault(import("eslint-plugin-prettier")),
|
|
674
|
-
interopDefault(import("eslint-
|
|
618
|
+
interopDefault(import("eslint-plugin-prettier/recommended"))
|
|
675
619
|
]);
|
|
676
620
|
const defaultPrettierOptions = {
|
|
677
|
-
quoteProps: "consistent"
|
|
621
|
+
quoteProps: "consistent",
|
|
622
|
+
semi: false,
|
|
623
|
+
singleQuote: true,
|
|
624
|
+
jsxSingleQuote: true,
|
|
625
|
+
printWidth: 120
|
|
678
626
|
};
|
|
679
627
|
const plainFileRules = [
|
|
680
628
|
{
|
|
@@ -746,7 +694,7 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
|
746
694
|
ignores: [GLOB_TOML],
|
|
747
695
|
rules: {
|
|
748
696
|
// disable rules with prettier conflicts
|
|
749
|
-
...
|
|
697
|
+
...recommendedPrettier.rules,
|
|
750
698
|
// eslint-plugin-prettier recommended rules
|
|
751
699
|
...{
|
|
752
700
|
"prettier/prettier": "error",
|
|
@@ -857,14 +805,7 @@ async function sortTsconfig() {
|
|
|
857
805
|
"jsonc/sort-keys": [
|
|
858
806
|
"error",
|
|
859
807
|
{
|
|
860
|
-
order: [
|
|
861
|
-
"extends",
|
|
862
|
-
"compilerOptions",
|
|
863
|
-
"references",
|
|
864
|
-
"files",
|
|
865
|
-
"include",
|
|
866
|
-
"exclude"
|
|
867
|
-
],
|
|
808
|
+
order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
|
|
868
809
|
pathPattern: "^$"
|
|
869
810
|
},
|
|
870
811
|
{
|
|
@@ -1001,10 +942,7 @@ var test = async (options) => {
|
|
|
1001
942
|
files: GLOB_TESTS,
|
|
1002
943
|
rules: {
|
|
1003
944
|
"node/prefer-global/process": "off",
|
|
1004
|
-
"test/consistent-test-it": [
|
|
1005
|
-
"error",
|
|
1006
|
-
{ fn: "it", withinDescribe: "it" }
|
|
1007
|
-
],
|
|
945
|
+
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1008
946
|
"test/no-identical-title": "error",
|
|
1009
947
|
"test/no-import-node-test": "error",
|
|
1010
948
|
"test/no-only-tests": "error",
|
|
@@ -1084,21 +1022,12 @@ var typeAwareRules = {
|
|
|
1084
1022
|
"@typescript-eslint/restrict-plus-operands": "error",
|
|
1085
1023
|
"@typescript-eslint/restrict-template-expressions": "error",
|
|
1086
1024
|
"@typescript-eslint/return-await": ["error", "in-try-catch"],
|
|
1087
|
-
"@typescript-eslint/strict-boolean-expressions": [
|
|
1088
|
-
"error",
|
|
1089
|
-
{ allowNullableBoolean: true, allowNullableObject: true }
|
|
1090
|
-
],
|
|
1025
|
+
"@typescript-eslint/strict-boolean-expressions": ["error", { allowNullableBoolean: true, allowNullableObject: true }],
|
|
1091
1026
|
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
1092
1027
|
"@typescript-eslint/unbound-method": "error"
|
|
1093
1028
|
};
|
|
1094
1029
|
var typescript = async (options) => {
|
|
1095
|
-
const {
|
|
1096
|
-
overrides = {},
|
|
1097
|
-
componentExts = [],
|
|
1098
|
-
parserOptions = {},
|
|
1099
|
-
tsconfigPath,
|
|
1100
|
-
enableSolid = false
|
|
1101
|
-
} = options ?? {};
|
|
1030
|
+
const { overrides = {}, componentExts = [], parserOptions = {}, tsconfigPath, enableSolid = false } = options ?? {};
|
|
1102
1031
|
const isTypeAware = !!tsconfigPath;
|
|
1103
1032
|
const [pluginTs, parserTs] = await Promise.all([
|
|
1104
1033
|
interopDefault(import("@typescript-eslint/eslint-plugin")),
|
|
@@ -1141,14 +1070,8 @@ var typescript = async (options) => {
|
|
|
1141
1070
|
"no-redeclare": "off",
|
|
1142
1071
|
"no-use-before-define": "off",
|
|
1143
1072
|
"no-useless-constructor": "off",
|
|
1144
|
-
"@typescript-eslint/ban-ts-comment": [
|
|
1145
|
-
|
|
1146
|
-
{ "ts-expect-error": "allow-with-description" }
|
|
1147
|
-
],
|
|
1148
|
-
"@typescript-eslint/consistent-type-definitions": [
|
|
1149
|
-
"error",
|
|
1150
|
-
"interface"
|
|
1151
|
-
],
|
|
1073
|
+
"@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
|
|
1074
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
1152
1075
|
"@typescript-eslint/consistent-type-imports": [
|
|
1153
1076
|
"error",
|
|
1154
1077
|
{
|
|
@@ -1161,10 +1084,7 @@ var typescript = async (options) => {
|
|
|
1161
1084
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
1162
1085
|
"@typescript-eslint/no-dupe-class-members": "error",
|
|
1163
1086
|
"@typescript-eslint/no-dynamic-delete": "off",
|
|
1164
|
-
"@typescript-eslint/no-empty-object-type": [
|
|
1165
|
-
"error",
|
|
1166
|
-
{ allowInterfaces: "always" }
|
|
1167
|
-
],
|
|
1087
|
+
"@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "always" }],
|
|
1168
1088
|
"@typescript-eslint/no-explicit-any": "off",
|
|
1169
1089
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
1170
1090
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
@@ -1181,10 +1101,7 @@ var typescript = async (options) => {
|
|
|
1181
1101
|
}
|
|
1182
1102
|
],
|
|
1183
1103
|
"@typescript-eslint/no-unused-vars": "off",
|
|
1184
|
-
"@typescript-eslint/no-use-before-define": [
|
|
1185
|
-
"error",
|
|
1186
|
-
{ classes: false, functions: false, variables: true }
|
|
1187
|
-
],
|
|
1104
|
+
"@typescript-eslint/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
1188
1105
|
"@typescript-eslint/no-useless-constructor": "off",
|
|
1189
1106
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
1190
1107
|
"@typescript-eslint/triple-slash-reference": "off",
|
|
@@ -1246,10 +1163,7 @@ async function unicorn() {
|
|
|
1246
1163
|
// Pass error message when throwing errors
|
|
1247
1164
|
"unicorn/error-message": "error",
|
|
1248
1165
|
// Uppercase regex escapes
|
|
1249
|
-
"unicorn/consistent-function-scoping": [
|
|
1250
|
-
"error",
|
|
1251
|
-
{ checkArrowFunctions: false }
|
|
1252
|
-
],
|
|
1166
|
+
"unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
|
|
1253
1167
|
"unicorn/no-instanceof-builtins": "error",
|
|
1254
1168
|
// Ban `new Array` as `Array` constructor's params are ambiguous
|
|
1255
1169
|
"unicorn/no-new-array": "error",
|
|
@@ -1300,9 +1214,7 @@ var vue = async (options = {}) => {
|
|
|
1300
1214
|
jsx: true
|
|
1301
1215
|
},
|
|
1302
1216
|
extraFileExtensions: [".vue"],
|
|
1303
|
-
parser: isTypescript ? await interopDefault(
|
|
1304
|
-
import("@typescript-eslint/parser")
|
|
1305
|
-
) : null,
|
|
1217
|
+
parser: isTypescript ? await interopDefault(import("@typescript-eslint/parser")) : null,
|
|
1306
1218
|
sourceType: "module"
|
|
1307
1219
|
}
|
|
1308
1220
|
},
|
|
@@ -1331,12 +1243,7 @@ var vue = async (options = {}) => {
|
|
|
1331
1243
|
"vue/define-macros-order": [
|
|
1332
1244
|
"error",
|
|
1333
1245
|
{
|
|
1334
|
-
order: [
|
|
1335
|
-
"defineOptions",
|
|
1336
|
-
"defineProps",
|
|
1337
|
-
"defineEmits",
|
|
1338
|
-
"defineSlots"
|
|
1339
|
-
]
|
|
1246
|
+
order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
|
|
1340
1247
|
}
|
|
1341
1248
|
],
|
|
1342
1249
|
"vue/dot-location": ["error", "property"],
|
|
@@ -1350,12 +1257,7 @@ var vue = async (options = {}) => {
|
|
|
1350
1257
|
"vue/no-empty-pattern": "error",
|
|
1351
1258
|
"vue/no-irregular-whitespace": "error",
|
|
1352
1259
|
"vue/no-loss-of-precision": "error",
|
|
1353
|
-
"vue/no-restricted-syntax": [
|
|
1354
|
-
"error",
|
|
1355
|
-
"DebuggerStatement",
|
|
1356
|
-
"LabeledStatement",
|
|
1357
|
-
"WithStatement"
|
|
1358
|
-
],
|
|
1260
|
+
"vue/no-restricted-syntax": ["error", "DebuggerStatement", "LabeledStatement", "WithStatement"],
|
|
1359
1261
|
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
1360
1262
|
"vue/no-setup-props-reactivity-loss": "off",
|
|
1361
1263
|
"vue/no-sparse-arrays": "error",
|
|
@@ -1401,10 +1303,7 @@ var vue = async (options = {}) => {
|
|
|
1401
1303
|
"vue/keyword-spacing": ["error", { after: true, before: true }],
|
|
1402
1304
|
"vue/object-curly-newline": "off",
|
|
1403
1305
|
"vue/object-curly-spacing": ["error", "always"],
|
|
1404
|
-
"vue/object-property-newline": [
|
|
1405
|
-
"error",
|
|
1406
|
-
{ allowMultiplePropertiesPerLine: true }
|
|
1407
|
-
],
|
|
1306
|
+
"vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
|
|
1408
1307
|
"vue/operator-linebreak": ["error", "before"],
|
|
1409
1308
|
"vue/padding-line-between-blocks": ["error", "always"],
|
|
1410
1309
|
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
@@ -1507,11 +1406,7 @@ async function next() {
|
|
|
1507
1406
|
];
|
|
1508
1407
|
}
|
|
1509
1408
|
var react = async (options) => {
|
|
1510
|
-
const {
|
|
1511
|
-
next: enableNext = false,
|
|
1512
|
-
compiler: enableCompiler = false,
|
|
1513
|
-
overrides = {}
|
|
1514
|
-
} = options;
|
|
1409
|
+
const { next: enableNext = false, compiler: enableCompiler = false, overrides = {} } = options;
|
|
1515
1410
|
const [pluginsReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
|
|
1516
1411
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1517
1412
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
@@ -1638,10 +1533,7 @@ var react = async (options) => {
|
|
|
1638
1533
|
"react/react-in-jsx-scope": "off",
|
|
1639
1534
|
"react/jsx-indent": [1, 2],
|
|
1640
1535
|
"react/jsx-indent-props": [1, 2],
|
|
1641
|
-
"react/jsx-closing-bracket-location": [
|
|
1642
|
-
1,
|
|
1643
|
-
{ selfClosing: "tag-aligned", nonEmpty: "tag-aligned" }
|
|
1644
|
-
],
|
|
1536
|
+
"react/jsx-closing-bracket-location": [1, { selfClosing: "tag-aligned", nonEmpty: "tag-aligned" }],
|
|
1645
1537
|
...overrides
|
|
1646
1538
|
}
|
|
1647
1539
|
}
|
|
@@ -1715,11 +1607,7 @@ function defineConfig(options = {}, ...userConfigs) {
|
|
|
1715
1607
|
configs.push(react(getConfigOptions(enableReact)));
|
|
1716
1608
|
}
|
|
1717
1609
|
if (options.jsonc ?? true) {
|
|
1718
|
-
configs.push(
|
|
1719
|
-
jsonc(getConfigOptions(options.jsonc)),
|
|
1720
|
-
sortPackageJson(),
|
|
1721
|
-
sortTsconfig()
|
|
1722
|
-
);
|
|
1610
|
+
configs.push(jsonc(getConfigOptions(options.jsonc)), sortPackageJson(), sortTsconfig());
|
|
1723
1611
|
}
|
|
1724
1612
|
if (options.yml ?? true) {
|
|
1725
1613
|
configs.push(yml(getConfigOptions(options.yml)));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debbl/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.11.0",
|
|
5
5
|
"description": "Brendan Dash's ESLint config",
|
|
6
6
|
"author": "Brendan Dash <me@aiwan.run> (https://github.com/Debbl/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,56 +26,55 @@
|
|
|
26
26
|
"eslint": ">=9"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
30
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
31
|
-
"@eslint/markdown": "^6.
|
|
32
|
-
"@next/eslint-plugin-next": "^15.2
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
34
|
-
"@typescript-eslint/parser": "^8.
|
|
35
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
29
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
30
|
+
"@eslint-react/eslint-plugin": "^1.49.0",
|
|
31
|
+
"@eslint/markdown": "^6.4.0",
|
|
32
|
+
"@next/eslint-plugin-next": "^15.3.2",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
|
34
|
+
"@typescript-eslint/parser": "^8.32.0",
|
|
35
|
+
"@vitest/eslint-plugin": "^1.1.44",
|
|
36
36
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
37
|
-
"eslint-
|
|
38
|
-
"eslint-plugin-
|
|
39
|
-
"eslint-plugin-jsdoc": "^50.6.9",
|
|
37
|
+
"eslint-plugin-import-x": "^4.11.0",
|
|
38
|
+
"eslint-plugin-jsdoc": "^50.6.11",
|
|
40
39
|
"eslint-plugin-jsonc": "^2.20.0",
|
|
41
40
|
"eslint-plugin-n": "^17.17.0",
|
|
42
41
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
43
|
-
"eslint-plugin-perfectionist": "^4.
|
|
44
|
-
"eslint-plugin-prettier": "^5.
|
|
42
|
+
"eslint-plugin-perfectionist": "^4.12.3",
|
|
43
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
45
44
|
"eslint-plugin-react-compiler": "latest",
|
|
46
45
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
47
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
46
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
48
47
|
"eslint-plugin-solid": "^0.14.5",
|
|
49
48
|
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
50
49
|
"eslint-plugin-toml": "^0.12.0",
|
|
51
|
-
"eslint-plugin-unicorn": "^
|
|
50
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
52
51
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
53
|
-
"eslint-plugin-vue": "^10.
|
|
54
|
-
"eslint-plugin-yml": "^1.
|
|
55
|
-
"globals": "^16.
|
|
52
|
+
"eslint-plugin-vue": "^10.1.0",
|
|
53
|
+
"eslint-plugin-yml": "^1.18.0",
|
|
54
|
+
"globals": "^16.1.0",
|
|
56
55
|
"jsonc-eslint-parser": "^2.4.0",
|
|
57
56
|
"prettier": "^3.5.3",
|
|
58
57
|
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
59
58
|
"toml-eslint-parser": "^0.10.0",
|
|
60
|
-
"vue-eslint-parser": "^10.1.
|
|
59
|
+
"vue-eslint-parser": "^10.1.3",
|
|
61
60
|
"yaml-eslint-parser": "^1.3.0"
|
|
62
61
|
},
|
|
63
62
|
"devDependencies": {
|
|
64
63
|
"@eslint/config-inspector": "^1.0.2",
|
|
65
64
|
"@types/eslint": "^9.6.1",
|
|
66
65
|
"@types/fs-extra": "^11.0.4",
|
|
67
|
-
"@types/node": "^22.
|
|
68
|
-
"@types/react": "^19.1.
|
|
66
|
+
"@types/node": "^22.15.17",
|
|
67
|
+
"@types/react": "^19.1.3",
|
|
69
68
|
"bumpp": "^10.1.0",
|
|
70
|
-
"eslint": "^9.
|
|
69
|
+
"eslint": "^9.26.0",
|
|
71
70
|
"execa": "^9.5.2",
|
|
72
71
|
"fast-glob": "^3.3.3",
|
|
73
72
|
"fs-extra": "^11.3.0",
|
|
74
73
|
"react": "^19.1.0",
|
|
75
74
|
"sucrase": "^3.35.0",
|
|
76
75
|
"tsup": "^8.4.0",
|
|
77
|
-
"typescript": "^5.8.
|
|
78
|
-
"vitest": "^3.1.
|
|
76
|
+
"typescript": "^5.8.3",
|
|
77
|
+
"vitest": "^3.1.3"
|
|
79
78
|
},
|
|
80
79
|
"scripts": {
|
|
81
80
|
"build": "tsup",
|