@debbl/eslint-config 3.8.0 → 3.8.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/dist/index.cjs +138 -57
- package/dist/index.js +138 -57
- package/package.json +21 -21
package/dist/index.cjs
CHANGED
|
@@ -248,7 +248,10 @@ async function imports() {
|
|
|
248
248
|
"import/no-named-default": "error",
|
|
249
249
|
"import/no-self-import": "error",
|
|
250
250
|
"import/no-webpack-loader-syntax": "error",
|
|
251
|
-
"import/newline-after-import": [
|
|
251
|
+
"import/newline-after-import": [
|
|
252
|
+
"error",
|
|
253
|
+
{ considerComments: true, count: 1 }
|
|
254
|
+
],
|
|
252
255
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"]
|
|
253
256
|
}
|
|
254
257
|
}
|
|
@@ -259,7 +262,9 @@ async function imports() {
|
|
|
259
262
|
var import_globals = __toESM(require("globals"), 1);
|
|
260
263
|
var javascript = async (options) => {
|
|
261
264
|
const { overrides = {} } = options;
|
|
262
|
-
const pluginUnusedImports = await interopDefault(
|
|
265
|
+
const pluginUnusedImports = await interopDefault(
|
|
266
|
+
import("eslint-plugin-unused-imports")
|
|
267
|
+
);
|
|
263
268
|
return [
|
|
264
269
|
{
|
|
265
270
|
name: "eslint/javascript/rules",
|
|
@@ -289,14 +294,20 @@ var javascript = async (options) => {
|
|
|
289
294
|
"unused-imports": pluginUnusedImports
|
|
290
295
|
},
|
|
291
296
|
rules: {
|
|
292
|
-
"accessor-pairs": [
|
|
297
|
+
"accessor-pairs": [
|
|
298
|
+
"error",
|
|
299
|
+
{ enforceForClassMembers: true, setWithoutGet: true }
|
|
300
|
+
],
|
|
293
301
|
"array-callback-return": "error",
|
|
294
302
|
"block-scoped-var": "error",
|
|
295
303
|
"constructor-super": "error",
|
|
296
304
|
"default-case-last": "error",
|
|
297
305
|
"dot-notation": ["error", { allowKeywords: true }],
|
|
298
306
|
"eqeqeq": ["error", "smart"],
|
|
299
|
-
"new-cap": [
|
|
307
|
+
"new-cap": [
|
|
308
|
+
"error",
|
|
309
|
+
{ capIsNew: false, newIsCap: true, properties: true }
|
|
310
|
+
],
|
|
300
311
|
"no-alert": "error",
|
|
301
312
|
"no-array-constructor": "error",
|
|
302
313
|
"no-async-promise-executor": "error",
|
|
@@ -375,7 +386,11 @@ var javascript = async (options) => {
|
|
|
375
386
|
property: "__lookupSetter__"
|
|
376
387
|
}
|
|
377
388
|
],
|
|
378
|
-
"no-restricted-syntax": [
|
|
389
|
+
"no-restricted-syntax": [
|
|
390
|
+
"error",
|
|
391
|
+
"TSEnumDeclaration[const=true]",
|
|
392
|
+
"TSExportAssignment"
|
|
393
|
+
],
|
|
379
394
|
"no-self-assign": ["error", { props: true }],
|
|
380
395
|
"no-self-compare": "error",
|
|
381
396
|
"no-sequences": "error",
|
|
@@ -410,7 +425,10 @@ var javascript = async (options) => {
|
|
|
410
425
|
vars: "all"
|
|
411
426
|
}
|
|
412
427
|
],
|
|
413
|
-
"no-use-before-define": [
|
|
428
|
+
"no-use-before-define": [
|
|
429
|
+
"error",
|
|
430
|
+
{ classes: false, functions: false, variables: true }
|
|
431
|
+
],
|
|
414
432
|
"no-useless-backreference": "error",
|
|
415
433
|
"no-useless-call": "error",
|
|
416
434
|
"no-useless-catch": "error",
|
|
@@ -461,7 +479,10 @@ var javascript = async (options) => {
|
|
|
461
479
|
varsIgnorePattern: "^_"
|
|
462
480
|
}
|
|
463
481
|
],
|
|
464
|
-
"use-isnan": [
|
|
482
|
+
"use-isnan": [
|
|
483
|
+
"error",
|
|
484
|
+
{ enforceForIndexOf: true, enforceForSwitchCase: true }
|
|
485
|
+
],
|
|
465
486
|
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
466
487
|
"vars-on-top": "error",
|
|
467
488
|
"yoda": ["error", "never"],
|
|
@@ -558,10 +579,19 @@ var jsonc = async (options) => {
|
|
|
558
579
|
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
559
580
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
560
581
|
"jsonc/comma-style": ["error", "last"],
|
|
561
|
-
"jsonc/key-spacing": [
|
|
562
|
-
|
|
582
|
+
"jsonc/key-spacing": [
|
|
583
|
+
"error",
|
|
584
|
+
{ afterColon: true, beforeColon: false }
|
|
585
|
+
],
|
|
586
|
+
"jsonc/object-curly-newline": [
|
|
587
|
+
"error",
|
|
588
|
+
{ consistent: true, multiline: true }
|
|
589
|
+
],
|
|
563
590
|
"jsonc/object-curly-spacing": ["error", "always"],
|
|
564
|
-
"jsonc/object-property-newline": [
|
|
591
|
+
"jsonc/object-property-newline": [
|
|
592
|
+
"error",
|
|
593
|
+
{ allowMultiplePropertiesPerLine: true }
|
|
594
|
+
],
|
|
565
595
|
"jsonc/quote-props": "error",
|
|
566
596
|
"jsonc/quotes": "error",
|
|
567
597
|
...overrides
|
|
@@ -599,8 +629,11 @@ var markdown = async (options) => {
|
|
|
599
629
|
}
|
|
600
630
|
},
|
|
601
631
|
{
|
|
602
|
-
name: "eslint/markdown/
|
|
603
|
-
files: [
|
|
632
|
+
name: "eslint/markdown/disables",
|
|
633
|
+
files: [
|
|
634
|
+
GLOB_MARKDOWN_CODE,
|
|
635
|
+
...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
636
|
+
],
|
|
604
637
|
languageOptions: {
|
|
605
638
|
parserOptions: {
|
|
606
639
|
ecmaFeatures: {
|
|
@@ -625,25 +658,22 @@ var markdown = async (options) => {
|
|
|
625
658
|
"unicode-bom": "off",
|
|
626
659
|
"unused-imports/no-unused-imports": "off",
|
|
627
660
|
"unused-imports/no-unused-vars": "off",
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
"@typescript-eslint/restrict-template-expressions": "off",
|
|
645
|
-
"@typescript-eslint/unbound-method": "off"
|
|
646
|
-
},
|
|
661
|
+
"@typescript-eslint/await-thenable": "off",
|
|
662
|
+
"@typescript-eslint/dot-notation": "off",
|
|
663
|
+
"@typescript-eslint/no-floating-promises": "off",
|
|
664
|
+
"@typescript-eslint/no-for-in-array": "off",
|
|
665
|
+
"@typescript-eslint/no-implied-eval": "off",
|
|
666
|
+
"@typescript-eslint/no-misused-promises": "off",
|
|
667
|
+
"@typescript-eslint/no-throw-literal": "off",
|
|
668
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "off",
|
|
669
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
|
670
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
671
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
672
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
673
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
674
|
+
"@typescript-eslint/restrict-plus-operands": "off",
|
|
675
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
|
676
|
+
"@typescript-eslint/unbound-method": "off",
|
|
647
677
|
...overrides
|
|
648
678
|
}
|
|
649
679
|
}
|
|
@@ -675,7 +705,9 @@ async function node() {
|
|
|
675
705
|
|
|
676
706
|
// src/configs/perfectionist.ts
|
|
677
707
|
async function perfectionist() {
|
|
678
|
-
const pluginPerfectionist = await interopDefault(
|
|
708
|
+
const pluginPerfectionist = await interopDefault(
|
|
709
|
+
import("eslint-plugin-perfectionist")
|
|
710
|
+
);
|
|
679
711
|
return [
|
|
680
712
|
{
|
|
681
713
|
name: "eslint/perfectionist/setup",
|
|
@@ -683,7 +715,10 @@ async function perfectionist() {
|
|
|
683
715
|
perfectionist: pluginPerfectionist
|
|
684
716
|
},
|
|
685
717
|
rules: {
|
|
686
|
-
"perfectionist/sort-exports": [
|
|
718
|
+
"perfectionist/sort-exports": [
|
|
719
|
+
"error",
|
|
720
|
+
{ order: "asc", type: "natural" }
|
|
721
|
+
],
|
|
687
722
|
"perfectionist/sort-imports": [
|
|
688
723
|
"error",
|
|
689
724
|
{
|
|
@@ -712,8 +747,14 @@ async function perfectionist() {
|
|
|
712
747
|
type: "natural"
|
|
713
748
|
}
|
|
714
749
|
],
|
|
715
|
-
"perfectionist/sort-named-exports": [
|
|
716
|
-
|
|
750
|
+
"perfectionist/sort-named-exports": [
|
|
751
|
+
"error",
|
|
752
|
+
{ order: "asc", type: "natural" }
|
|
753
|
+
],
|
|
754
|
+
"perfectionist/sort-named-imports": [
|
|
755
|
+
"error",
|
|
756
|
+
{ order: "asc", type: "natural" }
|
|
757
|
+
]
|
|
717
758
|
}
|
|
718
759
|
}
|
|
719
760
|
];
|
|
@@ -727,7 +768,6 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
|
727
768
|
interopDefault(import("eslint-config-prettier"))
|
|
728
769
|
]);
|
|
729
770
|
const defaultPrettierOptions = {
|
|
730
|
-
printWidth: 100,
|
|
731
771
|
quoteProps: "consistent"
|
|
732
772
|
};
|
|
733
773
|
const plainFileRules = [
|
|
@@ -911,7 +951,14 @@ async function sortTsconfig() {
|
|
|
911
951
|
"jsonc/sort-keys": [
|
|
912
952
|
"error",
|
|
913
953
|
{
|
|
914
|
-
order: [
|
|
954
|
+
order: [
|
|
955
|
+
"extends",
|
|
956
|
+
"compilerOptions",
|
|
957
|
+
"references",
|
|
958
|
+
"files",
|
|
959
|
+
"include",
|
|
960
|
+
"exclude"
|
|
961
|
+
],
|
|
915
962
|
pathPattern: "^$"
|
|
916
963
|
},
|
|
917
964
|
{
|
|
@@ -1048,7 +1095,10 @@ var test = async (options) => {
|
|
|
1048
1095
|
files: GLOB_TESTS,
|
|
1049
1096
|
rules: {
|
|
1050
1097
|
"node/prefer-global/process": "off",
|
|
1051
|
-
"test/consistent-test-it": [
|
|
1098
|
+
"test/consistent-test-it": [
|
|
1099
|
+
"error",
|
|
1100
|
+
{ fn: "it", withinDescribe: "it" }
|
|
1101
|
+
],
|
|
1052
1102
|
"test/no-identical-title": "error",
|
|
1053
1103
|
"test/no-import-node-test": "error",
|
|
1054
1104
|
"test/no-only-tests": "error",
|
|
@@ -1189,7 +1239,10 @@ var typescript = async (options) => {
|
|
|
1189
1239
|
"error",
|
|
1190
1240
|
{ "ts-expect-error": "allow-with-description" }
|
|
1191
1241
|
],
|
|
1192
|
-
"@typescript-eslint/consistent-type-definitions": [
|
|
1242
|
+
"@typescript-eslint/consistent-type-definitions": [
|
|
1243
|
+
"error",
|
|
1244
|
+
"interface"
|
|
1245
|
+
],
|
|
1193
1246
|
"@typescript-eslint/consistent-type-imports": [
|
|
1194
1247
|
"error",
|
|
1195
1248
|
{
|
|
@@ -1202,7 +1255,10 @@ var typescript = async (options) => {
|
|
|
1202
1255
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
1203
1256
|
"@typescript-eslint/no-dupe-class-members": "error",
|
|
1204
1257
|
"@typescript-eslint/no-dynamic-delete": "off",
|
|
1205
|
-
"@typescript-eslint/no-empty-object-type": [
|
|
1258
|
+
"@typescript-eslint/no-empty-object-type": [
|
|
1259
|
+
"error",
|
|
1260
|
+
{ allowInterfaces: "always" }
|
|
1261
|
+
],
|
|
1206
1262
|
"@typescript-eslint/no-explicit-any": "off",
|
|
1207
1263
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
1208
1264
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
@@ -1265,7 +1321,10 @@ async function unicorn() {
|
|
|
1265
1321
|
// Pass error message when throwing errors
|
|
1266
1322
|
"unicorn/error-message": "error",
|
|
1267
1323
|
// Uppercase regex escapes
|
|
1268
|
-
"unicorn/consistent-function-scoping": [
|
|
1324
|
+
"unicorn/consistent-function-scoping": [
|
|
1325
|
+
"error",
|
|
1326
|
+
{ checkArrowFunctions: false }
|
|
1327
|
+
],
|
|
1269
1328
|
// Array.isArray instead of instanceof
|
|
1270
1329
|
"unicorn/no-instanceof-array": "error",
|
|
1271
1330
|
// Ban `new Array` as `Array` constructor's params are ambiguous
|
|
@@ -1297,7 +1356,6 @@ async function unicorn() {
|
|
|
1297
1356
|
var vue = async (options = {}) => {
|
|
1298
1357
|
const { overrides = {}, typescript: isTypescript } = options;
|
|
1299
1358
|
const [pluginVue, parserVue] = await Promise.all([
|
|
1300
|
-
// @ts-expect-error missing types
|
|
1301
1359
|
interopDefault(import("eslint-plugin-vue")),
|
|
1302
1360
|
interopDefault(import("vue-eslint-parser"))
|
|
1303
1361
|
]);
|
|
@@ -1318,7 +1376,9 @@ var vue = async (options = {}) => {
|
|
|
1318
1376
|
jsx: true
|
|
1319
1377
|
},
|
|
1320
1378
|
extraFileExtensions: [".vue"],
|
|
1321
|
-
parser: isTypescript ? await interopDefault(
|
|
1379
|
+
parser: isTypescript ? await interopDefault(
|
|
1380
|
+
import("@typescript-eslint/parser")
|
|
1381
|
+
) : null,
|
|
1322
1382
|
sourceType: "module"
|
|
1323
1383
|
}
|
|
1324
1384
|
},
|
|
@@ -1347,7 +1407,12 @@ var vue = async (options = {}) => {
|
|
|
1347
1407
|
"vue/define-macros-order": [
|
|
1348
1408
|
"error",
|
|
1349
1409
|
{
|
|
1350
|
-
order: [
|
|
1410
|
+
order: [
|
|
1411
|
+
"defineOptions",
|
|
1412
|
+
"defineProps",
|
|
1413
|
+
"defineEmits",
|
|
1414
|
+
"defineSlots"
|
|
1415
|
+
]
|
|
1351
1416
|
}
|
|
1352
1417
|
],
|
|
1353
1418
|
"vue/dot-location": ["error", "property"],
|
|
@@ -1412,7 +1477,10 @@ var vue = async (options = {}) => {
|
|
|
1412
1477
|
"vue/keyword-spacing": ["error", { after: true, before: true }],
|
|
1413
1478
|
"vue/object-curly-newline": "off",
|
|
1414
1479
|
"vue/object-curly-spacing": ["error", "always"],
|
|
1415
|
-
"vue/object-property-newline": [
|
|
1480
|
+
"vue/object-property-newline": [
|
|
1481
|
+
"error",
|
|
1482
|
+
{ allowMultiplePropertiesPerLine: true }
|
|
1483
|
+
],
|
|
1416
1484
|
"vue/operator-linebreak": ["error", "before"],
|
|
1417
1485
|
"vue/padding-line-between-blocks": ["error", "always"],
|
|
1418
1486
|
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
@@ -1493,7 +1561,11 @@ async function next() {
|
|
|
1493
1561
|
"react-refresh/only-export-components": [
|
|
1494
1562
|
"warn",
|
|
1495
1563
|
{
|
|
1496
|
-
allowExportNames: [
|
|
1564
|
+
allowExportNames: [
|
|
1565
|
+
"metadata",
|
|
1566
|
+
"generateMetadata",
|
|
1567
|
+
"generateStaticParams"
|
|
1568
|
+
]
|
|
1497
1569
|
}
|
|
1498
1570
|
]
|
|
1499
1571
|
}
|
|
@@ -1501,15 +1573,20 @@ async function next() {
|
|
|
1501
1573
|
];
|
|
1502
1574
|
}
|
|
1503
1575
|
var react = async (options) => {
|
|
1504
|
-
const {
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1576
|
+
const {
|
|
1577
|
+
next: enableNext = false,
|
|
1578
|
+
compiler: enableCompiler = false,
|
|
1579
|
+
overrides = {}
|
|
1580
|
+
} = options;
|
|
1581
|
+
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
1582
|
+
[
|
|
1583
|
+
interopDefault(import("eslint-plugin-react")),
|
|
1584
|
+
// @ts-expect-error missing types
|
|
1585
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1586
|
+
// @ts-expect-error missing types
|
|
1587
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1588
|
+
]
|
|
1589
|
+
);
|
|
1513
1590
|
const _react = [
|
|
1514
1591
|
{
|
|
1515
1592
|
name: "eslint/react/setup",
|
|
@@ -1542,7 +1619,7 @@ var react = async (options) => {
|
|
|
1542
1619
|
}
|
|
1543
1620
|
},
|
|
1544
1621
|
rules: {
|
|
1545
|
-
...pluginReact.configs.recommended.rules,
|
|
1622
|
+
...pluginReact.configs.flat.recommended.rules,
|
|
1546
1623
|
...pluginReactHooks.configs.recommended.rules,
|
|
1547
1624
|
// React Refresh
|
|
1548
1625
|
"react-refresh/only-export-components": "warn",
|
|
@@ -1634,7 +1711,11 @@ function defineConfig(options = {}) {
|
|
|
1634
1711
|
configs.push(react(getConfigOption(enableReact)));
|
|
1635
1712
|
}
|
|
1636
1713
|
if (options.jsonc ?? true) {
|
|
1637
|
-
configs.push(
|
|
1714
|
+
configs.push(
|
|
1715
|
+
jsonc(getConfigOption(options.jsonc)),
|
|
1716
|
+
sortPackageJson(),
|
|
1717
|
+
sortTsconfig()
|
|
1718
|
+
);
|
|
1638
1719
|
}
|
|
1639
1720
|
if (options.yml ?? true) {
|
|
1640
1721
|
configs.push(yml(getConfigOption(options.yml)));
|
package/dist/index.js
CHANGED
|
@@ -165,7 +165,10 @@ async function imports() {
|
|
|
165
165
|
"import/no-named-default": "error",
|
|
166
166
|
"import/no-self-import": "error",
|
|
167
167
|
"import/no-webpack-loader-syntax": "error",
|
|
168
|
-
"import/newline-after-import": [
|
|
168
|
+
"import/newline-after-import": [
|
|
169
|
+
"error",
|
|
170
|
+
{ considerComments: true, count: 1 }
|
|
171
|
+
],
|
|
169
172
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"]
|
|
170
173
|
}
|
|
171
174
|
}
|
|
@@ -176,7 +179,9 @@ async function imports() {
|
|
|
176
179
|
import globals from "globals";
|
|
177
180
|
var javascript = async (options) => {
|
|
178
181
|
const { overrides = {} } = options;
|
|
179
|
-
const pluginUnusedImports = await interopDefault(
|
|
182
|
+
const pluginUnusedImports = await interopDefault(
|
|
183
|
+
import("eslint-plugin-unused-imports")
|
|
184
|
+
);
|
|
180
185
|
return [
|
|
181
186
|
{
|
|
182
187
|
name: "eslint/javascript/rules",
|
|
@@ -206,14 +211,20 @@ var javascript = async (options) => {
|
|
|
206
211
|
"unused-imports": pluginUnusedImports
|
|
207
212
|
},
|
|
208
213
|
rules: {
|
|
209
|
-
"accessor-pairs": [
|
|
214
|
+
"accessor-pairs": [
|
|
215
|
+
"error",
|
|
216
|
+
{ enforceForClassMembers: true, setWithoutGet: true }
|
|
217
|
+
],
|
|
210
218
|
"array-callback-return": "error",
|
|
211
219
|
"block-scoped-var": "error",
|
|
212
220
|
"constructor-super": "error",
|
|
213
221
|
"default-case-last": "error",
|
|
214
222
|
"dot-notation": ["error", { allowKeywords: true }],
|
|
215
223
|
"eqeqeq": ["error", "smart"],
|
|
216
|
-
"new-cap": [
|
|
224
|
+
"new-cap": [
|
|
225
|
+
"error",
|
|
226
|
+
{ capIsNew: false, newIsCap: true, properties: true }
|
|
227
|
+
],
|
|
217
228
|
"no-alert": "error",
|
|
218
229
|
"no-array-constructor": "error",
|
|
219
230
|
"no-async-promise-executor": "error",
|
|
@@ -292,7 +303,11 @@ var javascript = async (options) => {
|
|
|
292
303
|
property: "__lookupSetter__"
|
|
293
304
|
}
|
|
294
305
|
],
|
|
295
|
-
"no-restricted-syntax": [
|
|
306
|
+
"no-restricted-syntax": [
|
|
307
|
+
"error",
|
|
308
|
+
"TSEnumDeclaration[const=true]",
|
|
309
|
+
"TSExportAssignment"
|
|
310
|
+
],
|
|
296
311
|
"no-self-assign": ["error", { props: true }],
|
|
297
312
|
"no-self-compare": "error",
|
|
298
313
|
"no-sequences": "error",
|
|
@@ -327,7 +342,10 @@ var javascript = async (options) => {
|
|
|
327
342
|
vars: "all"
|
|
328
343
|
}
|
|
329
344
|
],
|
|
330
|
-
"no-use-before-define": [
|
|
345
|
+
"no-use-before-define": [
|
|
346
|
+
"error",
|
|
347
|
+
{ classes: false, functions: false, variables: true }
|
|
348
|
+
],
|
|
331
349
|
"no-useless-backreference": "error",
|
|
332
350
|
"no-useless-call": "error",
|
|
333
351
|
"no-useless-catch": "error",
|
|
@@ -378,7 +396,10 @@ var javascript = async (options) => {
|
|
|
378
396
|
varsIgnorePattern: "^_"
|
|
379
397
|
}
|
|
380
398
|
],
|
|
381
|
-
"use-isnan": [
|
|
399
|
+
"use-isnan": [
|
|
400
|
+
"error",
|
|
401
|
+
{ enforceForIndexOf: true, enforceForSwitchCase: true }
|
|
402
|
+
],
|
|
382
403
|
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
383
404
|
"vars-on-top": "error",
|
|
384
405
|
"yoda": ["error", "never"],
|
|
@@ -475,10 +496,19 @@ var jsonc = async (options) => {
|
|
|
475
496
|
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
476
497
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
477
498
|
"jsonc/comma-style": ["error", "last"],
|
|
478
|
-
"jsonc/key-spacing": [
|
|
479
|
-
|
|
499
|
+
"jsonc/key-spacing": [
|
|
500
|
+
"error",
|
|
501
|
+
{ afterColon: true, beforeColon: false }
|
|
502
|
+
],
|
|
503
|
+
"jsonc/object-curly-newline": [
|
|
504
|
+
"error",
|
|
505
|
+
{ consistent: true, multiline: true }
|
|
506
|
+
],
|
|
480
507
|
"jsonc/object-curly-spacing": ["error", "always"],
|
|
481
|
-
"jsonc/object-property-newline": [
|
|
508
|
+
"jsonc/object-property-newline": [
|
|
509
|
+
"error",
|
|
510
|
+
{ allowMultiplePropertiesPerLine: true }
|
|
511
|
+
],
|
|
482
512
|
"jsonc/quote-props": "error",
|
|
483
513
|
"jsonc/quotes": "error",
|
|
484
514
|
...overrides
|
|
@@ -516,8 +546,11 @@ var markdown = async (options) => {
|
|
|
516
546
|
}
|
|
517
547
|
},
|
|
518
548
|
{
|
|
519
|
-
name: "eslint/markdown/
|
|
520
|
-
files: [
|
|
549
|
+
name: "eslint/markdown/disables",
|
|
550
|
+
files: [
|
|
551
|
+
GLOB_MARKDOWN_CODE,
|
|
552
|
+
...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
553
|
+
],
|
|
521
554
|
languageOptions: {
|
|
522
555
|
parserOptions: {
|
|
523
556
|
ecmaFeatures: {
|
|
@@ -542,25 +575,22 @@ var markdown = async (options) => {
|
|
|
542
575
|
"unicode-bom": "off",
|
|
543
576
|
"unused-imports/no-unused-imports": "off",
|
|
544
577
|
"unused-imports/no-unused-vars": "off",
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
"@typescript-eslint/restrict-template-expressions": "off",
|
|
562
|
-
"@typescript-eslint/unbound-method": "off"
|
|
563
|
-
},
|
|
578
|
+
"@typescript-eslint/await-thenable": "off",
|
|
579
|
+
"@typescript-eslint/dot-notation": "off",
|
|
580
|
+
"@typescript-eslint/no-floating-promises": "off",
|
|
581
|
+
"@typescript-eslint/no-for-in-array": "off",
|
|
582
|
+
"@typescript-eslint/no-implied-eval": "off",
|
|
583
|
+
"@typescript-eslint/no-misused-promises": "off",
|
|
584
|
+
"@typescript-eslint/no-throw-literal": "off",
|
|
585
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "off",
|
|
586
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
|
587
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
588
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
589
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
590
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
591
|
+
"@typescript-eslint/restrict-plus-operands": "off",
|
|
592
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
|
593
|
+
"@typescript-eslint/unbound-method": "off",
|
|
564
594
|
...overrides
|
|
565
595
|
}
|
|
566
596
|
}
|
|
@@ -592,7 +622,9 @@ async function node() {
|
|
|
592
622
|
|
|
593
623
|
// src/configs/perfectionist.ts
|
|
594
624
|
async function perfectionist() {
|
|
595
|
-
const pluginPerfectionist = await interopDefault(
|
|
625
|
+
const pluginPerfectionist = await interopDefault(
|
|
626
|
+
import("eslint-plugin-perfectionist")
|
|
627
|
+
);
|
|
596
628
|
return [
|
|
597
629
|
{
|
|
598
630
|
name: "eslint/perfectionist/setup",
|
|
@@ -600,7 +632,10 @@ async function perfectionist() {
|
|
|
600
632
|
perfectionist: pluginPerfectionist
|
|
601
633
|
},
|
|
602
634
|
rules: {
|
|
603
|
-
"perfectionist/sort-exports": [
|
|
635
|
+
"perfectionist/sort-exports": [
|
|
636
|
+
"error",
|
|
637
|
+
{ order: "asc", type: "natural" }
|
|
638
|
+
],
|
|
604
639
|
"perfectionist/sort-imports": [
|
|
605
640
|
"error",
|
|
606
641
|
{
|
|
@@ -629,8 +664,14 @@ async function perfectionist() {
|
|
|
629
664
|
type: "natural"
|
|
630
665
|
}
|
|
631
666
|
],
|
|
632
|
-
"perfectionist/sort-named-exports": [
|
|
633
|
-
|
|
667
|
+
"perfectionist/sort-named-exports": [
|
|
668
|
+
"error",
|
|
669
|
+
{ order: "asc", type: "natural" }
|
|
670
|
+
],
|
|
671
|
+
"perfectionist/sort-named-imports": [
|
|
672
|
+
"error",
|
|
673
|
+
{ order: "asc", type: "natural" }
|
|
674
|
+
]
|
|
634
675
|
}
|
|
635
676
|
}
|
|
636
677
|
];
|
|
@@ -644,7 +685,6 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
|
644
685
|
interopDefault(import("eslint-config-prettier"))
|
|
645
686
|
]);
|
|
646
687
|
const defaultPrettierOptions = {
|
|
647
|
-
printWidth: 100,
|
|
648
688
|
quoteProps: "consistent"
|
|
649
689
|
};
|
|
650
690
|
const plainFileRules = [
|
|
@@ -828,7 +868,14 @@ async function sortTsconfig() {
|
|
|
828
868
|
"jsonc/sort-keys": [
|
|
829
869
|
"error",
|
|
830
870
|
{
|
|
831
|
-
order: [
|
|
871
|
+
order: [
|
|
872
|
+
"extends",
|
|
873
|
+
"compilerOptions",
|
|
874
|
+
"references",
|
|
875
|
+
"files",
|
|
876
|
+
"include",
|
|
877
|
+
"exclude"
|
|
878
|
+
],
|
|
832
879
|
pathPattern: "^$"
|
|
833
880
|
},
|
|
834
881
|
{
|
|
@@ -965,7 +1012,10 @@ var test = async (options) => {
|
|
|
965
1012
|
files: GLOB_TESTS,
|
|
966
1013
|
rules: {
|
|
967
1014
|
"node/prefer-global/process": "off",
|
|
968
|
-
"test/consistent-test-it": [
|
|
1015
|
+
"test/consistent-test-it": [
|
|
1016
|
+
"error",
|
|
1017
|
+
{ fn: "it", withinDescribe: "it" }
|
|
1018
|
+
],
|
|
969
1019
|
"test/no-identical-title": "error",
|
|
970
1020
|
"test/no-import-node-test": "error",
|
|
971
1021
|
"test/no-only-tests": "error",
|
|
@@ -1106,7 +1156,10 @@ var typescript = async (options) => {
|
|
|
1106
1156
|
"error",
|
|
1107
1157
|
{ "ts-expect-error": "allow-with-description" }
|
|
1108
1158
|
],
|
|
1109
|
-
"@typescript-eslint/consistent-type-definitions": [
|
|
1159
|
+
"@typescript-eslint/consistent-type-definitions": [
|
|
1160
|
+
"error",
|
|
1161
|
+
"interface"
|
|
1162
|
+
],
|
|
1110
1163
|
"@typescript-eslint/consistent-type-imports": [
|
|
1111
1164
|
"error",
|
|
1112
1165
|
{
|
|
@@ -1119,7 +1172,10 @@ var typescript = async (options) => {
|
|
|
1119
1172
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
1120
1173
|
"@typescript-eslint/no-dupe-class-members": "error",
|
|
1121
1174
|
"@typescript-eslint/no-dynamic-delete": "off",
|
|
1122
|
-
"@typescript-eslint/no-empty-object-type": [
|
|
1175
|
+
"@typescript-eslint/no-empty-object-type": [
|
|
1176
|
+
"error",
|
|
1177
|
+
{ allowInterfaces: "always" }
|
|
1178
|
+
],
|
|
1123
1179
|
"@typescript-eslint/no-explicit-any": "off",
|
|
1124
1180
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
1125
1181
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
@@ -1182,7 +1238,10 @@ async function unicorn() {
|
|
|
1182
1238
|
// Pass error message when throwing errors
|
|
1183
1239
|
"unicorn/error-message": "error",
|
|
1184
1240
|
// Uppercase regex escapes
|
|
1185
|
-
"unicorn/consistent-function-scoping": [
|
|
1241
|
+
"unicorn/consistent-function-scoping": [
|
|
1242
|
+
"error",
|
|
1243
|
+
{ checkArrowFunctions: false }
|
|
1244
|
+
],
|
|
1186
1245
|
// Array.isArray instead of instanceof
|
|
1187
1246
|
"unicorn/no-instanceof-array": "error",
|
|
1188
1247
|
// Ban `new Array` as `Array` constructor's params are ambiguous
|
|
@@ -1214,7 +1273,6 @@ async function unicorn() {
|
|
|
1214
1273
|
var vue = async (options = {}) => {
|
|
1215
1274
|
const { overrides = {}, typescript: isTypescript } = options;
|
|
1216
1275
|
const [pluginVue, parserVue] = await Promise.all([
|
|
1217
|
-
// @ts-expect-error missing types
|
|
1218
1276
|
interopDefault(import("eslint-plugin-vue")),
|
|
1219
1277
|
interopDefault(import("vue-eslint-parser"))
|
|
1220
1278
|
]);
|
|
@@ -1235,7 +1293,9 @@ var vue = async (options = {}) => {
|
|
|
1235
1293
|
jsx: true
|
|
1236
1294
|
},
|
|
1237
1295
|
extraFileExtensions: [".vue"],
|
|
1238
|
-
parser: isTypescript ? await interopDefault(
|
|
1296
|
+
parser: isTypescript ? await interopDefault(
|
|
1297
|
+
import("@typescript-eslint/parser")
|
|
1298
|
+
) : null,
|
|
1239
1299
|
sourceType: "module"
|
|
1240
1300
|
}
|
|
1241
1301
|
},
|
|
@@ -1264,7 +1324,12 @@ var vue = async (options = {}) => {
|
|
|
1264
1324
|
"vue/define-macros-order": [
|
|
1265
1325
|
"error",
|
|
1266
1326
|
{
|
|
1267
|
-
order: [
|
|
1327
|
+
order: [
|
|
1328
|
+
"defineOptions",
|
|
1329
|
+
"defineProps",
|
|
1330
|
+
"defineEmits",
|
|
1331
|
+
"defineSlots"
|
|
1332
|
+
]
|
|
1268
1333
|
}
|
|
1269
1334
|
],
|
|
1270
1335
|
"vue/dot-location": ["error", "property"],
|
|
@@ -1329,7 +1394,10 @@ var vue = async (options = {}) => {
|
|
|
1329
1394
|
"vue/keyword-spacing": ["error", { after: true, before: true }],
|
|
1330
1395
|
"vue/object-curly-newline": "off",
|
|
1331
1396
|
"vue/object-curly-spacing": ["error", "always"],
|
|
1332
|
-
"vue/object-property-newline": [
|
|
1397
|
+
"vue/object-property-newline": [
|
|
1398
|
+
"error",
|
|
1399
|
+
{ allowMultiplePropertiesPerLine: true }
|
|
1400
|
+
],
|
|
1333
1401
|
"vue/operator-linebreak": ["error", "before"],
|
|
1334
1402
|
"vue/padding-line-between-blocks": ["error", "always"],
|
|
1335
1403
|
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
@@ -1410,7 +1478,11 @@ async function next() {
|
|
|
1410
1478
|
"react-refresh/only-export-components": [
|
|
1411
1479
|
"warn",
|
|
1412
1480
|
{
|
|
1413
|
-
allowExportNames: [
|
|
1481
|
+
allowExportNames: [
|
|
1482
|
+
"metadata",
|
|
1483
|
+
"generateMetadata",
|
|
1484
|
+
"generateStaticParams"
|
|
1485
|
+
]
|
|
1414
1486
|
}
|
|
1415
1487
|
]
|
|
1416
1488
|
}
|
|
@@ -1418,15 +1490,20 @@ async function next() {
|
|
|
1418
1490
|
];
|
|
1419
1491
|
}
|
|
1420
1492
|
var react = async (options) => {
|
|
1421
|
-
const {
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1493
|
+
const {
|
|
1494
|
+
next: enableNext = false,
|
|
1495
|
+
compiler: enableCompiler = false,
|
|
1496
|
+
overrides = {}
|
|
1497
|
+
} = options;
|
|
1498
|
+
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
1499
|
+
[
|
|
1500
|
+
interopDefault(import("eslint-plugin-react")),
|
|
1501
|
+
// @ts-expect-error missing types
|
|
1502
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1503
|
+
// @ts-expect-error missing types
|
|
1504
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1505
|
+
]
|
|
1506
|
+
);
|
|
1430
1507
|
const _react = [
|
|
1431
1508
|
{
|
|
1432
1509
|
name: "eslint/react/setup",
|
|
@@ -1459,7 +1536,7 @@ var react = async (options) => {
|
|
|
1459
1536
|
}
|
|
1460
1537
|
},
|
|
1461
1538
|
rules: {
|
|
1462
|
-
...pluginReact.configs.recommended.rules,
|
|
1539
|
+
...pluginReact.configs.flat.recommended.rules,
|
|
1463
1540
|
...pluginReactHooks.configs.recommended.rules,
|
|
1464
1541
|
// React Refresh
|
|
1465
1542
|
"react-refresh/only-export-components": "warn",
|
|
@@ -1551,7 +1628,11 @@ function defineConfig(options = {}) {
|
|
|
1551
1628
|
configs.push(react(getConfigOption(enableReact)));
|
|
1552
1629
|
}
|
|
1553
1630
|
if (options.jsonc ?? true) {
|
|
1554
|
-
configs.push(
|
|
1631
|
+
configs.push(
|
|
1632
|
+
jsonc(getConfigOption(options.jsonc)),
|
|
1633
|
+
sortPackageJson(),
|
|
1634
|
+
sortTsconfig()
|
|
1635
|
+
);
|
|
1555
1636
|
}
|
|
1556
1637
|
if (options.yml ?? true) {
|
|
1557
1638
|
configs.push(yml(getConfigOption(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.8.
|
|
4
|
+
"version": "3.8.2",
|
|
5
5
|
"description": "Brendan Dash's ESLint config",
|
|
6
6
|
"author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,33 +26,33 @@
|
|
|
26
26
|
"eslint": ">=8.40.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@eslint/markdown": "^6.
|
|
29
|
+
"@eslint/markdown": "^6.2.0",
|
|
30
30
|
"@next/eslint-plugin-next": "15.0.0-rc.0",
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
32
|
-
"@typescript-eslint/parser": "^8.
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^8.9.0",
|
|
32
|
+
"@typescript-eslint/parser": "^8.9.0",
|
|
33
33
|
"eslint-config-prettier": "^9.1.0",
|
|
34
34
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
35
|
-
"eslint-plugin-import-x": "^4.3.
|
|
36
|
-
"eslint-plugin-jsdoc": "^50.
|
|
35
|
+
"eslint-plugin-import-x": "^4.3.1",
|
|
36
|
+
"eslint-plugin-jsdoc": "^50.4.1",
|
|
37
37
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
38
38
|
"eslint-plugin-mdx": "^3.1.5",
|
|
39
|
-
"eslint-plugin-n": "^17.
|
|
39
|
+
"eslint-plugin-n": "^17.11.1",
|
|
40
40
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
41
|
-
"eslint-plugin-perfectionist": "^3.
|
|
41
|
+
"eslint-plugin-perfectionist": "^3.9.0",
|
|
42
42
|
"eslint-plugin-prettier": "^5.2.1",
|
|
43
|
-
"eslint-plugin-react": "^7.
|
|
44
|
-
"eslint-plugin-react-compiler": "0.0.0-experimental-
|
|
45
|
-
"eslint-plugin-react-hooks": "
|
|
43
|
+
"eslint-plugin-react": "^7.37.1",
|
|
44
|
+
"eslint-plugin-react-compiler": "0.0.0-experimental-605e95c-20241015",
|
|
45
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
46
46
|
"eslint-plugin-react-refresh": "^0.4.12",
|
|
47
47
|
"eslint-plugin-solid": "^0.14.3",
|
|
48
|
-
"eslint-plugin-tailwindcss": "^3.17.
|
|
48
|
+
"eslint-plugin-tailwindcss": "^3.17.5",
|
|
49
49
|
"eslint-plugin-toml": "^0.11.1",
|
|
50
|
-
"eslint-plugin-unicorn": "^
|
|
50
|
+
"eslint-plugin-unicorn": "^56.0.0",
|
|
51
51
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
52
52
|
"eslint-plugin-vitest": "^0.5.4",
|
|
53
|
-
"eslint-plugin-vue": "^9.
|
|
53
|
+
"eslint-plugin-vue": "^9.29.0",
|
|
54
54
|
"eslint-plugin-yml": "^1.14.0",
|
|
55
|
-
"globals": "^15.
|
|
55
|
+
"globals": "^15.11.0",
|
|
56
56
|
"jsonc-eslint-parser": "^2.4.0",
|
|
57
57
|
"prettier": "^3.3.3",
|
|
58
58
|
"prettier-plugin-tailwindcss": "^0.6.8",
|
|
@@ -63,18 +63,18 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@eslint/config-inspector": "^0.5.4",
|
|
65
65
|
"@types/eslint": "^9.6.1",
|
|
66
|
-
"@types/node": "^22.7.
|
|
67
|
-
"@types/react": "^18.3.
|
|
68
|
-
"bumpp": "^9.
|
|
69
|
-
"eslint": "^9.
|
|
66
|
+
"@types/node": "^22.7.5",
|
|
67
|
+
"@types/react": "^18.3.11",
|
|
68
|
+
"bumpp": "^9.7.1",
|
|
69
|
+
"eslint": "^9.12.0",
|
|
70
70
|
"execa": "^9.4.0",
|
|
71
71
|
"fast-glob": "^3.3.2",
|
|
72
72
|
"fs-extra": "^11.2.0",
|
|
73
73
|
"react": "^18.3.1",
|
|
74
74
|
"sucrase": "^3.35.0",
|
|
75
75
|
"tsup": "^8.3.0",
|
|
76
|
-
"typescript": "^5.6.
|
|
77
|
-
"vitest": "^2.1.
|
|
76
|
+
"typescript": "^5.6.3",
|
|
77
|
+
"vitest": "^2.1.3"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"build": "tsup --format esm,cjs --clean --dts",
|