@debbl/eslint-config 3.0.7 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +83 -71
- package/dist/index.d.cts +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +82 -71
- package/package.json +11 -5
package/dist/index.cjs
CHANGED
|
@@ -66,6 +66,7 @@ __export(src_exports, {
|
|
|
66
66
|
jsonc: () => jsonc,
|
|
67
67
|
markdown: () => markdown,
|
|
68
68
|
node: () => node,
|
|
69
|
+
parserPlain: () => parserPlain,
|
|
69
70
|
perfectionist: () => perfectionist,
|
|
70
71
|
prettier: () => prettier,
|
|
71
72
|
sortPackageJson: () => sortPackageJson,
|
|
@@ -87,7 +88,7 @@ async function comments() {
|
|
|
87
88
|
);
|
|
88
89
|
return [
|
|
89
90
|
{
|
|
90
|
-
name: "eslint
|
|
91
|
+
name: "eslint/eslint-comments/rules",
|
|
91
92
|
plugins: {
|
|
92
93
|
"eslint-comments": pluginComments
|
|
93
94
|
},
|
|
@@ -201,6 +202,26 @@ var ignores = async (options) => {
|
|
|
201
202
|
};
|
|
202
203
|
|
|
203
204
|
// src/utils.ts
|
|
205
|
+
var parserPlain = {
|
|
206
|
+
meta: {
|
|
207
|
+
name: "parser-plain"
|
|
208
|
+
},
|
|
209
|
+
parseForESLint: (code) => ({
|
|
210
|
+
ast: {
|
|
211
|
+
body: [],
|
|
212
|
+
comments: [],
|
|
213
|
+
loc: { end: code.length, start: 0 },
|
|
214
|
+
range: [0, code.length],
|
|
215
|
+
tokens: [],
|
|
216
|
+
type: "Program"
|
|
217
|
+
},
|
|
218
|
+
scopeManager: null,
|
|
219
|
+
services: { isPlain: true },
|
|
220
|
+
visitorKeys: {
|
|
221
|
+
Program: []
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
};
|
|
204
225
|
async function combine(...configs) {
|
|
205
226
|
const resolved = await Promise.all(configs);
|
|
206
227
|
return resolved.flat();
|
|
@@ -212,10 +233,10 @@ async function interopDefault(m) {
|
|
|
212
233
|
|
|
213
234
|
// src/configs/imports.ts
|
|
214
235
|
async function imports() {
|
|
215
|
-
const pluginImport = await interopDefault(import("eslint-plugin-
|
|
236
|
+
const pluginImport = await interopDefault(import("eslint-plugin-import-x"));
|
|
216
237
|
return [
|
|
217
238
|
{
|
|
218
|
-
name: "eslint
|
|
239
|
+
name: "eslint/imports/rules",
|
|
219
240
|
plugins: {
|
|
220
241
|
import: pluginImport
|
|
221
242
|
},
|
|
@@ -226,23 +247,7 @@ async function imports() {
|
|
|
226
247
|
"import/no-named-default": "error",
|
|
227
248
|
"import/no-self-import": "error",
|
|
228
249
|
"import/no-webpack-loader-syntax": "error",
|
|
229
|
-
"import/order":
|
|
230
|
-
"error",
|
|
231
|
-
{
|
|
232
|
-
groups: [
|
|
233
|
-
"builtin",
|
|
234
|
-
"external",
|
|
235
|
-
"internal",
|
|
236
|
-
"parent",
|
|
237
|
-
"sibling",
|
|
238
|
-
"index",
|
|
239
|
-
"object",
|
|
240
|
-
"type"
|
|
241
|
-
],
|
|
242
|
-
pathGroups: [{ group: "internal", pattern: "{{@,~}/,#}**" }],
|
|
243
|
-
pathGroupsExcludedImportTypes: ["type"]
|
|
244
|
-
}
|
|
245
|
-
],
|
|
250
|
+
"import/order": "error",
|
|
246
251
|
"import/newline-after-import": [
|
|
247
252
|
"error",
|
|
248
253
|
{ considerComments: true, count: 1 }
|
|
@@ -262,7 +267,7 @@ var javascript = async (options) => {
|
|
|
262
267
|
);
|
|
263
268
|
return [
|
|
264
269
|
{
|
|
265
|
-
name: "eslint
|
|
270
|
+
name: "eslint/javascript/rules",
|
|
266
271
|
languageOptions: {
|
|
267
272
|
ecmaVersion: 2022,
|
|
268
273
|
globals: {
|
|
@@ -498,7 +503,7 @@ var javascript = async (options) => {
|
|
|
498
503
|
}
|
|
499
504
|
},
|
|
500
505
|
{
|
|
501
|
-
name: "eslint
|
|
506
|
+
name: "eslint/scripts-overrides/disables/cli",
|
|
502
507
|
files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
|
|
503
508
|
rules: {
|
|
504
509
|
"no-console": "off"
|
|
@@ -511,7 +516,7 @@ var javascript = async (options) => {
|
|
|
511
516
|
async function jsdoc() {
|
|
512
517
|
return [
|
|
513
518
|
{
|
|
514
|
-
name: "eslint
|
|
519
|
+
name: "eslint/jsdoc/rules",
|
|
515
520
|
plugins: {
|
|
516
521
|
jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
|
|
517
522
|
},
|
|
@@ -547,13 +552,13 @@ var jsonc = async (options) => {
|
|
|
547
552
|
]);
|
|
548
553
|
return [
|
|
549
554
|
{
|
|
550
|
-
name: "eslint
|
|
555
|
+
name: "eslint/jsonc/setup",
|
|
551
556
|
plugins: {
|
|
552
557
|
jsonc: pluginJsonc
|
|
553
558
|
}
|
|
554
559
|
},
|
|
555
560
|
{
|
|
556
|
-
name: "eslint
|
|
561
|
+
name: "eslint/jsonc/rules",
|
|
557
562
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
558
563
|
languageOptions: {
|
|
559
564
|
parser: parserJsonc
|
|
@@ -617,13 +622,13 @@ var markdown = async (options) => {
|
|
|
617
622
|
]);
|
|
618
623
|
return [
|
|
619
624
|
{
|
|
620
|
-
name: "eslint
|
|
625
|
+
name: "eslint/markdown/setup",
|
|
621
626
|
plugins: {
|
|
622
627
|
mdx: pluginMdx
|
|
623
628
|
}
|
|
624
629
|
},
|
|
625
630
|
{
|
|
626
|
-
name: "eslint
|
|
631
|
+
name: "eslint/markdown/processor",
|
|
627
632
|
files: [GLOB_MARKDOWN, GLOB_MDX],
|
|
628
633
|
languageOptions: {
|
|
629
634
|
ecmaVersion: "latest",
|
|
@@ -636,7 +641,7 @@ var markdown = async (options) => {
|
|
|
636
641
|
}
|
|
637
642
|
},
|
|
638
643
|
{
|
|
639
|
-
name: "eslint
|
|
644
|
+
name: "eslint/markdown/rules",
|
|
640
645
|
files: [
|
|
641
646
|
GLOB_MARKDOWN_CODE,
|
|
642
647
|
...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
@@ -695,7 +700,7 @@ async function node() {
|
|
|
695
700
|
const pluginNode = await interopDefault(import("eslint-plugin-n"));
|
|
696
701
|
return [
|
|
697
702
|
{
|
|
698
|
-
name: "eslint
|
|
703
|
+
name: "eslint/node/rules",
|
|
699
704
|
plugins: {
|
|
700
705
|
n: pluginNode
|
|
701
706
|
},
|
|
@@ -717,7 +722,7 @@ async function node() {
|
|
|
717
722
|
async function sortPackageJson() {
|
|
718
723
|
return [
|
|
719
724
|
{
|
|
720
|
-
name: "eslint
|
|
725
|
+
name: "eslint/sort/package-json",
|
|
721
726
|
files: ["**/package.json"],
|
|
722
727
|
rules: {
|
|
723
728
|
"jsonc/sort-array-values": [
|
|
@@ -797,7 +802,7 @@ async function sortPackageJson() {
|
|
|
797
802
|
async function sortTsconfig() {
|
|
798
803
|
return [
|
|
799
804
|
{
|
|
800
|
-
name: "eslint
|
|
805
|
+
name: "eslint/sort/tsconfig-json",
|
|
801
806
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
802
807
|
rules: {
|
|
803
808
|
"jsonc/sort-keys": [
|
|
@@ -957,13 +962,13 @@ var typescript = async (options) => {
|
|
|
957
962
|
return [
|
|
958
963
|
{
|
|
959
964
|
// Install the plugins without globs, so they can be configured separately.
|
|
960
|
-
name: "eslint
|
|
965
|
+
name: "eslint/typescript/setup",
|
|
961
966
|
plugins: {
|
|
962
967
|
"@typescript-eslint": pluginTs
|
|
963
968
|
}
|
|
964
969
|
},
|
|
965
970
|
{
|
|
966
|
-
name: "eslint
|
|
971
|
+
name: "eslint/typescript/rules",
|
|
967
972
|
files: [GLOB_SRC, ...componentExts.map((ext) => `**/*.${ext}`)],
|
|
968
973
|
languageOptions: {
|
|
969
974
|
parser: parserTs,
|
|
@@ -1029,7 +1034,7 @@ var typescript = async (options) => {
|
|
|
1029
1034
|
}
|
|
1030
1035
|
},
|
|
1031
1036
|
{
|
|
1032
|
-
name: "eslint
|
|
1037
|
+
name: "eslint/typescript/dts-overrides",
|
|
1033
1038
|
files: ["**/*.d.ts"],
|
|
1034
1039
|
rules: {
|
|
1035
1040
|
"eslint-comments/no-unlimited-disable": "off",
|
|
@@ -1039,15 +1044,15 @@ var typescript = async (options) => {
|
|
|
1039
1044
|
}
|
|
1040
1045
|
},
|
|
1041
1046
|
{
|
|
1042
|
-
name: "eslint
|
|
1047
|
+
name: "eslint/typescript/disables/test",
|
|
1043
1048
|
files: ["**/*.{test,spec}.ts?(x)"],
|
|
1044
1049
|
rules: {
|
|
1045
1050
|
"no-unused-expressions": "off"
|
|
1046
1051
|
}
|
|
1047
1052
|
},
|
|
1048
1053
|
{
|
|
1054
|
+
name: "eslint/typescript/disables/cjs",
|
|
1049
1055
|
files: ["**/*.js", "**/*.cjs"],
|
|
1050
|
-
name: "eslint:typescript:javascript-overrides",
|
|
1051
1056
|
rules: {
|
|
1052
1057
|
"@typescript-eslint/no-require-imports": "off",
|
|
1053
1058
|
"@typescript-eslint/no-var-requires": "off"
|
|
@@ -1061,7 +1066,7 @@ async function unicorn() {
|
|
|
1061
1066
|
const pluginUnicorn = await interopDefault(import("eslint-plugin-unicorn"));
|
|
1062
1067
|
return [
|
|
1063
1068
|
{
|
|
1064
|
-
name: "eslint
|
|
1069
|
+
name: "eslint/unicorn/rules",
|
|
1065
1070
|
plugins: {
|
|
1066
1071
|
unicorn: pluginUnicorn
|
|
1067
1072
|
},
|
|
@@ -1107,13 +1112,13 @@ var vue = async (options = {}) => {
|
|
|
1107
1112
|
]);
|
|
1108
1113
|
return [
|
|
1109
1114
|
{
|
|
1110
|
-
name: "eslint
|
|
1115
|
+
name: "eslint/vue/setup",
|
|
1111
1116
|
plugins: {
|
|
1112
1117
|
vue: pluginVue
|
|
1113
1118
|
}
|
|
1114
1119
|
},
|
|
1115
1120
|
{
|
|
1116
|
-
name: "eslint
|
|
1121
|
+
name: "eslint/vue/rules",
|
|
1117
1122
|
files: [GLOB_VUE],
|
|
1118
1123
|
languageOptions: {
|
|
1119
1124
|
parser: parserVue,
|
|
@@ -1247,13 +1252,13 @@ var yml = async (options) => {
|
|
|
1247
1252
|
]);
|
|
1248
1253
|
return [
|
|
1249
1254
|
{
|
|
1250
|
-
name: "eslint
|
|
1255
|
+
name: "eslint/yaml/setup",
|
|
1251
1256
|
plugins: {
|
|
1252
1257
|
yml: pluginYml
|
|
1253
1258
|
}
|
|
1254
1259
|
},
|
|
1255
1260
|
{
|
|
1256
|
-
name: "eslint
|
|
1261
|
+
name: "eslint/yaml/rules",
|
|
1257
1262
|
files: [GLOB_YAML],
|
|
1258
1263
|
languageOptions: {
|
|
1259
1264
|
parser: parserYml
|
|
@@ -1284,13 +1289,13 @@ var toml = async (options) => {
|
|
|
1284
1289
|
]);
|
|
1285
1290
|
return [
|
|
1286
1291
|
{
|
|
1287
|
-
name: "eslint
|
|
1292
|
+
name: "eslint/toml/setup",
|
|
1288
1293
|
plugins: {
|
|
1289
1294
|
toml: pluginToml
|
|
1290
1295
|
}
|
|
1291
1296
|
},
|
|
1292
1297
|
{
|
|
1293
|
-
name: "eslint
|
|
1298
|
+
name: "eslint/toml/rules",
|
|
1294
1299
|
files: [GLOB_TOML],
|
|
1295
1300
|
languageOptions: {
|
|
1296
1301
|
parser: parserToml
|
|
@@ -1331,7 +1336,7 @@ var test = async (options) => {
|
|
|
1331
1336
|
]);
|
|
1332
1337
|
return [
|
|
1333
1338
|
{
|
|
1334
|
-
name: "eslint
|
|
1339
|
+
name: "eslint/test/setup",
|
|
1335
1340
|
plugins: {
|
|
1336
1341
|
test: {
|
|
1337
1342
|
...pluginVitest,
|
|
@@ -1344,7 +1349,7 @@ var test = async (options) => {
|
|
|
1344
1349
|
}
|
|
1345
1350
|
},
|
|
1346
1351
|
{
|
|
1347
|
-
name: "eslint
|
|
1352
|
+
name: "eslint/test/rules",
|
|
1348
1353
|
files: GLOB_TESTS,
|
|
1349
1354
|
rules: {
|
|
1350
1355
|
"test/consistent-test-it": [
|
|
@@ -1369,7 +1374,7 @@ async function perfectionist() {
|
|
|
1369
1374
|
);
|
|
1370
1375
|
return [
|
|
1371
1376
|
{
|
|
1372
|
-
name: "eslint
|
|
1377
|
+
name: "eslint/perfectionist/setup",
|
|
1373
1378
|
plugins: {
|
|
1374
1379
|
perfectionist: pluginPerfectionist
|
|
1375
1380
|
}
|
|
@@ -1379,50 +1384,49 @@ async function perfectionist() {
|
|
|
1379
1384
|
|
|
1380
1385
|
// src/configs/prettier.ts
|
|
1381
1386
|
var prettier = async (options) => {
|
|
1382
|
-
const [pluginPrettier, configPrettier
|
|
1387
|
+
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
1383
1388
|
interopDefault(import("eslint-plugin-prettier")),
|
|
1384
1389
|
// @ts-expect-error missing types
|
|
1385
|
-
interopDefault(import("eslint-config-prettier"))
|
|
1386
|
-
interopDefault(import("eslint-parser-plain"))
|
|
1390
|
+
interopDefault(import("eslint-config-prettier"))
|
|
1387
1391
|
]);
|
|
1388
1392
|
const PlainFileRules = [
|
|
1389
1393
|
{
|
|
1390
|
-
name: "eslint
|
|
1394
|
+
name: "eslint/prettier/markdown",
|
|
1391
1395
|
files: [GLOB_MARKDOWN],
|
|
1392
1396
|
parser: "markdown"
|
|
1393
1397
|
},
|
|
1394
1398
|
{
|
|
1395
|
-
name: "eslint
|
|
1399
|
+
name: "eslint/prettier/mdx",
|
|
1396
1400
|
files: [GLOB_MDX],
|
|
1397
1401
|
parser: "mdx"
|
|
1398
1402
|
},
|
|
1399
1403
|
{
|
|
1400
|
-
name: "eslint
|
|
1404
|
+
name: "eslint/prettier/html",
|
|
1401
1405
|
files: ["**/*.html"],
|
|
1402
1406
|
parser: "html"
|
|
1403
1407
|
},
|
|
1404
1408
|
{
|
|
1405
|
-
name: "eslint
|
|
1409
|
+
name: "eslint/prettier/css",
|
|
1406
1410
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
1407
1411
|
parser: "css"
|
|
1408
1412
|
},
|
|
1409
1413
|
{
|
|
1410
|
-
name: "eslint
|
|
1414
|
+
name: "eslint/prettier/scss",
|
|
1411
1415
|
files: [GLOB_SCSS],
|
|
1412
1416
|
parser: "scss"
|
|
1413
1417
|
},
|
|
1414
1418
|
{
|
|
1415
|
-
name: "eslint
|
|
1419
|
+
name: "eslint/prettier/less",
|
|
1416
1420
|
files: [GLOB_LESS],
|
|
1417
1421
|
parser: "less"
|
|
1418
1422
|
},
|
|
1419
1423
|
{
|
|
1420
|
-
name: "eslint
|
|
1424
|
+
name: "eslint/prettier/yaml",
|
|
1421
1425
|
files: [GLOB_YAML],
|
|
1422
1426
|
parser: "yaml"
|
|
1423
1427
|
},
|
|
1424
1428
|
{
|
|
1425
|
-
name: "eslint
|
|
1429
|
+
name: "eslint/prettier/graphql",
|
|
1426
1430
|
files: ["**/*.graphql"],
|
|
1427
1431
|
parser: "graphql"
|
|
1428
1432
|
}
|
|
@@ -1445,13 +1449,13 @@ var prettier = async (options) => {
|
|
|
1445
1449
|
}));
|
|
1446
1450
|
return [
|
|
1447
1451
|
{
|
|
1448
|
-
name: "eslint
|
|
1452
|
+
name: "eslint/prettier/setup",
|
|
1449
1453
|
plugins: {
|
|
1450
1454
|
prettier: pluginPrettier
|
|
1451
1455
|
}
|
|
1452
1456
|
},
|
|
1453
1457
|
{
|
|
1454
|
-
name: "eslint
|
|
1458
|
+
name: "eslint/prettier/rules",
|
|
1455
1459
|
ignores: [GLOB_TOML],
|
|
1456
1460
|
rules: {
|
|
1457
1461
|
...configPrettier.rules,
|
|
@@ -1474,13 +1478,13 @@ async function next() {
|
|
|
1474
1478
|
const pluginNext = await interopDefault(import("@next/eslint-plugin-next"));
|
|
1475
1479
|
return [
|
|
1476
1480
|
{
|
|
1477
|
-
name: "eslint
|
|
1481
|
+
name: "eslint/next/setup",
|
|
1478
1482
|
plugins: {
|
|
1479
1483
|
"@next/next": pluginNext
|
|
1480
1484
|
}
|
|
1481
1485
|
},
|
|
1482
1486
|
{
|
|
1483
|
-
name: "eslint
|
|
1487
|
+
name: "eslint/next/rules",
|
|
1484
1488
|
files: [GLOB_TSX, GLOB_JSX],
|
|
1485
1489
|
languageOptions: {
|
|
1486
1490
|
parserOptions: {
|
|
@@ -1504,22 +1508,27 @@ async function next() {
|
|
|
1504
1508
|
}
|
|
1505
1509
|
var react = async (options) => {
|
|
1506
1510
|
const { next: enableNext = false, overrides = {} } = options;
|
|
1507
|
-
const [pluginReact, pluginReactHooks] = await Promise.all(
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1511
|
+
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
1512
|
+
[
|
|
1513
|
+
// @ts-expect-error missing types
|
|
1514
|
+
interopDefault(import("eslint-plugin-react")),
|
|
1515
|
+
// @ts-expect-error missing types
|
|
1516
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1517
|
+
// @ts-expect-error missing types
|
|
1518
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1519
|
+
]
|
|
1520
|
+
);
|
|
1513
1521
|
const _react = [
|
|
1514
1522
|
{
|
|
1515
|
-
name: "eslint
|
|
1523
|
+
name: "eslint/react/setup",
|
|
1516
1524
|
plugins: {
|
|
1517
1525
|
"react": pluginReact,
|
|
1518
|
-
"react-hooks": pluginReactHooks
|
|
1526
|
+
"react-hooks": pluginReactHooks,
|
|
1527
|
+
"react-refresh": pluginReactRefresh
|
|
1519
1528
|
}
|
|
1520
1529
|
},
|
|
1521
1530
|
{
|
|
1522
|
-
name: "eslint
|
|
1531
|
+
name: "eslint/react/rules",
|
|
1523
1532
|
files: [GLOB_TSX, GLOB_JSX],
|
|
1524
1533
|
languageOptions: {
|
|
1525
1534
|
parserOptions: {
|
|
@@ -1537,6 +1546,8 @@ var react = async (options) => {
|
|
|
1537
1546
|
rules: {
|
|
1538
1547
|
...pluginReact.configs.recommended.rules,
|
|
1539
1548
|
...pluginReactHooks.configs.recommended.rules,
|
|
1549
|
+
// React Refresh
|
|
1550
|
+
"react-refresh/only-export-components": "warn",
|
|
1540
1551
|
"jsx-quotes": ["error", "prefer-double"],
|
|
1541
1552
|
"react/react-in-jsx-scope": "off",
|
|
1542
1553
|
"react/jsx-indent": [1, 2],
|
|
@@ -1560,7 +1571,7 @@ async function tailwindcss() {
|
|
|
1560
1571
|
);
|
|
1561
1572
|
return [
|
|
1562
1573
|
{
|
|
1563
|
-
name: "eslint
|
|
1574
|
+
name: "eslint/tailwindcss/rules",
|
|
1564
1575
|
plugins: {
|
|
1565
1576
|
tailwindcss: pluginTailwindcss
|
|
1566
1577
|
},
|
|
@@ -1689,6 +1700,7 @@ var src_default = config;
|
|
|
1689
1700
|
jsonc,
|
|
1690
1701
|
markdown,
|
|
1691
1702
|
node,
|
|
1703
|
+
parserPlain,
|
|
1692
1704
|
perfectionist,
|
|
1693
1705
|
prettier,
|
|
1694
1706
|
sortPackageJson,
|
package/dist/index.d.cts
CHANGED
|
@@ -201,6 +201,31 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
201
201
|
*/
|
|
202
202
|
declare function config(options?: OptionsConfig): Promise<ConfigItem[]>;
|
|
203
203
|
|
|
204
|
+
declare const parserPlain: {
|
|
205
|
+
meta: {
|
|
206
|
+
name: string;
|
|
207
|
+
};
|
|
208
|
+
parseForESLint: (code: string) => {
|
|
209
|
+
ast: {
|
|
210
|
+
body: never[];
|
|
211
|
+
comments: never[];
|
|
212
|
+
loc: {
|
|
213
|
+
end: number;
|
|
214
|
+
start: number;
|
|
215
|
+
};
|
|
216
|
+
range: number[];
|
|
217
|
+
tokens: never[];
|
|
218
|
+
type: string;
|
|
219
|
+
};
|
|
220
|
+
scopeManager: null;
|
|
221
|
+
services: {
|
|
222
|
+
isPlain: boolean;
|
|
223
|
+
};
|
|
224
|
+
visitorKeys: {
|
|
225
|
+
Program: never[];
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
204
229
|
/**
|
|
205
230
|
* Combine array and non-array configs into a single array.
|
|
206
231
|
*/
|
|
@@ -234,4 +259,4 @@ declare const GLOB_TESTS: string[];
|
|
|
234
259
|
declare const GLOB_ALL_SRC: string[];
|
|
235
260
|
declare const GLOB_EXCLUDE: string[];
|
|
236
261
|
|
|
237
|
-
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type GetConfigOption, type IgnoresConfig, type JavascriptConfig, type JsoncConfig, type MarkdownConfig, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsOverrides, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierConfig, type PrettierRequiredOptions, type TestConfig, type TomlConfig, type TypeScriptConfig, type VueConfig, type YmlConfig, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
|
262
|
+
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type GetConfigOption, type IgnoresConfig, type JavascriptConfig, type JsoncConfig, type MarkdownConfig, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsOverrides, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierConfig, type PrettierRequiredOptions, type TestConfig, type TomlConfig, type TypeScriptConfig, type VueConfig, type YmlConfig, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -201,6 +201,31 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
201
201
|
*/
|
|
202
202
|
declare function config(options?: OptionsConfig): Promise<ConfigItem[]>;
|
|
203
203
|
|
|
204
|
+
declare const parserPlain: {
|
|
205
|
+
meta: {
|
|
206
|
+
name: string;
|
|
207
|
+
};
|
|
208
|
+
parseForESLint: (code: string) => {
|
|
209
|
+
ast: {
|
|
210
|
+
body: never[];
|
|
211
|
+
comments: never[];
|
|
212
|
+
loc: {
|
|
213
|
+
end: number;
|
|
214
|
+
start: number;
|
|
215
|
+
};
|
|
216
|
+
range: number[];
|
|
217
|
+
tokens: never[];
|
|
218
|
+
type: string;
|
|
219
|
+
};
|
|
220
|
+
scopeManager: null;
|
|
221
|
+
services: {
|
|
222
|
+
isPlain: boolean;
|
|
223
|
+
};
|
|
224
|
+
visitorKeys: {
|
|
225
|
+
Program: never[];
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
204
229
|
/**
|
|
205
230
|
* Combine array and non-array configs into a single array.
|
|
206
231
|
*/
|
|
@@ -234,4 +259,4 @@ declare const GLOB_TESTS: string[];
|
|
|
234
259
|
declare const GLOB_ALL_SRC: string[];
|
|
235
260
|
declare const GLOB_EXCLUDE: string[];
|
|
236
261
|
|
|
237
|
-
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type GetConfigOption, type IgnoresConfig, type JavascriptConfig, type JsoncConfig, type MarkdownConfig, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsOverrides, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierConfig, type PrettierRequiredOptions, type TestConfig, type TomlConfig, type TypeScriptConfig, type VueConfig, type YmlConfig, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
|
262
|
+
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type GetConfigOption, type IgnoresConfig, type JavascriptConfig, type JsoncConfig, type MarkdownConfig, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsOverrides, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierConfig, type PrettierRequiredOptions, type TestConfig, type TomlConfig, type TypeScriptConfig, type VueConfig, type YmlConfig, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ async function comments() {
|
|
|
6
6
|
);
|
|
7
7
|
return [
|
|
8
8
|
{
|
|
9
|
-
name: "eslint
|
|
9
|
+
name: "eslint/eslint-comments/rules",
|
|
10
10
|
plugins: {
|
|
11
11
|
"eslint-comments": pluginComments
|
|
12
12
|
},
|
|
@@ -120,6 +120,26 @@ var ignores = async (options) => {
|
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
// src/utils.ts
|
|
123
|
+
var parserPlain = {
|
|
124
|
+
meta: {
|
|
125
|
+
name: "parser-plain"
|
|
126
|
+
},
|
|
127
|
+
parseForESLint: (code) => ({
|
|
128
|
+
ast: {
|
|
129
|
+
body: [],
|
|
130
|
+
comments: [],
|
|
131
|
+
loc: { end: code.length, start: 0 },
|
|
132
|
+
range: [0, code.length],
|
|
133
|
+
tokens: [],
|
|
134
|
+
type: "Program"
|
|
135
|
+
},
|
|
136
|
+
scopeManager: null,
|
|
137
|
+
services: { isPlain: true },
|
|
138
|
+
visitorKeys: {
|
|
139
|
+
Program: []
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
};
|
|
123
143
|
async function combine(...configs) {
|
|
124
144
|
const resolved = await Promise.all(configs);
|
|
125
145
|
return resolved.flat();
|
|
@@ -131,10 +151,10 @@ async function interopDefault(m) {
|
|
|
131
151
|
|
|
132
152
|
// src/configs/imports.ts
|
|
133
153
|
async function imports() {
|
|
134
|
-
const pluginImport = await interopDefault(import("eslint-plugin-
|
|
154
|
+
const pluginImport = await interopDefault(import("eslint-plugin-import-x"));
|
|
135
155
|
return [
|
|
136
156
|
{
|
|
137
|
-
name: "eslint
|
|
157
|
+
name: "eslint/imports/rules",
|
|
138
158
|
plugins: {
|
|
139
159
|
import: pluginImport
|
|
140
160
|
},
|
|
@@ -145,23 +165,7 @@ async function imports() {
|
|
|
145
165
|
"import/no-named-default": "error",
|
|
146
166
|
"import/no-self-import": "error",
|
|
147
167
|
"import/no-webpack-loader-syntax": "error",
|
|
148
|
-
"import/order":
|
|
149
|
-
"error",
|
|
150
|
-
{
|
|
151
|
-
groups: [
|
|
152
|
-
"builtin",
|
|
153
|
-
"external",
|
|
154
|
-
"internal",
|
|
155
|
-
"parent",
|
|
156
|
-
"sibling",
|
|
157
|
-
"index",
|
|
158
|
-
"object",
|
|
159
|
-
"type"
|
|
160
|
-
],
|
|
161
|
-
pathGroups: [{ group: "internal", pattern: "{{@,~}/,#}**" }],
|
|
162
|
-
pathGroupsExcludedImportTypes: ["type"]
|
|
163
|
-
}
|
|
164
|
-
],
|
|
168
|
+
"import/order": "error",
|
|
165
169
|
"import/newline-after-import": [
|
|
166
170
|
"error",
|
|
167
171
|
{ considerComments: true, count: 1 }
|
|
@@ -181,7 +185,7 @@ var javascript = async (options) => {
|
|
|
181
185
|
);
|
|
182
186
|
return [
|
|
183
187
|
{
|
|
184
|
-
name: "eslint
|
|
188
|
+
name: "eslint/javascript/rules",
|
|
185
189
|
languageOptions: {
|
|
186
190
|
ecmaVersion: 2022,
|
|
187
191
|
globals: {
|
|
@@ -417,7 +421,7 @@ var javascript = async (options) => {
|
|
|
417
421
|
}
|
|
418
422
|
},
|
|
419
423
|
{
|
|
420
|
-
name: "eslint
|
|
424
|
+
name: "eslint/scripts-overrides/disables/cli",
|
|
421
425
|
files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
|
|
422
426
|
rules: {
|
|
423
427
|
"no-console": "off"
|
|
@@ -430,7 +434,7 @@ var javascript = async (options) => {
|
|
|
430
434
|
async function jsdoc() {
|
|
431
435
|
return [
|
|
432
436
|
{
|
|
433
|
-
name: "eslint
|
|
437
|
+
name: "eslint/jsdoc/rules",
|
|
434
438
|
plugins: {
|
|
435
439
|
jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
|
|
436
440
|
},
|
|
@@ -466,13 +470,13 @@ var jsonc = async (options) => {
|
|
|
466
470
|
]);
|
|
467
471
|
return [
|
|
468
472
|
{
|
|
469
|
-
name: "eslint
|
|
473
|
+
name: "eslint/jsonc/setup",
|
|
470
474
|
plugins: {
|
|
471
475
|
jsonc: pluginJsonc
|
|
472
476
|
}
|
|
473
477
|
},
|
|
474
478
|
{
|
|
475
|
-
name: "eslint
|
|
479
|
+
name: "eslint/jsonc/rules",
|
|
476
480
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
477
481
|
languageOptions: {
|
|
478
482
|
parser: parserJsonc
|
|
@@ -536,13 +540,13 @@ var markdown = async (options) => {
|
|
|
536
540
|
]);
|
|
537
541
|
return [
|
|
538
542
|
{
|
|
539
|
-
name: "eslint
|
|
543
|
+
name: "eslint/markdown/setup",
|
|
540
544
|
plugins: {
|
|
541
545
|
mdx: pluginMdx
|
|
542
546
|
}
|
|
543
547
|
},
|
|
544
548
|
{
|
|
545
|
-
name: "eslint
|
|
549
|
+
name: "eslint/markdown/processor",
|
|
546
550
|
files: [GLOB_MARKDOWN, GLOB_MDX],
|
|
547
551
|
languageOptions: {
|
|
548
552
|
ecmaVersion: "latest",
|
|
@@ -555,7 +559,7 @@ var markdown = async (options) => {
|
|
|
555
559
|
}
|
|
556
560
|
},
|
|
557
561
|
{
|
|
558
|
-
name: "eslint
|
|
562
|
+
name: "eslint/markdown/rules",
|
|
559
563
|
files: [
|
|
560
564
|
GLOB_MARKDOWN_CODE,
|
|
561
565
|
...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
@@ -614,7 +618,7 @@ async function node() {
|
|
|
614
618
|
const pluginNode = await interopDefault(import("eslint-plugin-n"));
|
|
615
619
|
return [
|
|
616
620
|
{
|
|
617
|
-
name: "eslint
|
|
621
|
+
name: "eslint/node/rules",
|
|
618
622
|
plugins: {
|
|
619
623
|
n: pluginNode
|
|
620
624
|
},
|
|
@@ -636,7 +640,7 @@ async function node() {
|
|
|
636
640
|
async function sortPackageJson() {
|
|
637
641
|
return [
|
|
638
642
|
{
|
|
639
|
-
name: "eslint
|
|
643
|
+
name: "eslint/sort/package-json",
|
|
640
644
|
files: ["**/package.json"],
|
|
641
645
|
rules: {
|
|
642
646
|
"jsonc/sort-array-values": [
|
|
@@ -716,7 +720,7 @@ async function sortPackageJson() {
|
|
|
716
720
|
async function sortTsconfig() {
|
|
717
721
|
return [
|
|
718
722
|
{
|
|
719
|
-
name: "eslint
|
|
723
|
+
name: "eslint/sort/tsconfig-json",
|
|
720
724
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
721
725
|
rules: {
|
|
722
726
|
"jsonc/sort-keys": [
|
|
@@ -876,13 +880,13 @@ var typescript = async (options) => {
|
|
|
876
880
|
return [
|
|
877
881
|
{
|
|
878
882
|
// Install the plugins without globs, so they can be configured separately.
|
|
879
|
-
name: "eslint
|
|
883
|
+
name: "eslint/typescript/setup",
|
|
880
884
|
plugins: {
|
|
881
885
|
"@typescript-eslint": pluginTs
|
|
882
886
|
}
|
|
883
887
|
},
|
|
884
888
|
{
|
|
885
|
-
name: "eslint
|
|
889
|
+
name: "eslint/typescript/rules",
|
|
886
890
|
files: [GLOB_SRC, ...componentExts.map((ext) => `**/*.${ext}`)],
|
|
887
891
|
languageOptions: {
|
|
888
892
|
parser: parserTs,
|
|
@@ -948,7 +952,7 @@ var typescript = async (options) => {
|
|
|
948
952
|
}
|
|
949
953
|
},
|
|
950
954
|
{
|
|
951
|
-
name: "eslint
|
|
955
|
+
name: "eslint/typescript/dts-overrides",
|
|
952
956
|
files: ["**/*.d.ts"],
|
|
953
957
|
rules: {
|
|
954
958
|
"eslint-comments/no-unlimited-disable": "off",
|
|
@@ -958,15 +962,15 @@ var typescript = async (options) => {
|
|
|
958
962
|
}
|
|
959
963
|
},
|
|
960
964
|
{
|
|
961
|
-
name: "eslint
|
|
965
|
+
name: "eslint/typescript/disables/test",
|
|
962
966
|
files: ["**/*.{test,spec}.ts?(x)"],
|
|
963
967
|
rules: {
|
|
964
968
|
"no-unused-expressions": "off"
|
|
965
969
|
}
|
|
966
970
|
},
|
|
967
971
|
{
|
|
972
|
+
name: "eslint/typescript/disables/cjs",
|
|
968
973
|
files: ["**/*.js", "**/*.cjs"],
|
|
969
|
-
name: "eslint:typescript:javascript-overrides",
|
|
970
974
|
rules: {
|
|
971
975
|
"@typescript-eslint/no-require-imports": "off",
|
|
972
976
|
"@typescript-eslint/no-var-requires": "off"
|
|
@@ -980,7 +984,7 @@ async function unicorn() {
|
|
|
980
984
|
const pluginUnicorn = await interopDefault(import("eslint-plugin-unicorn"));
|
|
981
985
|
return [
|
|
982
986
|
{
|
|
983
|
-
name: "eslint
|
|
987
|
+
name: "eslint/unicorn/rules",
|
|
984
988
|
plugins: {
|
|
985
989
|
unicorn: pluginUnicorn
|
|
986
990
|
},
|
|
@@ -1026,13 +1030,13 @@ var vue = async (options = {}) => {
|
|
|
1026
1030
|
]);
|
|
1027
1031
|
return [
|
|
1028
1032
|
{
|
|
1029
|
-
name: "eslint
|
|
1033
|
+
name: "eslint/vue/setup",
|
|
1030
1034
|
plugins: {
|
|
1031
1035
|
vue: pluginVue
|
|
1032
1036
|
}
|
|
1033
1037
|
},
|
|
1034
1038
|
{
|
|
1035
|
-
name: "eslint
|
|
1039
|
+
name: "eslint/vue/rules",
|
|
1036
1040
|
files: [GLOB_VUE],
|
|
1037
1041
|
languageOptions: {
|
|
1038
1042
|
parser: parserVue,
|
|
@@ -1166,13 +1170,13 @@ var yml = async (options) => {
|
|
|
1166
1170
|
]);
|
|
1167
1171
|
return [
|
|
1168
1172
|
{
|
|
1169
|
-
name: "eslint
|
|
1173
|
+
name: "eslint/yaml/setup",
|
|
1170
1174
|
plugins: {
|
|
1171
1175
|
yml: pluginYml
|
|
1172
1176
|
}
|
|
1173
1177
|
},
|
|
1174
1178
|
{
|
|
1175
|
-
name: "eslint
|
|
1179
|
+
name: "eslint/yaml/rules",
|
|
1176
1180
|
files: [GLOB_YAML],
|
|
1177
1181
|
languageOptions: {
|
|
1178
1182
|
parser: parserYml
|
|
@@ -1203,13 +1207,13 @@ var toml = async (options) => {
|
|
|
1203
1207
|
]);
|
|
1204
1208
|
return [
|
|
1205
1209
|
{
|
|
1206
|
-
name: "eslint
|
|
1210
|
+
name: "eslint/toml/setup",
|
|
1207
1211
|
plugins: {
|
|
1208
1212
|
toml: pluginToml
|
|
1209
1213
|
}
|
|
1210
1214
|
},
|
|
1211
1215
|
{
|
|
1212
|
-
name: "eslint
|
|
1216
|
+
name: "eslint/toml/rules",
|
|
1213
1217
|
files: [GLOB_TOML],
|
|
1214
1218
|
languageOptions: {
|
|
1215
1219
|
parser: parserToml
|
|
@@ -1250,7 +1254,7 @@ var test = async (options) => {
|
|
|
1250
1254
|
]);
|
|
1251
1255
|
return [
|
|
1252
1256
|
{
|
|
1253
|
-
name: "eslint
|
|
1257
|
+
name: "eslint/test/setup",
|
|
1254
1258
|
plugins: {
|
|
1255
1259
|
test: {
|
|
1256
1260
|
...pluginVitest,
|
|
@@ -1263,7 +1267,7 @@ var test = async (options) => {
|
|
|
1263
1267
|
}
|
|
1264
1268
|
},
|
|
1265
1269
|
{
|
|
1266
|
-
name: "eslint
|
|
1270
|
+
name: "eslint/test/rules",
|
|
1267
1271
|
files: GLOB_TESTS,
|
|
1268
1272
|
rules: {
|
|
1269
1273
|
"test/consistent-test-it": [
|
|
@@ -1288,7 +1292,7 @@ async function perfectionist() {
|
|
|
1288
1292
|
);
|
|
1289
1293
|
return [
|
|
1290
1294
|
{
|
|
1291
|
-
name: "eslint
|
|
1295
|
+
name: "eslint/perfectionist/setup",
|
|
1292
1296
|
plugins: {
|
|
1293
1297
|
perfectionist: pluginPerfectionist
|
|
1294
1298
|
}
|
|
@@ -1298,50 +1302,49 @@ async function perfectionist() {
|
|
|
1298
1302
|
|
|
1299
1303
|
// src/configs/prettier.ts
|
|
1300
1304
|
var prettier = async (options) => {
|
|
1301
|
-
const [pluginPrettier, configPrettier
|
|
1305
|
+
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
1302
1306
|
interopDefault(import("eslint-plugin-prettier")),
|
|
1303
1307
|
// @ts-expect-error missing types
|
|
1304
|
-
interopDefault(import("eslint-config-prettier"))
|
|
1305
|
-
interopDefault(import("eslint-parser-plain"))
|
|
1308
|
+
interopDefault(import("eslint-config-prettier"))
|
|
1306
1309
|
]);
|
|
1307
1310
|
const PlainFileRules = [
|
|
1308
1311
|
{
|
|
1309
|
-
name: "eslint
|
|
1312
|
+
name: "eslint/prettier/markdown",
|
|
1310
1313
|
files: [GLOB_MARKDOWN],
|
|
1311
1314
|
parser: "markdown"
|
|
1312
1315
|
},
|
|
1313
1316
|
{
|
|
1314
|
-
name: "eslint
|
|
1317
|
+
name: "eslint/prettier/mdx",
|
|
1315
1318
|
files: [GLOB_MDX],
|
|
1316
1319
|
parser: "mdx"
|
|
1317
1320
|
},
|
|
1318
1321
|
{
|
|
1319
|
-
name: "eslint
|
|
1322
|
+
name: "eslint/prettier/html",
|
|
1320
1323
|
files: ["**/*.html"],
|
|
1321
1324
|
parser: "html"
|
|
1322
1325
|
},
|
|
1323
1326
|
{
|
|
1324
|
-
name: "eslint
|
|
1327
|
+
name: "eslint/prettier/css",
|
|
1325
1328
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
1326
1329
|
parser: "css"
|
|
1327
1330
|
},
|
|
1328
1331
|
{
|
|
1329
|
-
name: "eslint
|
|
1332
|
+
name: "eslint/prettier/scss",
|
|
1330
1333
|
files: [GLOB_SCSS],
|
|
1331
1334
|
parser: "scss"
|
|
1332
1335
|
},
|
|
1333
1336
|
{
|
|
1334
|
-
name: "eslint
|
|
1337
|
+
name: "eslint/prettier/less",
|
|
1335
1338
|
files: [GLOB_LESS],
|
|
1336
1339
|
parser: "less"
|
|
1337
1340
|
},
|
|
1338
1341
|
{
|
|
1339
|
-
name: "eslint
|
|
1342
|
+
name: "eslint/prettier/yaml",
|
|
1340
1343
|
files: [GLOB_YAML],
|
|
1341
1344
|
parser: "yaml"
|
|
1342
1345
|
},
|
|
1343
1346
|
{
|
|
1344
|
-
name: "eslint
|
|
1347
|
+
name: "eslint/prettier/graphql",
|
|
1345
1348
|
files: ["**/*.graphql"],
|
|
1346
1349
|
parser: "graphql"
|
|
1347
1350
|
}
|
|
@@ -1364,13 +1367,13 @@ var prettier = async (options) => {
|
|
|
1364
1367
|
}));
|
|
1365
1368
|
return [
|
|
1366
1369
|
{
|
|
1367
|
-
name: "eslint
|
|
1370
|
+
name: "eslint/prettier/setup",
|
|
1368
1371
|
plugins: {
|
|
1369
1372
|
prettier: pluginPrettier
|
|
1370
1373
|
}
|
|
1371
1374
|
},
|
|
1372
1375
|
{
|
|
1373
|
-
name: "eslint
|
|
1376
|
+
name: "eslint/prettier/rules",
|
|
1374
1377
|
ignores: [GLOB_TOML],
|
|
1375
1378
|
rules: {
|
|
1376
1379
|
...configPrettier.rules,
|
|
@@ -1393,13 +1396,13 @@ async function next() {
|
|
|
1393
1396
|
const pluginNext = await interopDefault(import("@next/eslint-plugin-next"));
|
|
1394
1397
|
return [
|
|
1395
1398
|
{
|
|
1396
|
-
name: "eslint
|
|
1399
|
+
name: "eslint/next/setup",
|
|
1397
1400
|
plugins: {
|
|
1398
1401
|
"@next/next": pluginNext
|
|
1399
1402
|
}
|
|
1400
1403
|
},
|
|
1401
1404
|
{
|
|
1402
|
-
name: "eslint
|
|
1405
|
+
name: "eslint/next/rules",
|
|
1403
1406
|
files: [GLOB_TSX, GLOB_JSX],
|
|
1404
1407
|
languageOptions: {
|
|
1405
1408
|
parserOptions: {
|
|
@@ -1423,22 +1426,27 @@ async function next() {
|
|
|
1423
1426
|
}
|
|
1424
1427
|
var react = async (options) => {
|
|
1425
1428
|
const { next: enableNext = false, overrides = {} } = options;
|
|
1426
|
-
const [pluginReact, pluginReactHooks] = await Promise.all(
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1429
|
+
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
1430
|
+
[
|
|
1431
|
+
// @ts-expect-error missing types
|
|
1432
|
+
interopDefault(import("eslint-plugin-react")),
|
|
1433
|
+
// @ts-expect-error missing types
|
|
1434
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1435
|
+
// @ts-expect-error missing types
|
|
1436
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1437
|
+
]
|
|
1438
|
+
);
|
|
1432
1439
|
const _react = [
|
|
1433
1440
|
{
|
|
1434
|
-
name: "eslint
|
|
1441
|
+
name: "eslint/react/setup",
|
|
1435
1442
|
plugins: {
|
|
1436
1443
|
"react": pluginReact,
|
|
1437
|
-
"react-hooks": pluginReactHooks
|
|
1444
|
+
"react-hooks": pluginReactHooks,
|
|
1445
|
+
"react-refresh": pluginReactRefresh
|
|
1438
1446
|
}
|
|
1439
1447
|
},
|
|
1440
1448
|
{
|
|
1441
|
-
name: "eslint
|
|
1449
|
+
name: "eslint/react/rules",
|
|
1442
1450
|
files: [GLOB_TSX, GLOB_JSX],
|
|
1443
1451
|
languageOptions: {
|
|
1444
1452
|
parserOptions: {
|
|
@@ -1456,6 +1464,8 @@ var react = async (options) => {
|
|
|
1456
1464
|
rules: {
|
|
1457
1465
|
...pluginReact.configs.recommended.rules,
|
|
1458
1466
|
...pluginReactHooks.configs.recommended.rules,
|
|
1467
|
+
// React Refresh
|
|
1468
|
+
"react-refresh/only-export-components": "warn",
|
|
1459
1469
|
"jsx-quotes": ["error", "prefer-double"],
|
|
1460
1470
|
"react/react-in-jsx-scope": "off",
|
|
1461
1471
|
"react/jsx-indent": [1, 2],
|
|
@@ -1479,7 +1489,7 @@ async function tailwindcss() {
|
|
|
1479
1489
|
);
|
|
1480
1490
|
return [
|
|
1481
1491
|
{
|
|
1482
|
-
name: "eslint
|
|
1492
|
+
name: "eslint/tailwindcss/rules",
|
|
1483
1493
|
plugins: {
|
|
1484
1494
|
tailwindcss: pluginTailwindcss
|
|
1485
1495
|
},
|
|
@@ -1608,6 +1618,7 @@ export {
|
|
|
1608
1618
|
jsonc,
|
|
1609
1619
|
markdown,
|
|
1610
1620
|
node,
|
|
1621
|
+
parserPlain,
|
|
1611
1622
|
perfectionist,
|
|
1612
1623
|
prettier,
|
|
1613
1624
|
sortPackageJson,
|
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.1.1",
|
|
5
5
|
"packageManager": "pnpm@8.15.6",
|
|
6
6
|
"description": "Brendan Dash's ESLint config",
|
|
7
7
|
"author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
|
|
@@ -24,7 +24,13 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"eslint": ">=8.40.0"
|
|
27
|
+
"eslint": ">=8.40.0",
|
|
28
|
+
"eslint-plugin-tailwindcss": "^3.15.1"
|
|
29
|
+
},
|
|
30
|
+
"peerDependenciesMeta": {
|
|
31
|
+
"eslint-plugin-tailwindcss": {
|
|
32
|
+
"optional": true
|
|
33
|
+
}
|
|
28
34
|
},
|
|
29
35
|
"dependencies": {
|
|
30
36
|
"@next/eslint-plugin-next": "^14.1.4",
|
|
@@ -33,9 +39,8 @@
|
|
|
33
39
|
"eslint-config-prettier": "^9.1.0",
|
|
34
40
|
"eslint-define-config": "^2.1.0",
|
|
35
41
|
"eslint-mdx": "^3.1.5",
|
|
36
|
-
"eslint-parser-plain": "^0.1.0",
|
|
37
42
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
38
|
-
"eslint-plugin-
|
|
43
|
+
"eslint-plugin-import-x": "^0.5.0",
|
|
39
44
|
"eslint-plugin-jsdoc": "^48.2.2",
|
|
40
45
|
"eslint-plugin-jsonc": "^2.15.0",
|
|
41
46
|
"eslint-plugin-markdown": "^4.0.1",
|
|
@@ -46,7 +51,7 @@
|
|
|
46
51
|
"eslint-plugin-prettier": "^5.1.3",
|
|
47
52
|
"eslint-plugin-react": "^7.34.1",
|
|
48
53
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
49
|
-
"eslint-plugin-
|
|
54
|
+
"eslint-plugin-react-refresh": "^0.4.6",
|
|
50
55
|
"eslint-plugin-toml": "^0.11.0",
|
|
51
56
|
"eslint-plugin-unicorn": "^52.0.0",
|
|
52
57
|
"eslint-plugin-unused-imports": "^3.1.0",
|
|
@@ -67,6 +72,7 @@
|
|
|
67
72
|
"bumpp": "^9.4.0",
|
|
68
73
|
"eslint": "^8.57.0",
|
|
69
74
|
"eslint-flat-config-viewer": "^0.1.20",
|
|
75
|
+
"eslint-plugin-tailwindcss": "^3.15.1",
|
|
70
76
|
"execa": "^8.0.1",
|
|
71
77
|
"fast-glob": "^3.3.2",
|
|
72
78
|
"fs-extra": "^11.2.0",
|