@debbl/eslint-config 3.5.0 → 3.6.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 +244 -221
- package/dist/index.d.cts +48 -48
- package/dist/index.d.ts +48 -48
- package/dist/index.js +244 -221
- package/package.json +22 -23
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
|
],
|
|
@@ -470,16 +466,6 @@ var javascript = async (options) => {
|
|
|
470
466
|
"prefer-rest-params": "error",
|
|
471
467
|
"prefer-spread": "error",
|
|
472
468
|
"prefer-template": "error",
|
|
473
|
-
"sort-imports": [
|
|
474
|
-
"error",
|
|
475
|
-
{
|
|
476
|
-
allowSeparatedGroups: false,
|
|
477
|
-
ignoreCase: false,
|
|
478
|
-
ignoreDeclarationSort: true,
|
|
479
|
-
ignoreMemberSort: false,
|
|
480
|
-
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
481
|
-
}
|
|
482
|
-
],
|
|
483
469
|
"symbol-description": "error",
|
|
484
470
|
"unicode-bom": ["error", "never"],
|
|
485
471
|
"unused-imports/no-unused-imports": "warn",
|
|
@@ -616,15 +602,16 @@ var jsonc = async (options) => {
|
|
|
616
602
|
// src/configs/markdown.ts
|
|
617
603
|
var markdown = async (options) => {
|
|
618
604
|
const { componentExts = [], overrides = {} } = options;
|
|
619
|
-
const [pluginMdx,
|
|
605
|
+
const [pluginMdx, pluginMarkdown] = await Promise.all([
|
|
620
606
|
interopDefault(import("eslint-plugin-mdx")),
|
|
621
|
-
interopDefault(import("eslint
|
|
607
|
+
interopDefault(import("@eslint/markdown"))
|
|
622
608
|
]);
|
|
623
609
|
return [
|
|
624
610
|
{
|
|
625
611
|
name: "eslint/markdown/setup",
|
|
626
612
|
plugins: {
|
|
627
|
-
mdx: pluginMdx
|
|
613
|
+
mdx: pluginMdx,
|
|
614
|
+
markdown: pluginMarkdown
|
|
628
615
|
}
|
|
629
616
|
},
|
|
630
617
|
{
|
|
@@ -632,7 +619,7 @@ var markdown = async (options) => {
|
|
|
632
619
|
files: [GLOB_MARKDOWN, GLOB_MDX],
|
|
633
620
|
languageOptions: {
|
|
634
621
|
ecmaVersion: "latest",
|
|
635
|
-
parser:
|
|
622
|
+
parser: parserPlain,
|
|
636
623
|
sourceType: "module"
|
|
637
624
|
},
|
|
638
625
|
processor: "mdx/remark",
|
|
@@ -718,6 +705,152 @@ async function node() {
|
|
|
718
705
|
];
|
|
719
706
|
}
|
|
720
707
|
|
|
708
|
+
// src/configs/perfectionist.ts
|
|
709
|
+
async function perfectionist() {
|
|
710
|
+
const pluginPerfectionist = await interopDefault(
|
|
711
|
+
import("eslint-plugin-perfectionist")
|
|
712
|
+
);
|
|
713
|
+
return [
|
|
714
|
+
{
|
|
715
|
+
name: "eslint/perfectionist/setup",
|
|
716
|
+
plugins: {
|
|
717
|
+
perfectionist: pluginPerfectionist
|
|
718
|
+
},
|
|
719
|
+
rules: {
|
|
720
|
+
"perfectionist/sort-exports": [
|
|
721
|
+
"error",
|
|
722
|
+
{ order: "asc", type: "natural" }
|
|
723
|
+
],
|
|
724
|
+
"perfectionist/sort-imports": [
|
|
725
|
+
"error",
|
|
726
|
+
{
|
|
727
|
+
groups: [
|
|
728
|
+
"builtin",
|
|
729
|
+
"external",
|
|
730
|
+
"type",
|
|
731
|
+
["internal", "internal-type"],
|
|
732
|
+
["parent", "sibling", "index"],
|
|
733
|
+
["parent-type", "sibling-type", "index-type"],
|
|
734
|
+
"side-effect",
|
|
735
|
+
"object",
|
|
736
|
+
"unknown"
|
|
737
|
+
],
|
|
738
|
+
newlinesBetween: "ignore",
|
|
739
|
+
order: "asc",
|
|
740
|
+
type: "natural"
|
|
741
|
+
}
|
|
742
|
+
],
|
|
743
|
+
"perfectionist/sort-named-exports": [
|
|
744
|
+
"error",
|
|
745
|
+
{ order: "asc", type: "natural" }
|
|
746
|
+
],
|
|
747
|
+
"perfectionist/sort-named-imports": [
|
|
748
|
+
"error",
|
|
749
|
+
{ order: "asc", type: "natural" }
|
|
750
|
+
]
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
];
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// src/configs/prettier.ts
|
|
757
|
+
var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
758
|
+
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
759
|
+
interopDefault(import("eslint-plugin-prettier")),
|
|
760
|
+
// @ts-expect-error missing types
|
|
761
|
+
interopDefault(import("eslint-config-prettier"))
|
|
762
|
+
]);
|
|
763
|
+
const PlainFileRules = [
|
|
764
|
+
{
|
|
765
|
+
name: "eslint/prettier/markdown",
|
|
766
|
+
files: [GLOB_MARKDOWN],
|
|
767
|
+
parser: "markdown"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
name: "eslint/prettier/mdx",
|
|
771
|
+
files: [GLOB_MDX],
|
|
772
|
+
parser: "mdx"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
name: "eslint/prettier/html",
|
|
776
|
+
files: ["**/*.html"],
|
|
777
|
+
parser: "html"
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
name: "eslint/prettier/css",
|
|
781
|
+
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
782
|
+
parser: "css"
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
name: "eslint/prettier/scss",
|
|
786
|
+
files: [GLOB_SCSS],
|
|
787
|
+
parser: "scss"
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
name: "eslint/prettier/less",
|
|
791
|
+
files: [GLOB_LESS],
|
|
792
|
+
parser: "less"
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
name: "eslint/prettier/yaml",
|
|
796
|
+
files: [GLOB_YAML],
|
|
797
|
+
parser: "yaml"
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
name: "eslint/prettier/graphql",
|
|
801
|
+
files: ["**/*.graphql"],
|
|
802
|
+
parser: "graphql"
|
|
803
|
+
}
|
|
804
|
+
].map((rule) => ({
|
|
805
|
+
name: rule.name,
|
|
806
|
+
files: rule.files,
|
|
807
|
+
languageOptions: {
|
|
808
|
+
parser: parserPlain
|
|
809
|
+
},
|
|
810
|
+
rules: {
|
|
811
|
+
"prettier/prettier": [
|
|
812
|
+
"warn",
|
|
813
|
+
{
|
|
814
|
+
parser: rule.parser,
|
|
815
|
+
quoteProps: "consistent",
|
|
816
|
+
...options
|
|
817
|
+
}
|
|
818
|
+
]
|
|
819
|
+
}
|
|
820
|
+
}));
|
|
821
|
+
return [
|
|
822
|
+
{
|
|
823
|
+
name: "eslint/prettier/setup",
|
|
824
|
+
plugins: {
|
|
825
|
+
prettier: pluginPrettier
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
name: "eslint/prettier/rules",
|
|
830
|
+
ignores: [GLOB_TOML],
|
|
831
|
+
rules: {
|
|
832
|
+
// disable rules with prettier conflicts
|
|
833
|
+
...configPrettier.rules,
|
|
834
|
+
// eslint-plugin-prettier recommended rules
|
|
835
|
+
...{
|
|
836
|
+
"prettier/prettier": "error",
|
|
837
|
+
"arrow-body-style": "off",
|
|
838
|
+
"prefer-arrow-callback": "off"
|
|
839
|
+
},
|
|
840
|
+
"prettier/prettier": [
|
|
841
|
+
"warn",
|
|
842
|
+
{
|
|
843
|
+
plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
|
|
844
|
+
quoteProps: "consistent",
|
|
845
|
+
...options
|
|
846
|
+
}
|
|
847
|
+
]
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
...PlainFileRules
|
|
851
|
+
];
|
|
852
|
+
};
|
|
853
|
+
|
|
721
854
|
// src/configs/sort.ts
|
|
722
855
|
async function sortPackageJson() {
|
|
723
856
|
return [
|
|
@@ -925,6 +1058,95 @@ async function sortTsconfig() {
|
|
|
925
1058
|
];
|
|
926
1059
|
}
|
|
927
1060
|
|
|
1061
|
+
// src/configs/test.ts
|
|
1062
|
+
var test = async (options) => {
|
|
1063
|
+
const { overrides = {} } = options;
|
|
1064
|
+
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
1065
|
+
interopDefault(import("eslint-plugin-vitest")),
|
|
1066
|
+
// @ts-expect-error missing types
|
|
1067
|
+
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
1068
|
+
]);
|
|
1069
|
+
return [
|
|
1070
|
+
{
|
|
1071
|
+
name: "eslint/test/setup",
|
|
1072
|
+
plugins: {
|
|
1073
|
+
test: {
|
|
1074
|
+
...pluginVitest,
|
|
1075
|
+
rules: {
|
|
1076
|
+
...pluginVitest.rules,
|
|
1077
|
+
// extend `test/no-only-tests` rule
|
|
1078
|
+
...pluginNoOnlyTests.rules
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
name: "eslint/test/rules",
|
|
1085
|
+
files: GLOB_TESTS,
|
|
1086
|
+
rules: {
|
|
1087
|
+
"node/prefer-global/process": "off",
|
|
1088
|
+
"test/consistent-test-it": [
|
|
1089
|
+
"error",
|
|
1090
|
+
{ fn: "it", withinDescribe: "it" }
|
|
1091
|
+
],
|
|
1092
|
+
"test/no-identical-title": "error",
|
|
1093
|
+
"test/no-import-node-test": "error",
|
|
1094
|
+
"test/no-only-tests": "error",
|
|
1095
|
+
"test/prefer-hooks-in-order": "error",
|
|
1096
|
+
"test/prefer-lowercase-title": "error",
|
|
1097
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1098
|
+
...overrides
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
];
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
// src/configs/toml.ts
|
|
1105
|
+
var toml = async (options) => {
|
|
1106
|
+
const { overrides = {} } = options;
|
|
1107
|
+
const [pluginToml, parserToml] = await Promise.all([
|
|
1108
|
+
interopDefault(import("eslint-plugin-toml")),
|
|
1109
|
+
interopDefault(import("toml-eslint-parser"))
|
|
1110
|
+
]);
|
|
1111
|
+
return [
|
|
1112
|
+
{
|
|
1113
|
+
name: "eslint/toml/setup",
|
|
1114
|
+
plugins: {
|
|
1115
|
+
toml: pluginToml
|
|
1116
|
+
}
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
name: "eslint/toml/rules",
|
|
1120
|
+
files: [GLOB_TOML],
|
|
1121
|
+
languageOptions: {
|
|
1122
|
+
parser: parserToml
|
|
1123
|
+
},
|
|
1124
|
+
rules: {
|
|
1125
|
+
"toml/comma-style": "error",
|
|
1126
|
+
"toml/keys-order": "error",
|
|
1127
|
+
"toml/no-space-dots": "error",
|
|
1128
|
+
"toml/no-unreadable-number-separator": "error",
|
|
1129
|
+
"toml/precision-of-fractional-seconds": "error",
|
|
1130
|
+
"toml/precision-of-integer": "error",
|
|
1131
|
+
"toml/tables-order": "error",
|
|
1132
|
+
"toml/vue-custom-block/no-parsing-error": "error",
|
|
1133
|
+
"toml/array-bracket-newline": "error",
|
|
1134
|
+
"toml/array-bracket-spacing": "error",
|
|
1135
|
+
"toml/array-element-newline": "error",
|
|
1136
|
+
"toml/indent": ["error", 2],
|
|
1137
|
+
"toml/inline-table-curly-spacing": "error",
|
|
1138
|
+
"toml/key-spacing": "error",
|
|
1139
|
+
"toml/padding-line-between-pairs": "error",
|
|
1140
|
+
"toml/padding-line-between-tables": "error",
|
|
1141
|
+
"toml/quoted-keys": "error",
|
|
1142
|
+
"toml/spaced-comment": "error",
|
|
1143
|
+
"toml/table-bracket-spacing": "error",
|
|
1144
|
+
...overrides
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
];
|
|
1148
|
+
};
|
|
1149
|
+
|
|
928
1150
|
// src/configs/typescript.ts
|
|
929
1151
|
var import_node_process = __toESM(require("process"), 1);
|
|
930
1152
|
var typeAwareRules = {
|
|
@@ -1088,7 +1310,10 @@ async function unicorn() {
|
|
|
1088
1310
|
// Pass error message when throwing errors
|
|
1089
1311
|
"unicorn/error-message": "error",
|
|
1090
1312
|
// Uppercase regex escapes
|
|
1091
|
-
"unicorn/
|
|
1313
|
+
"unicorn/consistent-function-scoping": [
|
|
1314
|
+
"error",
|
|
1315
|
+
{ checkArrowFunctions: false }
|
|
1316
|
+
],
|
|
1092
1317
|
// Array.isArray instead of instanceof
|
|
1093
1318
|
"unicorn/no-instanceof-array": "error",
|
|
1094
1319
|
// Ban `new Array` as `Array` constructor's params are ambiguous
|
|
@@ -1294,208 +1519,6 @@ var yml = async (options) => {
|
|
|
1294
1519
|
];
|
|
1295
1520
|
};
|
|
1296
1521
|
|
|
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
1522
|
// src/configs/react.ts
|
|
1500
1523
|
async function next() {
|
|
1501
1524
|
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 };
|