@debbl/eslint-config 3.5.0 → 3.6.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/dist/index.cjs +235 -206
- package/dist/index.d.cts +48 -48
- package/dist/index.d.ts +48 -48
- package/dist/index.js +235 -206
- package/package.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -248,7 +248,6 @@ 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/order": "error",
|
|
252
251
|
"import/newline-after-import": [
|
|
253
252
|
"error",
|
|
254
253
|
{ considerComments: true, count: 1 }
|
|
@@ -388,9 +387,6 @@ var javascript = async (options) => {
|
|
|
388
387
|
],
|
|
389
388
|
"no-restricted-syntax": [
|
|
390
389
|
"error",
|
|
391
|
-
"DebuggerStatement",
|
|
392
|
-
"LabeledStatement",
|
|
393
|
-
"WithStatement",
|
|
394
390
|
"TSEnumDeclaration[const=true]",
|
|
395
391
|
"TSExportAssignment"
|
|
396
392
|
],
|
|
@@ -718,6 +714,152 @@ async function node() {
|
|
|
718
714
|
];
|
|
719
715
|
}
|
|
720
716
|
|
|
717
|
+
// src/configs/perfectionist.ts
|
|
718
|
+
async function perfectionist() {
|
|
719
|
+
const pluginPerfectionist = await interopDefault(
|
|
720
|
+
import("eslint-plugin-perfectionist")
|
|
721
|
+
);
|
|
722
|
+
return [
|
|
723
|
+
{
|
|
724
|
+
name: "eslint/perfectionist/setup",
|
|
725
|
+
plugins: {
|
|
726
|
+
perfectionist: pluginPerfectionist
|
|
727
|
+
},
|
|
728
|
+
rules: {
|
|
729
|
+
"perfectionist/sort-exports": [
|
|
730
|
+
"error",
|
|
731
|
+
{ order: "asc", type: "natural" }
|
|
732
|
+
],
|
|
733
|
+
"perfectionist/sort-imports": [
|
|
734
|
+
"error",
|
|
735
|
+
{
|
|
736
|
+
groups: [
|
|
737
|
+
"builtin",
|
|
738
|
+
"external",
|
|
739
|
+
"type",
|
|
740
|
+
["internal", "internal-type"],
|
|
741
|
+
["parent", "sibling", "index"],
|
|
742
|
+
["parent-type", "sibling-type", "index-type"],
|
|
743
|
+
"side-effect",
|
|
744
|
+
"object",
|
|
745
|
+
"unknown"
|
|
746
|
+
],
|
|
747
|
+
newlinesBetween: "ignore",
|
|
748
|
+
order: "asc",
|
|
749
|
+
type: "natural"
|
|
750
|
+
}
|
|
751
|
+
],
|
|
752
|
+
"perfectionist/sort-named-exports": [
|
|
753
|
+
"error",
|
|
754
|
+
{ order: "asc", type: "natural" }
|
|
755
|
+
],
|
|
756
|
+
"perfectionist/sort-named-imports": [
|
|
757
|
+
"error",
|
|
758
|
+
{ order: "asc", type: "natural" }
|
|
759
|
+
]
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
];
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
// src/configs/prettier.ts
|
|
766
|
+
var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
767
|
+
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
768
|
+
interopDefault(import("eslint-plugin-prettier")),
|
|
769
|
+
// @ts-expect-error missing types
|
|
770
|
+
interopDefault(import("eslint-config-prettier"))
|
|
771
|
+
]);
|
|
772
|
+
const PlainFileRules = [
|
|
773
|
+
{
|
|
774
|
+
name: "eslint/prettier/markdown",
|
|
775
|
+
files: [GLOB_MARKDOWN],
|
|
776
|
+
parser: "markdown"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
name: "eslint/prettier/mdx",
|
|
780
|
+
files: [GLOB_MDX],
|
|
781
|
+
parser: "mdx"
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
name: "eslint/prettier/html",
|
|
785
|
+
files: ["**/*.html"],
|
|
786
|
+
parser: "html"
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
name: "eslint/prettier/css",
|
|
790
|
+
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
791
|
+
parser: "css"
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
name: "eslint/prettier/scss",
|
|
795
|
+
files: [GLOB_SCSS],
|
|
796
|
+
parser: "scss"
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
name: "eslint/prettier/less",
|
|
800
|
+
files: [GLOB_LESS],
|
|
801
|
+
parser: "less"
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
name: "eslint/prettier/yaml",
|
|
805
|
+
files: [GLOB_YAML],
|
|
806
|
+
parser: "yaml"
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
name: "eslint/prettier/graphql",
|
|
810
|
+
files: ["**/*.graphql"],
|
|
811
|
+
parser: "graphql"
|
|
812
|
+
}
|
|
813
|
+
].map((rule) => ({
|
|
814
|
+
name: rule.name,
|
|
815
|
+
files: rule.files,
|
|
816
|
+
languageOptions: {
|
|
817
|
+
parser: parserPlain
|
|
818
|
+
},
|
|
819
|
+
rules: {
|
|
820
|
+
"prettier/prettier": [
|
|
821
|
+
"warn",
|
|
822
|
+
{
|
|
823
|
+
parser: rule.parser,
|
|
824
|
+
quoteProps: "consistent",
|
|
825
|
+
...options
|
|
826
|
+
}
|
|
827
|
+
]
|
|
828
|
+
}
|
|
829
|
+
}));
|
|
830
|
+
return [
|
|
831
|
+
{
|
|
832
|
+
name: "eslint/prettier/setup",
|
|
833
|
+
plugins: {
|
|
834
|
+
prettier: pluginPrettier
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
name: "eslint/prettier/rules",
|
|
839
|
+
ignores: [GLOB_TOML],
|
|
840
|
+
rules: {
|
|
841
|
+
// disable rules with prettier conflicts
|
|
842
|
+
...configPrettier.rules,
|
|
843
|
+
// eslint-plugin-prettier recommended rules
|
|
844
|
+
...{
|
|
845
|
+
"prettier/prettier": "error",
|
|
846
|
+
"arrow-body-style": "off",
|
|
847
|
+
"prefer-arrow-callback": "off"
|
|
848
|
+
},
|
|
849
|
+
"prettier/prettier": [
|
|
850
|
+
"warn",
|
|
851
|
+
{
|
|
852
|
+
plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
|
|
853
|
+
quoteProps: "consistent",
|
|
854
|
+
...options
|
|
855
|
+
}
|
|
856
|
+
]
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
...PlainFileRules
|
|
860
|
+
];
|
|
861
|
+
};
|
|
862
|
+
|
|
721
863
|
// src/configs/sort.ts
|
|
722
864
|
async function sortPackageJson() {
|
|
723
865
|
return [
|
|
@@ -925,6 +1067,95 @@ async function sortTsconfig() {
|
|
|
925
1067
|
];
|
|
926
1068
|
}
|
|
927
1069
|
|
|
1070
|
+
// src/configs/test.ts
|
|
1071
|
+
var test = async (options) => {
|
|
1072
|
+
const { overrides = {} } = options;
|
|
1073
|
+
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
1074
|
+
interopDefault(import("eslint-plugin-vitest")),
|
|
1075
|
+
// @ts-expect-error missing types
|
|
1076
|
+
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
1077
|
+
]);
|
|
1078
|
+
return [
|
|
1079
|
+
{
|
|
1080
|
+
name: "eslint/test/setup",
|
|
1081
|
+
plugins: {
|
|
1082
|
+
test: {
|
|
1083
|
+
...pluginVitest,
|
|
1084
|
+
rules: {
|
|
1085
|
+
...pluginVitest.rules,
|
|
1086
|
+
// extend `test/no-only-tests` rule
|
|
1087
|
+
...pluginNoOnlyTests.rules
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
name: "eslint/test/rules",
|
|
1094
|
+
files: GLOB_TESTS,
|
|
1095
|
+
rules: {
|
|
1096
|
+
"node/prefer-global/process": "off",
|
|
1097
|
+
"test/consistent-test-it": [
|
|
1098
|
+
"error",
|
|
1099
|
+
{ fn: "it", withinDescribe: "it" }
|
|
1100
|
+
],
|
|
1101
|
+
"test/no-identical-title": "error",
|
|
1102
|
+
"test/no-import-node-test": "error",
|
|
1103
|
+
"test/no-only-tests": "error",
|
|
1104
|
+
"test/prefer-hooks-in-order": "error",
|
|
1105
|
+
"test/prefer-lowercase-title": "error",
|
|
1106
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1107
|
+
...overrides
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
];
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1113
|
+
// src/configs/toml.ts
|
|
1114
|
+
var toml = async (options) => {
|
|
1115
|
+
const { overrides = {} } = options;
|
|
1116
|
+
const [pluginToml, parserToml] = await Promise.all([
|
|
1117
|
+
interopDefault(import("eslint-plugin-toml")),
|
|
1118
|
+
interopDefault(import("toml-eslint-parser"))
|
|
1119
|
+
]);
|
|
1120
|
+
return [
|
|
1121
|
+
{
|
|
1122
|
+
name: "eslint/toml/setup",
|
|
1123
|
+
plugins: {
|
|
1124
|
+
toml: pluginToml
|
|
1125
|
+
}
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
name: "eslint/toml/rules",
|
|
1129
|
+
files: [GLOB_TOML],
|
|
1130
|
+
languageOptions: {
|
|
1131
|
+
parser: parserToml
|
|
1132
|
+
},
|
|
1133
|
+
rules: {
|
|
1134
|
+
"toml/comma-style": "error",
|
|
1135
|
+
"toml/keys-order": "error",
|
|
1136
|
+
"toml/no-space-dots": "error",
|
|
1137
|
+
"toml/no-unreadable-number-separator": "error",
|
|
1138
|
+
"toml/precision-of-fractional-seconds": "error",
|
|
1139
|
+
"toml/precision-of-integer": "error",
|
|
1140
|
+
"toml/tables-order": "error",
|
|
1141
|
+
"toml/vue-custom-block/no-parsing-error": "error",
|
|
1142
|
+
"toml/array-bracket-newline": "error",
|
|
1143
|
+
"toml/array-bracket-spacing": "error",
|
|
1144
|
+
"toml/array-element-newline": "error",
|
|
1145
|
+
"toml/indent": ["error", 2],
|
|
1146
|
+
"toml/inline-table-curly-spacing": "error",
|
|
1147
|
+
"toml/key-spacing": "error",
|
|
1148
|
+
"toml/padding-line-between-pairs": "error",
|
|
1149
|
+
"toml/padding-line-between-tables": "error",
|
|
1150
|
+
"toml/quoted-keys": "error",
|
|
1151
|
+
"toml/spaced-comment": "error",
|
|
1152
|
+
"toml/table-bracket-spacing": "error",
|
|
1153
|
+
...overrides
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
];
|
|
1157
|
+
};
|
|
1158
|
+
|
|
928
1159
|
// src/configs/typescript.ts
|
|
929
1160
|
var import_node_process = __toESM(require("process"), 1);
|
|
930
1161
|
var typeAwareRules = {
|
|
@@ -1294,208 +1525,6 @@ var yml = async (options) => {
|
|
|
1294
1525
|
];
|
|
1295
1526
|
};
|
|
1296
1527
|
|
|
1297
|
-
// src/configs/toml.ts
|
|
1298
|
-
var toml = async (options) => {
|
|
1299
|
-
const { overrides = {} } = options;
|
|
1300
|
-
const [pluginToml, parserToml] = await Promise.all([
|
|
1301
|
-
interopDefault(import("eslint-plugin-toml")),
|
|
1302
|
-
interopDefault(import("toml-eslint-parser"))
|
|
1303
|
-
]);
|
|
1304
|
-
return [
|
|
1305
|
-
{
|
|
1306
|
-
name: "eslint/toml/setup",
|
|
1307
|
-
plugins: {
|
|
1308
|
-
toml: pluginToml
|
|
1309
|
-
}
|
|
1310
|
-
},
|
|
1311
|
-
{
|
|
1312
|
-
name: "eslint/toml/rules",
|
|
1313
|
-
files: [GLOB_TOML],
|
|
1314
|
-
languageOptions: {
|
|
1315
|
-
parser: parserToml
|
|
1316
|
-
},
|
|
1317
|
-
rules: {
|
|
1318
|
-
"toml/comma-style": "error",
|
|
1319
|
-
"toml/keys-order": "error",
|
|
1320
|
-
"toml/no-space-dots": "error",
|
|
1321
|
-
"toml/no-unreadable-number-separator": "error",
|
|
1322
|
-
"toml/precision-of-fractional-seconds": "error",
|
|
1323
|
-
"toml/precision-of-integer": "error",
|
|
1324
|
-
"toml/tables-order": "error",
|
|
1325
|
-
"toml/vue-custom-block/no-parsing-error": "error",
|
|
1326
|
-
"toml/array-bracket-newline": "error",
|
|
1327
|
-
"toml/array-bracket-spacing": "error",
|
|
1328
|
-
"toml/array-element-newline": "error",
|
|
1329
|
-
"toml/indent": ["error", 2],
|
|
1330
|
-
"toml/inline-table-curly-spacing": "error",
|
|
1331
|
-
"toml/key-spacing": "error",
|
|
1332
|
-
"toml/padding-line-between-pairs": "error",
|
|
1333
|
-
"toml/padding-line-between-tables": "error",
|
|
1334
|
-
"toml/quoted-keys": "error",
|
|
1335
|
-
"toml/spaced-comment": "error",
|
|
1336
|
-
"toml/table-bracket-spacing": "error",
|
|
1337
|
-
...overrides
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1340
|
-
];
|
|
1341
|
-
};
|
|
1342
|
-
|
|
1343
|
-
// src/configs/test.ts
|
|
1344
|
-
var test = async (options) => {
|
|
1345
|
-
const { overrides = {} } = options;
|
|
1346
|
-
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
1347
|
-
interopDefault(import("eslint-plugin-vitest")),
|
|
1348
|
-
// @ts-expect-error missing types
|
|
1349
|
-
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
1350
|
-
]);
|
|
1351
|
-
return [
|
|
1352
|
-
{
|
|
1353
|
-
name: "eslint/test/setup",
|
|
1354
|
-
plugins: {
|
|
1355
|
-
test: {
|
|
1356
|
-
...pluginVitest,
|
|
1357
|
-
rules: {
|
|
1358
|
-
...pluginVitest.rules,
|
|
1359
|
-
// extend `test/no-only-tests` rule
|
|
1360
|
-
...pluginNoOnlyTests.rules
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
},
|
|
1365
|
-
{
|
|
1366
|
-
name: "eslint/test/rules",
|
|
1367
|
-
files: GLOB_TESTS,
|
|
1368
|
-
rules: {
|
|
1369
|
-
"node/prefer-global/process": "off",
|
|
1370
|
-
"test/consistent-test-it": [
|
|
1371
|
-
"error",
|
|
1372
|
-
{ fn: "it", withinDescribe: "it" }
|
|
1373
|
-
],
|
|
1374
|
-
"test/no-identical-title": "error",
|
|
1375
|
-
"test/no-import-node-test": "error",
|
|
1376
|
-
"test/no-only-tests": "error",
|
|
1377
|
-
"test/prefer-hooks-in-order": "error",
|
|
1378
|
-
"test/prefer-lowercase-title": "error",
|
|
1379
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1380
|
-
...overrides
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
];
|
|
1384
|
-
};
|
|
1385
|
-
|
|
1386
|
-
// src/configs/perfectionist.ts
|
|
1387
|
-
async function perfectionist() {
|
|
1388
|
-
const pluginPerfectionist = await interopDefault(
|
|
1389
|
-
import("eslint-plugin-perfectionist")
|
|
1390
|
-
);
|
|
1391
|
-
return [
|
|
1392
|
-
{
|
|
1393
|
-
name: "eslint/perfectionist/setup",
|
|
1394
|
-
plugins: {
|
|
1395
|
-
perfectionist: pluginPerfectionist
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
];
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
// src/configs/prettier.ts
|
|
1402
|
-
var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
1403
|
-
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
1404
|
-
interopDefault(import("eslint-plugin-prettier")),
|
|
1405
|
-
// @ts-expect-error missing types
|
|
1406
|
-
interopDefault(import("eslint-config-prettier"))
|
|
1407
|
-
]);
|
|
1408
|
-
const PlainFileRules = [
|
|
1409
|
-
{
|
|
1410
|
-
name: "eslint/prettier/markdown",
|
|
1411
|
-
files: [GLOB_MARKDOWN],
|
|
1412
|
-
parser: "markdown"
|
|
1413
|
-
},
|
|
1414
|
-
{
|
|
1415
|
-
name: "eslint/prettier/mdx",
|
|
1416
|
-
files: [GLOB_MDX],
|
|
1417
|
-
parser: "mdx"
|
|
1418
|
-
},
|
|
1419
|
-
{
|
|
1420
|
-
name: "eslint/prettier/html",
|
|
1421
|
-
files: ["**/*.html"],
|
|
1422
|
-
parser: "html"
|
|
1423
|
-
},
|
|
1424
|
-
{
|
|
1425
|
-
name: "eslint/prettier/css",
|
|
1426
|
-
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
1427
|
-
parser: "css"
|
|
1428
|
-
},
|
|
1429
|
-
{
|
|
1430
|
-
name: "eslint/prettier/scss",
|
|
1431
|
-
files: [GLOB_SCSS],
|
|
1432
|
-
parser: "scss"
|
|
1433
|
-
},
|
|
1434
|
-
{
|
|
1435
|
-
name: "eslint/prettier/less",
|
|
1436
|
-
files: [GLOB_LESS],
|
|
1437
|
-
parser: "less"
|
|
1438
|
-
},
|
|
1439
|
-
{
|
|
1440
|
-
name: "eslint/prettier/yaml",
|
|
1441
|
-
files: [GLOB_YAML],
|
|
1442
|
-
parser: "yaml"
|
|
1443
|
-
},
|
|
1444
|
-
{
|
|
1445
|
-
name: "eslint/prettier/graphql",
|
|
1446
|
-
files: ["**/*.graphql"],
|
|
1447
|
-
parser: "graphql"
|
|
1448
|
-
}
|
|
1449
|
-
].map((rule) => ({
|
|
1450
|
-
name: rule.name,
|
|
1451
|
-
files: rule.files,
|
|
1452
|
-
languageOptions: {
|
|
1453
|
-
parser: parserPlain
|
|
1454
|
-
},
|
|
1455
|
-
rules: {
|
|
1456
|
-
"prettier/prettier": [
|
|
1457
|
-
"warn",
|
|
1458
|
-
{
|
|
1459
|
-
parser: rule.parser,
|
|
1460
|
-
quoteProps: "consistent",
|
|
1461
|
-
...options
|
|
1462
|
-
}
|
|
1463
|
-
]
|
|
1464
|
-
}
|
|
1465
|
-
}));
|
|
1466
|
-
return [
|
|
1467
|
-
{
|
|
1468
|
-
name: "eslint/prettier/setup",
|
|
1469
|
-
plugins: {
|
|
1470
|
-
prettier: pluginPrettier
|
|
1471
|
-
}
|
|
1472
|
-
},
|
|
1473
|
-
{
|
|
1474
|
-
name: "eslint/prettier/rules",
|
|
1475
|
-
ignores: [GLOB_TOML],
|
|
1476
|
-
rules: {
|
|
1477
|
-
// disable rules with prettier conflicts
|
|
1478
|
-
...configPrettier.rules,
|
|
1479
|
-
// eslint-plugin-prettier recommended rules
|
|
1480
|
-
...{
|
|
1481
|
-
"prettier/prettier": "error",
|
|
1482
|
-
"arrow-body-style": "off",
|
|
1483
|
-
"prefer-arrow-callback": "off"
|
|
1484
|
-
},
|
|
1485
|
-
"prettier/prettier": [
|
|
1486
|
-
"warn",
|
|
1487
|
-
{
|
|
1488
|
-
plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
|
|
1489
|
-
quoteProps: "consistent",
|
|
1490
|
-
...options
|
|
1491
|
-
}
|
|
1492
|
-
]
|
|
1493
|
-
}
|
|
1494
|
-
},
|
|
1495
|
-
...PlainFileRules
|
|
1496
|
-
];
|
|
1497
|
-
};
|
|
1498
|
-
|
|
1499
1528
|
// src/configs/react.ts
|
|
1500
1529
|
async function next() {
|
|
1501
1530
|
const pluginNext = await interopDefault(import("@next/eslint-plugin-next"));
|
package/dist/index.d.cts
CHANGED
|
@@ -2,11 +2,6 @@ import { ParserOptions } from '@typescript-eslint/parser';
|
|
|
2
2
|
import { Linter } from 'eslint';
|
|
3
3
|
import { RequiredOptions } from 'prettier';
|
|
4
4
|
|
|
5
|
-
type ReactConfig = (options: {
|
|
6
|
-
next?: boolean;
|
|
7
|
-
compiler?: boolean;
|
|
8
|
-
} & OptionsOverrides) => ReturnType<ConfigFn>;
|
|
9
|
-
|
|
10
5
|
declare function comments(): Promise<ConfigItem[]>;
|
|
11
6
|
|
|
12
7
|
type IgnoresConfig = (options: {
|
|
@@ -34,6 +29,19 @@ declare const markdown: MarkdownConfig;
|
|
|
34
29
|
|
|
35
30
|
declare function node(): Promise<ConfigItem[]>;
|
|
36
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Perfectionist plugin for props and items sorting.
|
|
34
|
+
*
|
|
35
|
+
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
36
|
+
*/
|
|
37
|
+
declare function perfectionist(): Promise<ConfigItem[]>;
|
|
38
|
+
|
|
39
|
+
type PrettierRequiredOptions = Partial<RequiredOptions>;
|
|
40
|
+
type PrettierConfig = ({ options, }: PrettierRequiredOptions & {
|
|
41
|
+
tailwindcss?: boolean;
|
|
42
|
+
}) => Promise<ConfigItem[]>;
|
|
43
|
+
declare const prettier: PrettierConfig;
|
|
44
|
+
|
|
37
45
|
/**
|
|
38
46
|
* Sort package.json
|
|
39
47
|
*
|
|
@@ -47,6 +55,12 @@ declare function sortPackageJson(): Promise<ConfigItem[]>;
|
|
|
47
55
|
*/
|
|
48
56
|
declare function sortTsconfig(): Promise<ConfigItem[]>;
|
|
49
57
|
|
|
58
|
+
type TestConfig = ConfigFn;
|
|
59
|
+
declare const test: TestConfig;
|
|
60
|
+
|
|
61
|
+
type TomlConfig = ConfigFn;
|
|
62
|
+
declare const toml: TomlConfig;
|
|
63
|
+
|
|
50
64
|
type TypeScriptConfig = (options?: OptionsComponentExts & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsOverrides & {
|
|
51
65
|
enableSolid?: boolean;
|
|
52
66
|
}) => ReturnType<ConfigFn>;
|
|
@@ -60,24 +74,10 @@ declare const vue: VueConfig;
|
|
|
60
74
|
type YmlConfig = (options: OptionsOverrides) => ReturnType<ConfigFn>;
|
|
61
75
|
declare const yml: YmlConfig;
|
|
62
76
|
|
|
63
|
-
type
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
declare const test: TestConfig;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Optional sort-keys plugin
|
|
71
|
-
*
|
|
72
|
-
* @see https://github.com/azat-io/eslint-plugin-perfectionist/
|
|
73
|
-
*/
|
|
74
|
-
declare function perfectionist(): Promise<ConfigItem[]>;
|
|
75
|
-
|
|
76
|
-
type PrettierRequiredOptions = Partial<RequiredOptions>;
|
|
77
|
-
type PrettierConfig = ({ options, }: PrettierRequiredOptions & {
|
|
78
|
-
tailwindcss?: boolean;
|
|
79
|
-
}) => Promise<ConfigItem[]>;
|
|
80
|
-
declare const prettier: PrettierConfig;
|
|
77
|
+
type ReactConfig = (options: {
|
|
78
|
+
next?: boolean;
|
|
79
|
+
compiler?: boolean;
|
|
80
|
+
} & OptionsOverrides) => ReturnType<ConfigFn>;
|
|
81
81
|
|
|
82
82
|
type Awaitable<T> = T | Promise<T>;
|
|
83
83
|
type GetConfigOption<T extends (...args: any) => any> = Parameters<T>[0];
|
|
@@ -213,6 +213,31 @@ declare function defineConfig(options?: OptionsConfig): Promise<ConfigItem[]>;
|
|
|
213
213
|
*/
|
|
214
214
|
declare const config: typeof defineConfig;
|
|
215
215
|
|
|
216
|
+
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
217
|
+
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
218
|
+
declare const GLOB_JS = "**/*.?([cm])js";
|
|
219
|
+
declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
220
|
+
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
221
|
+
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
222
|
+
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
223
|
+
declare const GLOB_CSS = "**/*.css";
|
|
224
|
+
declare const GLOB_POSTCSS = "**/*.{p,post}css";
|
|
225
|
+
declare const GLOB_LESS = "**/*.less";
|
|
226
|
+
declare const GLOB_SCSS = "**/*.scss";
|
|
227
|
+
declare const GLOB_JSON = "**/*.json";
|
|
228
|
+
declare const GLOB_JSON5 = "**/*.json5";
|
|
229
|
+
declare const GLOB_JSONC = "**/*.jsonc";
|
|
230
|
+
declare const GLOB_MARKDOWN = "**/*.md";
|
|
231
|
+
declare const GLOB_MDX = "**/*.mdx";
|
|
232
|
+
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
233
|
+
declare const GLOB_VUE = "**/*.vue";
|
|
234
|
+
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
235
|
+
declare const GLOB_TOML = "**/*.toml";
|
|
236
|
+
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
237
|
+
declare const GLOB_TESTS: string[];
|
|
238
|
+
declare const GLOB_ALL_SRC: string[];
|
|
239
|
+
declare const GLOB_EXCLUDE: string[];
|
|
240
|
+
|
|
216
241
|
declare const parserPlain: {
|
|
217
242
|
meta: {
|
|
218
243
|
name: string;
|
|
@@ -246,29 +271,4 @@ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
|
246
271
|
default: infer U;
|
|
247
272
|
} ? U : T>;
|
|
248
273
|
|
|
249
|
-
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
250
|
-
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
251
|
-
declare const GLOB_JS = "**/*.?([cm])js";
|
|
252
|
-
declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
253
|
-
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
254
|
-
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
255
|
-
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
256
|
-
declare const GLOB_CSS = "**/*.css";
|
|
257
|
-
declare const GLOB_POSTCSS = "**/*.{p,post}css";
|
|
258
|
-
declare const GLOB_LESS = "**/*.less";
|
|
259
|
-
declare const GLOB_SCSS = "**/*.scss";
|
|
260
|
-
declare const GLOB_JSON = "**/*.json";
|
|
261
|
-
declare const GLOB_JSON5 = "**/*.json5";
|
|
262
|
-
declare const GLOB_JSONC = "**/*.jsonc";
|
|
263
|
-
declare const GLOB_MARKDOWN = "**/*.md";
|
|
264
|
-
declare const GLOB_MDX = "**/*.mdx";
|
|
265
|
-
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
266
|
-
declare const GLOB_VUE = "**/*.vue";
|
|
267
|
-
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
268
|
-
declare const GLOB_TOML = "**/*.toml";
|
|
269
|
-
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
270
|
-
declare const GLOB_TESTS: string[];
|
|
271
|
-
declare const GLOB_ALL_SRC: string[];
|
|
272
|
-
declare const GLOB_EXCLUDE: string[];
|
|
273
|
-
|
|
274
274
|
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, defineConfig, 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
|
@@ -2,11 +2,6 @@ import { ParserOptions } from '@typescript-eslint/parser';
|
|
|
2
2
|
import { Linter } from 'eslint';
|
|
3
3
|
import { RequiredOptions } from 'prettier';
|
|
4
4
|
|
|
5
|
-
type ReactConfig = (options: {
|
|
6
|
-
next?: boolean;
|
|
7
|
-
compiler?: boolean;
|
|
8
|
-
} & OptionsOverrides) => ReturnType<ConfigFn>;
|
|
9
|
-
|
|
10
5
|
declare function comments(): Promise<ConfigItem[]>;
|
|
11
6
|
|
|
12
7
|
type IgnoresConfig = (options: {
|
|
@@ -34,6 +29,19 @@ declare const markdown: MarkdownConfig;
|
|
|
34
29
|
|
|
35
30
|
declare function node(): Promise<ConfigItem[]>;
|
|
36
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Perfectionist plugin for props and items sorting.
|
|
34
|
+
*
|
|
35
|
+
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
36
|
+
*/
|
|
37
|
+
declare function perfectionist(): Promise<ConfigItem[]>;
|
|
38
|
+
|
|
39
|
+
type PrettierRequiredOptions = Partial<RequiredOptions>;
|
|
40
|
+
type PrettierConfig = ({ options, }: PrettierRequiredOptions & {
|
|
41
|
+
tailwindcss?: boolean;
|
|
42
|
+
}) => Promise<ConfigItem[]>;
|
|
43
|
+
declare const prettier: PrettierConfig;
|
|
44
|
+
|
|
37
45
|
/**
|
|
38
46
|
* Sort package.json
|
|
39
47
|
*
|
|
@@ -47,6 +55,12 @@ declare function sortPackageJson(): Promise<ConfigItem[]>;
|
|
|
47
55
|
*/
|
|
48
56
|
declare function sortTsconfig(): Promise<ConfigItem[]>;
|
|
49
57
|
|
|
58
|
+
type TestConfig = ConfigFn;
|
|
59
|
+
declare const test: TestConfig;
|
|
60
|
+
|
|
61
|
+
type TomlConfig = ConfigFn;
|
|
62
|
+
declare const toml: TomlConfig;
|
|
63
|
+
|
|
50
64
|
type TypeScriptConfig = (options?: OptionsComponentExts & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsOverrides & {
|
|
51
65
|
enableSolid?: boolean;
|
|
52
66
|
}) => ReturnType<ConfigFn>;
|
|
@@ -60,24 +74,10 @@ declare const vue: VueConfig;
|
|
|
60
74
|
type YmlConfig = (options: OptionsOverrides) => ReturnType<ConfigFn>;
|
|
61
75
|
declare const yml: YmlConfig;
|
|
62
76
|
|
|
63
|
-
type
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
declare const test: TestConfig;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Optional sort-keys plugin
|
|
71
|
-
*
|
|
72
|
-
* @see https://github.com/azat-io/eslint-plugin-perfectionist/
|
|
73
|
-
*/
|
|
74
|
-
declare function perfectionist(): Promise<ConfigItem[]>;
|
|
75
|
-
|
|
76
|
-
type PrettierRequiredOptions = Partial<RequiredOptions>;
|
|
77
|
-
type PrettierConfig = ({ options, }: PrettierRequiredOptions & {
|
|
78
|
-
tailwindcss?: boolean;
|
|
79
|
-
}) => Promise<ConfigItem[]>;
|
|
80
|
-
declare const prettier: PrettierConfig;
|
|
77
|
+
type ReactConfig = (options: {
|
|
78
|
+
next?: boolean;
|
|
79
|
+
compiler?: boolean;
|
|
80
|
+
} & OptionsOverrides) => ReturnType<ConfigFn>;
|
|
81
81
|
|
|
82
82
|
type Awaitable<T> = T | Promise<T>;
|
|
83
83
|
type GetConfigOption<T extends (...args: any) => any> = Parameters<T>[0];
|
|
@@ -213,6 +213,31 @@ declare function defineConfig(options?: OptionsConfig): Promise<ConfigItem[]>;
|
|
|
213
213
|
*/
|
|
214
214
|
declare const config: typeof defineConfig;
|
|
215
215
|
|
|
216
|
+
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
217
|
+
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
218
|
+
declare const GLOB_JS = "**/*.?([cm])js";
|
|
219
|
+
declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
220
|
+
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
221
|
+
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
222
|
+
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
223
|
+
declare const GLOB_CSS = "**/*.css";
|
|
224
|
+
declare const GLOB_POSTCSS = "**/*.{p,post}css";
|
|
225
|
+
declare const GLOB_LESS = "**/*.less";
|
|
226
|
+
declare const GLOB_SCSS = "**/*.scss";
|
|
227
|
+
declare const GLOB_JSON = "**/*.json";
|
|
228
|
+
declare const GLOB_JSON5 = "**/*.json5";
|
|
229
|
+
declare const GLOB_JSONC = "**/*.jsonc";
|
|
230
|
+
declare const GLOB_MARKDOWN = "**/*.md";
|
|
231
|
+
declare const GLOB_MDX = "**/*.mdx";
|
|
232
|
+
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
233
|
+
declare const GLOB_VUE = "**/*.vue";
|
|
234
|
+
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
235
|
+
declare const GLOB_TOML = "**/*.toml";
|
|
236
|
+
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
237
|
+
declare const GLOB_TESTS: string[];
|
|
238
|
+
declare const GLOB_ALL_SRC: string[];
|
|
239
|
+
declare const GLOB_EXCLUDE: string[];
|
|
240
|
+
|
|
216
241
|
declare const parserPlain: {
|
|
217
242
|
meta: {
|
|
218
243
|
name: string;
|
|
@@ -246,29 +271,4 @@ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
|
246
271
|
default: infer U;
|
|
247
272
|
} ? U : T>;
|
|
248
273
|
|
|
249
|
-
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
250
|
-
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
251
|
-
declare const GLOB_JS = "**/*.?([cm])js";
|
|
252
|
-
declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
253
|
-
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
254
|
-
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
255
|
-
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
256
|
-
declare const GLOB_CSS = "**/*.css";
|
|
257
|
-
declare const GLOB_POSTCSS = "**/*.{p,post}css";
|
|
258
|
-
declare const GLOB_LESS = "**/*.less";
|
|
259
|
-
declare const GLOB_SCSS = "**/*.scss";
|
|
260
|
-
declare const GLOB_JSON = "**/*.json";
|
|
261
|
-
declare const GLOB_JSON5 = "**/*.json5";
|
|
262
|
-
declare const GLOB_JSONC = "**/*.jsonc";
|
|
263
|
-
declare const GLOB_MARKDOWN = "**/*.md";
|
|
264
|
-
declare const GLOB_MDX = "**/*.mdx";
|
|
265
|
-
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
266
|
-
declare const GLOB_VUE = "**/*.vue";
|
|
267
|
-
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
268
|
-
declare const GLOB_TOML = "**/*.toml";
|
|
269
|
-
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
270
|
-
declare const GLOB_TESTS: string[];
|
|
271
|
-
declare const GLOB_ALL_SRC: string[];
|
|
272
|
-
declare const GLOB_EXCLUDE: string[];
|
|
273
|
-
|
|
274
274
|
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, defineConfig, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -165,7 +165,6 @@ 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/order": "error",
|
|
169
168
|
"import/newline-after-import": [
|
|
170
169
|
"error",
|
|
171
170
|
{ considerComments: true, count: 1 }
|
|
@@ -305,9 +304,6 @@ var javascript = async (options) => {
|
|
|
305
304
|
],
|
|
306
305
|
"no-restricted-syntax": [
|
|
307
306
|
"error",
|
|
308
|
-
"DebuggerStatement",
|
|
309
|
-
"LabeledStatement",
|
|
310
|
-
"WithStatement",
|
|
311
307
|
"TSEnumDeclaration[const=true]",
|
|
312
308
|
"TSExportAssignment"
|
|
313
309
|
],
|
|
@@ -635,6 +631,152 @@ async function node() {
|
|
|
635
631
|
];
|
|
636
632
|
}
|
|
637
633
|
|
|
634
|
+
// src/configs/perfectionist.ts
|
|
635
|
+
async function perfectionist() {
|
|
636
|
+
const pluginPerfectionist = await interopDefault(
|
|
637
|
+
import("eslint-plugin-perfectionist")
|
|
638
|
+
);
|
|
639
|
+
return [
|
|
640
|
+
{
|
|
641
|
+
name: "eslint/perfectionist/setup",
|
|
642
|
+
plugins: {
|
|
643
|
+
perfectionist: pluginPerfectionist
|
|
644
|
+
},
|
|
645
|
+
rules: {
|
|
646
|
+
"perfectionist/sort-exports": [
|
|
647
|
+
"error",
|
|
648
|
+
{ order: "asc", type: "natural" }
|
|
649
|
+
],
|
|
650
|
+
"perfectionist/sort-imports": [
|
|
651
|
+
"error",
|
|
652
|
+
{
|
|
653
|
+
groups: [
|
|
654
|
+
"builtin",
|
|
655
|
+
"external",
|
|
656
|
+
"type",
|
|
657
|
+
["internal", "internal-type"],
|
|
658
|
+
["parent", "sibling", "index"],
|
|
659
|
+
["parent-type", "sibling-type", "index-type"],
|
|
660
|
+
"side-effect",
|
|
661
|
+
"object",
|
|
662
|
+
"unknown"
|
|
663
|
+
],
|
|
664
|
+
newlinesBetween: "ignore",
|
|
665
|
+
order: "asc",
|
|
666
|
+
type: "natural"
|
|
667
|
+
}
|
|
668
|
+
],
|
|
669
|
+
"perfectionist/sort-named-exports": [
|
|
670
|
+
"error",
|
|
671
|
+
{ order: "asc", type: "natural" }
|
|
672
|
+
],
|
|
673
|
+
"perfectionist/sort-named-imports": [
|
|
674
|
+
"error",
|
|
675
|
+
{ order: "asc", type: "natural" }
|
|
676
|
+
]
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
];
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// src/configs/prettier.ts
|
|
683
|
+
var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
684
|
+
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
685
|
+
interopDefault(import("eslint-plugin-prettier")),
|
|
686
|
+
// @ts-expect-error missing types
|
|
687
|
+
interopDefault(import("eslint-config-prettier"))
|
|
688
|
+
]);
|
|
689
|
+
const PlainFileRules = [
|
|
690
|
+
{
|
|
691
|
+
name: "eslint/prettier/markdown",
|
|
692
|
+
files: [GLOB_MARKDOWN],
|
|
693
|
+
parser: "markdown"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
name: "eslint/prettier/mdx",
|
|
697
|
+
files: [GLOB_MDX],
|
|
698
|
+
parser: "mdx"
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
name: "eslint/prettier/html",
|
|
702
|
+
files: ["**/*.html"],
|
|
703
|
+
parser: "html"
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
name: "eslint/prettier/css",
|
|
707
|
+
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
708
|
+
parser: "css"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
name: "eslint/prettier/scss",
|
|
712
|
+
files: [GLOB_SCSS],
|
|
713
|
+
parser: "scss"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
name: "eslint/prettier/less",
|
|
717
|
+
files: [GLOB_LESS],
|
|
718
|
+
parser: "less"
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
name: "eslint/prettier/yaml",
|
|
722
|
+
files: [GLOB_YAML],
|
|
723
|
+
parser: "yaml"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
name: "eslint/prettier/graphql",
|
|
727
|
+
files: ["**/*.graphql"],
|
|
728
|
+
parser: "graphql"
|
|
729
|
+
}
|
|
730
|
+
].map((rule) => ({
|
|
731
|
+
name: rule.name,
|
|
732
|
+
files: rule.files,
|
|
733
|
+
languageOptions: {
|
|
734
|
+
parser: parserPlain
|
|
735
|
+
},
|
|
736
|
+
rules: {
|
|
737
|
+
"prettier/prettier": [
|
|
738
|
+
"warn",
|
|
739
|
+
{
|
|
740
|
+
parser: rule.parser,
|
|
741
|
+
quoteProps: "consistent",
|
|
742
|
+
...options
|
|
743
|
+
}
|
|
744
|
+
]
|
|
745
|
+
}
|
|
746
|
+
}));
|
|
747
|
+
return [
|
|
748
|
+
{
|
|
749
|
+
name: "eslint/prettier/setup",
|
|
750
|
+
plugins: {
|
|
751
|
+
prettier: pluginPrettier
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
name: "eslint/prettier/rules",
|
|
756
|
+
ignores: [GLOB_TOML],
|
|
757
|
+
rules: {
|
|
758
|
+
// disable rules with prettier conflicts
|
|
759
|
+
...configPrettier.rules,
|
|
760
|
+
// eslint-plugin-prettier recommended rules
|
|
761
|
+
...{
|
|
762
|
+
"prettier/prettier": "error",
|
|
763
|
+
"arrow-body-style": "off",
|
|
764
|
+
"prefer-arrow-callback": "off"
|
|
765
|
+
},
|
|
766
|
+
"prettier/prettier": [
|
|
767
|
+
"warn",
|
|
768
|
+
{
|
|
769
|
+
plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
|
|
770
|
+
quoteProps: "consistent",
|
|
771
|
+
...options
|
|
772
|
+
}
|
|
773
|
+
]
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
...PlainFileRules
|
|
777
|
+
];
|
|
778
|
+
};
|
|
779
|
+
|
|
638
780
|
// src/configs/sort.ts
|
|
639
781
|
async function sortPackageJson() {
|
|
640
782
|
return [
|
|
@@ -842,6 +984,95 @@ async function sortTsconfig() {
|
|
|
842
984
|
];
|
|
843
985
|
}
|
|
844
986
|
|
|
987
|
+
// src/configs/test.ts
|
|
988
|
+
var test = async (options) => {
|
|
989
|
+
const { overrides = {} } = options;
|
|
990
|
+
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
991
|
+
interopDefault(import("eslint-plugin-vitest")),
|
|
992
|
+
// @ts-expect-error missing types
|
|
993
|
+
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
994
|
+
]);
|
|
995
|
+
return [
|
|
996
|
+
{
|
|
997
|
+
name: "eslint/test/setup",
|
|
998
|
+
plugins: {
|
|
999
|
+
test: {
|
|
1000
|
+
...pluginVitest,
|
|
1001
|
+
rules: {
|
|
1002
|
+
...pluginVitest.rules,
|
|
1003
|
+
// extend `test/no-only-tests` rule
|
|
1004
|
+
...pluginNoOnlyTests.rules
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
name: "eslint/test/rules",
|
|
1011
|
+
files: GLOB_TESTS,
|
|
1012
|
+
rules: {
|
|
1013
|
+
"node/prefer-global/process": "off",
|
|
1014
|
+
"test/consistent-test-it": [
|
|
1015
|
+
"error",
|
|
1016
|
+
{ fn: "it", withinDescribe: "it" }
|
|
1017
|
+
],
|
|
1018
|
+
"test/no-identical-title": "error",
|
|
1019
|
+
"test/no-import-node-test": "error",
|
|
1020
|
+
"test/no-only-tests": "error",
|
|
1021
|
+
"test/prefer-hooks-in-order": "error",
|
|
1022
|
+
"test/prefer-lowercase-title": "error",
|
|
1023
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1024
|
+
...overrides
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
];
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
// src/configs/toml.ts
|
|
1031
|
+
var toml = async (options) => {
|
|
1032
|
+
const { overrides = {} } = options;
|
|
1033
|
+
const [pluginToml, parserToml] = await Promise.all([
|
|
1034
|
+
interopDefault(import("eslint-plugin-toml")),
|
|
1035
|
+
interopDefault(import("toml-eslint-parser"))
|
|
1036
|
+
]);
|
|
1037
|
+
return [
|
|
1038
|
+
{
|
|
1039
|
+
name: "eslint/toml/setup",
|
|
1040
|
+
plugins: {
|
|
1041
|
+
toml: pluginToml
|
|
1042
|
+
}
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
name: "eslint/toml/rules",
|
|
1046
|
+
files: [GLOB_TOML],
|
|
1047
|
+
languageOptions: {
|
|
1048
|
+
parser: parserToml
|
|
1049
|
+
},
|
|
1050
|
+
rules: {
|
|
1051
|
+
"toml/comma-style": "error",
|
|
1052
|
+
"toml/keys-order": "error",
|
|
1053
|
+
"toml/no-space-dots": "error",
|
|
1054
|
+
"toml/no-unreadable-number-separator": "error",
|
|
1055
|
+
"toml/precision-of-fractional-seconds": "error",
|
|
1056
|
+
"toml/precision-of-integer": "error",
|
|
1057
|
+
"toml/tables-order": "error",
|
|
1058
|
+
"toml/vue-custom-block/no-parsing-error": "error",
|
|
1059
|
+
"toml/array-bracket-newline": "error",
|
|
1060
|
+
"toml/array-bracket-spacing": "error",
|
|
1061
|
+
"toml/array-element-newline": "error",
|
|
1062
|
+
"toml/indent": ["error", 2],
|
|
1063
|
+
"toml/inline-table-curly-spacing": "error",
|
|
1064
|
+
"toml/key-spacing": "error",
|
|
1065
|
+
"toml/padding-line-between-pairs": "error",
|
|
1066
|
+
"toml/padding-line-between-tables": "error",
|
|
1067
|
+
"toml/quoted-keys": "error",
|
|
1068
|
+
"toml/spaced-comment": "error",
|
|
1069
|
+
"toml/table-bracket-spacing": "error",
|
|
1070
|
+
...overrides
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
];
|
|
1074
|
+
};
|
|
1075
|
+
|
|
845
1076
|
// src/configs/typescript.ts
|
|
846
1077
|
import process2 from "process";
|
|
847
1078
|
var typeAwareRules = {
|
|
@@ -1211,208 +1442,6 @@ var yml = async (options) => {
|
|
|
1211
1442
|
];
|
|
1212
1443
|
};
|
|
1213
1444
|
|
|
1214
|
-
// src/configs/toml.ts
|
|
1215
|
-
var toml = async (options) => {
|
|
1216
|
-
const { overrides = {} } = options;
|
|
1217
|
-
const [pluginToml, parserToml] = await Promise.all([
|
|
1218
|
-
interopDefault(import("eslint-plugin-toml")),
|
|
1219
|
-
interopDefault(import("toml-eslint-parser"))
|
|
1220
|
-
]);
|
|
1221
|
-
return [
|
|
1222
|
-
{
|
|
1223
|
-
name: "eslint/toml/setup",
|
|
1224
|
-
plugins: {
|
|
1225
|
-
toml: pluginToml
|
|
1226
|
-
}
|
|
1227
|
-
},
|
|
1228
|
-
{
|
|
1229
|
-
name: "eslint/toml/rules",
|
|
1230
|
-
files: [GLOB_TOML],
|
|
1231
|
-
languageOptions: {
|
|
1232
|
-
parser: parserToml
|
|
1233
|
-
},
|
|
1234
|
-
rules: {
|
|
1235
|
-
"toml/comma-style": "error",
|
|
1236
|
-
"toml/keys-order": "error",
|
|
1237
|
-
"toml/no-space-dots": "error",
|
|
1238
|
-
"toml/no-unreadable-number-separator": "error",
|
|
1239
|
-
"toml/precision-of-fractional-seconds": "error",
|
|
1240
|
-
"toml/precision-of-integer": "error",
|
|
1241
|
-
"toml/tables-order": "error",
|
|
1242
|
-
"toml/vue-custom-block/no-parsing-error": "error",
|
|
1243
|
-
"toml/array-bracket-newline": "error",
|
|
1244
|
-
"toml/array-bracket-spacing": "error",
|
|
1245
|
-
"toml/array-element-newline": "error",
|
|
1246
|
-
"toml/indent": ["error", 2],
|
|
1247
|
-
"toml/inline-table-curly-spacing": "error",
|
|
1248
|
-
"toml/key-spacing": "error",
|
|
1249
|
-
"toml/padding-line-between-pairs": "error",
|
|
1250
|
-
"toml/padding-line-between-tables": "error",
|
|
1251
|
-
"toml/quoted-keys": "error",
|
|
1252
|
-
"toml/spaced-comment": "error",
|
|
1253
|
-
"toml/table-bracket-spacing": "error",
|
|
1254
|
-
...overrides
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
];
|
|
1258
|
-
};
|
|
1259
|
-
|
|
1260
|
-
// src/configs/test.ts
|
|
1261
|
-
var test = async (options) => {
|
|
1262
|
-
const { overrides = {} } = options;
|
|
1263
|
-
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
1264
|
-
interopDefault(import("eslint-plugin-vitest")),
|
|
1265
|
-
// @ts-expect-error missing types
|
|
1266
|
-
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
1267
|
-
]);
|
|
1268
|
-
return [
|
|
1269
|
-
{
|
|
1270
|
-
name: "eslint/test/setup",
|
|
1271
|
-
plugins: {
|
|
1272
|
-
test: {
|
|
1273
|
-
...pluginVitest,
|
|
1274
|
-
rules: {
|
|
1275
|
-
...pluginVitest.rules,
|
|
1276
|
-
// extend `test/no-only-tests` rule
|
|
1277
|
-
...pluginNoOnlyTests.rules
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
},
|
|
1282
|
-
{
|
|
1283
|
-
name: "eslint/test/rules",
|
|
1284
|
-
files: GLOB_TESTS,
|
|
1285
|
-
rules: {
|
|
1286
|
-
"node/prefer-global/process": "off",
|
|
1287
|
-
"test/consistent-test-it": [
|
|
1288
|
-
"error",
|
|
1289
|
-
{ fn: "it", withinDescribe: "it" }
|
|
1290
|
-
],
|
|
1291
|
-
"test/no-identical-title": "error",
|
|
1292
|
-
"test/no-import-node-test": "error",
|
|
1293
|
-
"test/no-only-tests": "error",
|
|
1294
|
-
"test/prefer-hooks-in-order": "error",
|
|
1295
|
-
"test/prefer-lowercase-title": "error",
|
|
1296
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1297
|
-
...overrides
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
];
|
|
1301
|
-
};
|
|
1302
|
-
|
|
1303
|
-
// src/configs/perfectionist.ts
|
|
1304
|
-
async function perfectionist() {
|
|
1305
|
-
const pluginPerfectionist = await interopDefault(
|
|
1306
|
-
import("eslint-plugin-perfectionist")
|
|
1307
|
-
);
|
|
1308
|
-
return [
|
|
1309
|
-
{
|
|
1310
|
-
name: "eslint/perfectionist/setup",
|
|
1311
|
-
plugins: {
|
|
1312
|
-
perfectionist: pluginPerfectionist
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
];
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
// src/configs/prettier.ts
|
|
1319
|
-
var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
1320
|
-
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
1321
|
-
interopDefault(import("eslint-plugin-prettier")),
|
|
1322
|
-
// @ts-expect-error missing types
|
|
1323
|
-
interopDefault(import("eslint-config-prettier"))
|
|
1324
|
-
]);
|
|
1325
|
-
const PlainFileRules = [
|
|
1326
|
-
{
|
|
1327
|
-
name: "eslint/prettier/markdown",
|
|
1328
|
-
files: [GLOB_MARKDOWN],
|
|
1329
|
-
parser: "markdown"
|
|
1330
|
-
},
|
|
1331
|
-
{
|
|
1332
|
-
name: "eslint/prettier/mdx",
|
|
1333
|
-
files: [GLOB_MDX],
|
|
1334
|
-
parser: "mdx"
|
|
1335
|
-
},
|
|
1336
|
-
{
|
|
1337
|
-
name: "eslint/prettier/html",
|
|
1338
|
-
files: ["**/*.html"],
|
|
1339
|
-
parser: "html"
|
|
1340
|
-
},
|
|
1341
|
-
{
|
|
1342
|
-
name: "eslint/prettier/css",
|
|
1343
|
-
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
1344
|
-
parser: "css"
|
|
1345
|
-
},
|
|
1346
|
-
{
|
|
1347
|
-
name: "eslint/prettier/scss",
|
|
1348
|
-
files: [GLOB_SCSS],
|
|
1349
|
-
parser: "scss"
|
|
1350
|
-
},
|
|
1351
|
-
{
|
|
1352
|
-
name: "eslint/prettier/less",
|
|
1353
|
-
files: [GLOB_LESS],
|
|
1354
|
-
parser: "less"
|
|
1355
|
-
},
|
|
1356
|
-
{
|
|
1357
|
-
name: "eslint/prettier/yaml",
|
|
1358
|
-
files: [GLOB_YAML],
|
|
1359
|
-
parser: "yaml"
|
|
1360
|
-
},
|
|
1361
|
-
{
|
|
1362
|
-
name: "eslint/prettier/graphql",
|
|
1363
|
-
files: ["**/*.graphql"],
|
|
1364
|
-
parser: "graphql"
|
|
1365
|
-
}
|
|
1366
|
-
].map((rule) => ({
|
|
1367
|
-
name: rule.name,
|
|
1368
|
-
files: rule.files,
|
|
1369
|
-
languageOptions: {
|
|
1370
|
-
parser: parserPlain
|
|
1371
|
-
},
|
|
1372
|
-
rules: {
|
|
1373
|
-
"prettier/prettier": [
|
|
1374
|
-
"warn",
|
|
1375
|
-
{
|
|
1376
|
-
parser: rule.parser,
|
|
1377
|
-
quoteProps: "consistent",
|
|
1378
|
-
...options
|
|
1379
|
-
}
|
|
1380
|
-
]
|
|
1381
|
-
}
|
|
1382
|
-
}));
|
|
1383
|
-
return [
|
|
1384
|
-
{
|
|
1385
|
-
name: "eslint/prettier/setup",
|
|
1386
|
-
plugins: {
|
|
1387
|
-
prettier: pluginPrettier
|
|
1388
|
-
}
|
|
1389
|
-
},
|
|
1390
|
-
{
|
|
1391
|
-
name: "eslint/prettier/rules",
|
|
1392
|
-
ignores: [GLOB_TOML],
|
|
1393
|
-
rules: {
|
|
1394
|
-
// disable rules with prettier conflicts
|
|
1395
|
-
...configPrettier.rules,
|
|
1396
|
-
// eslint-plugin-prettier recommended rules
|
|
1397
|
-
...{
|
|
1398
|
-
"prettier/prettier": "error",
|
|
1399
|
-
"arrow-body-style": "off",
|
|
1400
|
-
"prefer-arrow-callback": "off"
|
|
1401
|
-
},
|
|
1402
|
-
"prettier/prettier": [
|
|
1403
|
-
"warn",
|
|
1404
|
-
{
|
|
1405
|
-
plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
|
|
1406
|
-
quoteProps: "consistent",
|
|
1407
|
-
...options
|
|
1408
|
-
}
|
|
1409
|
-
]
|
|
1410
|
-
}
|
|
1411
|
-
},
|
|
1412
|
-
...PlainFileRules
|
|
1413
|
-
];
|
|
1414
|
-
};
|
|
1415
|
-
|
|
1416
1445
|
// src/configs/react.ts
|
|
1417
1446
|
async function next() {
|
|
1418
1447
|
const pluginNext = await interopDefault(import("@next/eslint-plugin-next"));
|
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.6.0",
|
|
5
5
|
"description": "Brendan Dash's ESLint config",
|
|
6
6
|
"author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -27,31 +27,31 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@next/eslint-plugin-next": "15.0.0-rc.0",
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
31
|
-
"@typescript-eslint/parser": "^8.
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "^8.4.0",
|
|
31
|
+
"@typescript-eslint/parser": "^8.4.0",
|
|
32
32
|
"eslint-config-prettier": "^9.1.0",
|
|
33
33
|
"eslint-mdx": "^3.1.5",
|
|
34
34
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
35
|
-
"eslint-plugin-import-x": "^4.
|
|
35
|
+
"eslint-plugin-import-x": "^4.2.1",
|
|
36
36
|
"eslint-plugin-jsdoc": "^50.2.2",
|
|
37
37
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
38
38
|
"eslint-plugin-markdown": "^5.1.0",
|
|
39
39
|
"eslint-plugin-mdx": "^3.1.5",
|
|
40
40
|
"eslint-plugin-n": "^17.10.2",
|
|
41
41
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
42
|
-
"eslint-plugin-perfectionist": "^3.
|
|
42
|
+
"eslint-plugin-perfectionist": "^3.5.0",
|
|
43
43
|
"eslint-plugin-prettier": "^5.2.1",
|
|
44
|
-
"eslint-plugin-react": "^7.35.
|
|
44
|
+
"eslint-plugin-react": "^7.35.2",
|
|
45
45
|
"eslint-plugin-react-compiler": "0.0.0-experimental-b8a7b48-20240830",
|
|
46
46
|
"eslint-plugin-react-hooks": "0.0.0-experimental-e56f4ae3-20240830",
|
|
47
47
|
"eslint-plugin-react-refresh": "^0.4.11",
|
|
48
|
-
"eslint-plugin-solid": "^0.14.
|
|
48
|
+
"eslint-plugin-solid": "^0.14.3",
|
|
49
49
|
"eslint-plugin-tailwindcss": "^3.17.4",
|
|
50
50
|
"eslint-plugin-toml": "^0.11.1",
|
|
51
51
|
"eslint-plugin-unicorn": "^55.0.0",
|
|
52
52
|
"eslint-plugin-unused-imports": "^4.1.3",
|
|
53
53
|
"eslint-plugin-vitest": "^0.5.4",
|
|
54
|
-
"eslint-plugin-vue": "^9.
|
|
54
|
+
"eslint-plugin-vue": "^9.28.0",
|
|
55
55
|
"eslint-plugin-yml": "^1.14.0",
|
|
56
56
|
"globals": "^15.9.0",
|
|
57
57
|
"jsonc-eslint-parser": "^2.4.0",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@eslint/config-inspector": "^0.5.4",
|
|
66
66
|
"@types/eslint": "^9.6.1",
|
|
67
|
-
"@types/node": "^22.5.
|
|
67
|
+
"@types/node": "^22.5.4",
|
|
68
68
|
"@types/react": "^18.3.5",
|
|
69
69
|
"bumpp": "^9.5.2",
|
|
70
|
-
"eslint": "^9.
|
|
70
|
+
"eslint": "^9.10.0",
|
|
71
71
|
"execa": "^9.3.1",
|
|
72
72
|
"fast-glob": "^3.3.2",
|
|
73
73
|
"fs-extra": "^11.2.0",
|