@lincy/eslint-config 4.5.1 → 4.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/README.md +13 -0
- package/dist/index.cjs +99 -57
- package/dist/index.d.cts +831 -222
- package/dist/index.d.ts +831 -222
- package/dist/index.js +97 -57
- package/package.json +35 -34
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ var GLOB_VUE = "**/*.vue";
|
|
|
53
53
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
54
54
|
var GLOB_TOML = "**/*.toml";
|
|
55
55
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
56
|
+
var GLOB_GRAPHQL = "**/*.{g,graph}ql";
|
|
56
57
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
57
58
|
var GLOB_TESTS = [
|
|
58
59
|
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
@@ -122,14 +123,14 @@ async function imports(options = {}) {
|
|
|
122
123
|
} = options;
|
|
123
124
|
return [
|
|
124
125
|
{
|
|
125
|
-
name: "eslint:imports",
|
|
126
|
+
name: "eslint:imports:rules",
|
|
126
127
|
plugins: {
|
|
127
128
|
antfu: default2,
|
|
128
129
|
import: pluginImport
|
|
129
130
|
},
|
|
130
131
|
rules: {
|
|
131
132
|
"antfu/import-dedupe": "error",
|
|
132
|
-
"antfu/no-import-dist": "
|
|
133
|
+
"antfu/no-import-dist": "error",
|
|
133
134
|
"antfu/no-import-node-modules-by-path": "error",
|
|
134
135
|
"import/first": "error",
|
|
135
136
|
"import/no-duplicates": "error",
|
|
@@ -142,6 +143,14 @@ async function imports(options = {}) {
|
|
|
142
143
|
"import/newline-after-import": ["error", { considerComments: true, count: 1 }]
|
|
143
144
|
} : {}
|
|
144
145
|
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
|
|
149
|
+
name: "eslint:imports:disables:bin",
|
|
150
|
+
rules: {
|
|
151
|
+
"antfu/no-import-dist": "off",
|
|
152
|
+
"antfu/no-import-node-modules-by-path": "off"
|
|
153
|
+
}
|
|
145
154
|
}
|
|
146
155
|
];
|
|
147
156
|
}
|
|
@@ -177,14 +186,13 @@ async function javascript(options = {}) {
|
|
|
177
186
|
linterOptions: {
|
|
178
187
|
reportUnusedDisableDirectives: true
|
|
179
188
|
},
|
|
180
|
-
name: "eslint:javascript",
|
|
189
|
+
name: "eslint:javascript:rules",
|
|
181
190
|
plugins: {
|
|
182
191
|
"antfu": default2,
|
|
183
192
|
"unused-imports": default6
|
|
184
193
|
},
|
|
185
194
|
rules: {
|
|
186
195
|
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
187
|
-
"antfu/top-level-function": "error",
|
|
188
196
|
"array-callback-return": "error",
|
|
189
197
|
"block-scoped-var": "error",
|
|
190
198
|
"constructor-super": "error",
|
|
@@ -203,7 +211,6 @@ async function javascript(options = {}) {
|
|
|
203
211
|
// 'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
204
212
|
"no-console": "off",
|
|
205
213
|
"no-const-assign": "error",
|
|
206
|
-
"no-constant-condition": "warn",
|
|
207
214
|
"no-control-regex": "error",
|
|
208
215
|
"no-debugger": "error",
|
|
209
216
|
"no-delete-var": "error",
|
|
@@ -225,7 +232,6 @@ async function javascript(options = {}) {
|
|
|
225
232
|
"no-implied-eval": "error",
|
|
226
233
|
"no-import-assign": "error",
|
|
227
234
|
"no-invalid-regexp": "error",
|
|
228
|
-
"no-invalid-this": "error",
|
|
229
235
|
"no-irregular-whitespace": "error",
|
|
230
236
|
"no-iterator": "error",
|
|
231
237
|
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
|
@@ -235,7 +241,7 @@ async function javascript(options = {}) {
|
|
|
235
241
|
"no-multi-str": "error",
|
|
236
242
|
"no-new": "error",
|
|
237
243
|
"no-new-func": "error",
|
|
238
|
-
"no-new-
|
|
244
|
+
"no-new-native-nonconstructor": "error",
|
|
239
245
|
"no-new-wrappers": "error",
|
|
240
246
|
"no-obj-calls": "error",
|
|
241
247
|
"no-octal": "error",
|
|
@@ -302,7 +308,6 @@ async function javascript(options = {}) {
|
|
|
302
308
|
"no-useless-rename": "error",
|
|
303
309
|
"no-useless-return": "error",
|
|
304
310
|
"no-var": "error",
|
|
305
|
-
"no-void": "error",
|
|
306
311
|
"no-with": "error",
|
|
307
312
|
"object-shorthand": [
|
|
308
313
|
"error",
|
|
@@ -343,13 +348,18 @@ async function javascript(options = {}) {
|
|
|
343
348
|
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
344
349
|
}
|
|
345
350
|
],
|
|
346
|
-
"style/arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
|
|
347
351
|
"symbol-description": "error",
|
|
348
352
|
"unicode-bom": ["error", "never"],
|
|
349
353
|
"unused-imports/no-unused-imports": isInEditor ? "off" : "error",
|
|
350
354
|
"unused-imports/no-unused-vars": [
|
|
351
355
|
"error",
|
|
352
|
-
{
|
|
356
|
+
{
|
|
357
|
+
args: "after-used",
|
|
358
|
+
argsIgnorePattern: "^_",
|
|
359
|
+
ignoreRestSiblings: true,
|
|
360
|
+
vars: "all",
|
|
361
|
+
varsIgnorePattern: "^_"
|
|
362
|
+
}
|
|
353
363
|
],
|
|
354
364
|
"use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
|
|
355
365
|
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
@@ -360,7 +370,7 @@ async function javascript(options = {}) {
|
|
|
360
370
|
},
|
|
361
371
|
{
|
|
362
372
|
files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
|
|
363
|
-
name: "eslint:scripts
|
|
373
|
+
name: "eslint:scripts:disables",
|
|
364
374
|
rules: {
|
|
365
375
|
"no-console": "off"
|
|
366
376
|
}
|
|
@@ -371,8 +381,8 @@ async function javascript(options = {}) {
|
|
|
371
381
|
// src/utils.ts
|
|
372
382
|
import process from "node:process";
|
|
373
383
|
import { isPackageExists } from "local-pkg";
|
|
374
|
-
async function combine(...
|
|
375
|
-
const resolved = await Promise.all(
|
|
384
|
+
async function combine(...configs2) {
|
|
385
|
+
const resolved = await Promise.all(configs2);
|
|
376
386
|
return resolved.flat();
|
|
377
387
|
}
|
|
378
388
|
function renameRules(rules, map) {
|
|
@@ -387,8 +397,8 @@ function renameRules(rules, map) {
|
|
|
387
397
|
})
|
|
388
398
|
);
|
|
389
399
|
}
|
|
390
|
-
function renamePluginInConfigs(
|
|
391
|
-
return
|
|
400
|
+
function renamePluginInConfigs(configs2, map) {
|
|
401
|
+
return configs2.map((i) => {
|
|
392
402
|
const clone = { ...i };
|
|
393
403
|
if (clone.rules) {
|
|
394
404
|
clone.rules = renameRules(clone.rules, map);
|
|
@@ -441,7 +451,7 @@ async function jsdoc(options = {}) {
|
|
|
441
451
|
} = options;
|
|
442
452
|
return [
|
|
443
453
|
{
|
|
444
|
-
name: "eslint:jsdoc",
|
|
454
|
+
name: "eslint:jsdoc:rules",
|
|
445
455
|
plugins: {
|
|
446
456
|
jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
|
|
447
457
|
},
|
|
@@ -620,7 +630,6 @@ async function markdown(options = {}) {
|
|
|
620
630
|
"ts/no-for-in-array": "off",
|
|
621
631
|
"ts/no-implied-eval": "off",
|
|
622
632
|
"ts/no-misused-promises": "off",
|
|
623
|
-
"ts/no-throw-literal": "off",
|
|
624
633
|
"ts/no-unnecessary-type-assertion": "off",
|
|
625
634
|
"ts/no-unsafe-argument": "off",
|
|
626
635
|
"ts/no-unsafe-assignment": "off",
|
|
@@ -641,7 +650,7 @@ async function markdown(options = {}) {
|
|
|
641
650
|
async function perfectionist() {
|
|
642
651
|
return [
|
|
643
652
|
{
|
|
644
|
-
name: "eslint:perfectionist",
|
|
653
|
+
name: "eslint:perfectionist:setup",
|
|
645
654
|
plugins: {
|
|
646
655
|
perfectionist: default7
|
|
647
656
|
}
|
|
@@ -694,9 +703,9 @@ async function stylistic(options = {}) {
|
|
|
694
703
|
...lessOpinionated ? {
|
|
695
704
|
curly: ["error", "all"]
|
|
696
705
|
} : {
|
|
706
|
+
"antfu/curly": "error",
|
|
697
707
|
"antfu/if-newline": "error",
|
|
698
|
-
"antfu/top-level-function": "error"
|
|
699
|
-
"curly": ["error", "multi-or-nest", "consistent"]
|
|
708
|
+
"antfu/top-level-function": "error"
|
|
700
709
|
},
|
|
701
710
|
// 覆盖`stylistic`默认规则
|
|
702
711
|
"style/member-delimiter-style": ["error", { multiline: { delimiter: "none" } }],
|
|
@@ -709,6 +718,7 @@ async function stylistic(options = {}) {
|
|
|
709
718
|
|
|
710
719
|
// src/configs/formatters.ts
|
|
711
720
|
async function formatters(options = {}, stylistic2 = {}) {
|
|
721
|
+
const defaultIndent = 4;
|
|
712
722
|
await ensurePackages([
|
|
713
723
|
"eslint-plugin-format"
|
|
714
724
|
]);
|
|
@@ -733,7 +743,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
733
743
|
endOfLine: "lf",
|
|
734
744
|
semi,
|
|
735
745
|
singleQuote: quotes === "single",
|
|
736
|
-
tabWidth: typeof indent === "number" ? indent :
|
|
746
|
+
tabWidth: typeof indent === "number" ? indent : defaultIndent,
|
|
737
747
|
trailingComma: "all",
|
|
738
748
|
useTabs: indent === "tab"
|
|
739
749
|
},
|
|
@@ -741,14 +751,14 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
741
751
|
);
|
|
742
752
|
const dprintOptions = Object.assign(
|
|
743
753
|
{
|
|
744
|
-
indentWidth: typeof indent === "number" ? indent :
|
|
754
|
+
indentWidth: typeof indent === "number" ? indent : defaultIndent,
|
|
745
755
|
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
746
756
|
useTabs: indent === "tab"
|
|
747
757
|
},
|
|
748
758
|
options.dprintOptions || {}
|
|
749
759
|
);
|
|
750
760
|
const pluginFormat = await interopDefault(import("eslint-plugin-format"));
|
|
751
|
-
const
|
|
761
|
+
const configs2 = [
|
|
752
762
|
{
|
|
753
763
|
name: "eslint:formatters:setup",
|
|
754
764
|
plugins: {
|
|
@@ -757,7 +767,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
757
767
|
}
|
|
758
768
|
];
|
|
759
769
|
if (options.css) {
|
|
760
|
-
|
|
770
|
+
configs2.push(
|
|
761
771
|
{
|
|
762
772
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
763
773
|
languageOptions: {
|
|
@@ -809,7 +819,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
809
819
|
);
|
|
810
820
|
}
|
|
811
821
|
if (options.html) {
|
|
812
|
-
|
|
822
|
+
configs2.push({
|
|
813
823
|
files: [GLOB_HTML],
|
|
814
824
|
languageOptions: {
|
|
815
825
|
parser: parserPlain2
|
|
@@ -828,7 +838,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
828
838
|
}
|
|
829
839
|
if (options.markdown) {
|
|
830
840
|
const formater = options.markdown === true ? "prettier" : options.markdown;
|
|
831
|
-
|
|
841
|
+
configs2.push({
|
|
832
842
|
files: [GLOB_MARKDOWN],
|
|
833
843
|
languageOptions: {
|
|
834
844
|
parser: parserPlain2
|
|
@@ -851,8 +861,8 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
851
861
|
});
|
|
852
862
|
}
|
|
853
863
|
if (options.graphql) {
|
|
854
|
-
|
|
855
|
-
files: [
|
|
864
|
+
configs2.push({
|
|
865
|
+
files: [GLOB_GRAPHQL],
|
|
856
866
|
languageOptions: {
|
|
857
867
|
parser: parserPlain2
|
|
858
868
|
},
|
|
@@ -868,14 +878,14 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
868
878
|
}
|
|
869
879
|
});
|
|
870
880
|
}
|
|
871
|
-
return
|
|
881
|
+
return configs2;
|
|
872
882
|
}
|
|
873
883
|
|
|
874
884
|
// src/configs/node.ts
|
|
875
885
|
async function node() {
|
|
876
886
|
return [
|
|
877
887
|
{
|
|
878
|
-
name: "eslint:node",
|
|
888
|
+
name: "eslint:node:rules",
|
|
879
889
|
plugins: {
|
|
880
890
|
node: default4
|
|
881
891
|
},
|
|
@@ -993,7 +1003,6 @@ async function react(options = {}) {
|
|
|
993
1003
|
"react/no-create-ref": "error",
|
|
994
1004
|
"react/no-direct-mutation-state": "error",
|
|
995
1005
|
"react/no-duplicate-key": "error",
|
|
996
|
-
"react/no-implicit-key": "error",
|
|
997
1006
|
"react/no-missing-key": "error",
|
|
998
1007
|
"react/no-nested-components": "warn",
|
|
999
1008
|
"react/no-redundant-should-component-update": "error",
|
|
@@ -1027,6 +1036,32 @@ async function react(options = {}) {
|
|
|
1027
1036
|
];
|
|
1028
1037
|
}
|
|
1029
1038
|
|
|
1039
|
+
// src/configs/regexp.ts
|
|
1040
|
+
import { configs } from "eslint-plugin-regexp";
|
|
1041
|
+
async function regexp(options = {}) {
|
|
1042
|
+
const config = configs["flat/recommended"];
|
|
1043
|
+
const rules = {
|
|
1044
|
+
...config.rules
|
|
1045
|
+
};
|
|
1046
|
+
if (options.level === "warn") {
|
|
1047
|
+
for (const key in rules) {
|
|
1048
|
+
if (rules[key] === "error") {
|
|
1049
|
+
rules[key] = "warn";
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
return [
|
|
1054
|
+
{
|
|
1055
|
+
...config,
|
|
1056
|
+
name: "eslint/regexp/rules",
|
|
1057
|
+
rules: {
|
|
1058
|
+
...rules,
|
|
1059
|
+
...options.overrides
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
];
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1030
1065
|
// src/configs/sort.ts
|
|
1031
1066
|
async function sortPackageJson() {
|
|
1032
1067
|
return [
|
|
@@ -1326,7 +1361,6 @@ async function typescript(options = {}) {
|
|
|
1326
1361
|
"ts/no-for-in-array": "error",
|
|
1327
1362
|
"ts/no-implied-eval": "error",
|
|
1328
1363
|
"ts/no-misused-promises": "error",
|
|
1329
|
-
"ts/no-throw-literal": "error",
|
|
1330
1364
|
"ts/no-unnecessary-type-assertion": "error",
|
|
1331
1365
|
"ts/no-unsafe-argument": "error",
|
|
1332
1366
|
"ts/no-unsafe-assignment": "error",
|
|
@@ -1420,17 +1454,17 @@ async function typescript(options = {}) {
|
|
|
1420
1454
|
...overrides
|
|
1421
1455
|
}
|
|
1422
1456
|
},
|
|
1423
|
-
{
|
|
1457
|
+
...isTypeAware ? [{
|
|
1424
1458
|
files: filesTypeAware,
|
|
1425
1459
|
name: "eslint:typescript:rules-type-aware",
|
|
1426
1460
|
rules: {
|
|
1427
1461
|
...tsconfigPath ? typeAwareRules : {},
|
|
1428
1462
|
...overrides
|
|
1429
1463
|
}
|
|
1430
|
-
},
|
|
1464
|
+
}] : [],
|
|
1431
1465
|
{
|
|
1432
1466
|
files: ["**/*.d.ts"],
|
|
1433
|
-
name: "eslint:typescript:dts
|
|
1467
|
+
name: "eslint:typescript:disables:dts",
|
|
1434
1468
|
rules: {
|
|
1435
1469
|
"eslint-comments/no-unlimited-disable": "off",
|
|
1436
1470
|
"import/no-duplicates": "off",
|
|
@@ -1440,14 +1474,14 @@ async function typescript(options = {}) {
|
|
|
1440
1474
|
},
|
|
1441
1475
|
{
|
|
1442
1476
|
files: ["**/*.{test,spec}.ts?(x)"],
|
|
1443
|
-
name: "eslint:typescript:
|
|
1477
|
+
name: "eslint:typescript:disables:test",
|
|
1444
1478
|
rules: {
|
|
1445
1479
|
"no-unused-expressions": "off"
|
|
1446
1480
|
}
|
|
1447
1481
|
},
|
|
1448
1482
|
{
|
|
1449
1483
|
files: ["**/*.js", "**/*.cjs"],
|
|
1450
|
-
name: "eslint:typescript:
|
|
1484
|
+
name: "eslint:typescript:disables:cjs",
|
|
1451
1485
|
rules: {
|
|
1452
1486
|
"ts/no-require-imports": "off",
|
|
1453
1487
|
"ts/no-var-requires": "off"
|
|
@@ -1475,8 +1509,6 @@ async function unicorn() {
|
|
|
1475
1509
|
"unicorn/no-new-array": "error",
|
|
1476
1510
|
// Prevent deprecated `new Buffer()`
|
|
1477
1511
|
"unicorn/no-new-buffer": "error",
|
|
1478
|
-
// Keep regex literals safe!
|
|
1479
|
-
"unicorn/no-unsafe-regex": "error",
|
|
1480
1512
|
// Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
|
|
1481
1513
|
"unicorn/number-literal-case": "error",
|
|
1482
1514
|
// textContent instead of innerText
|
|
@@ -1626,7 +1658,6 @@ async function vue(options = {}) {
|
|
|
1626
1658
|
}],
|
|
1627
1659
|
"vue/component-name-in-template-casing": ["error", "PascalCase"],
|
|
1628
1660
|
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
1629
|
-
"vue/component-tags-order": "off",
|
|
1630
1661
|
"vue/custom-event-name-casing": vueVersion === "3" ? ["error", "camelCase"] : ["error", "kebab-case"],
|
|
1631
1662
|
...vueVersion === "2" ? {
|
|
1632
1663
|
"vue/require-explicit-emits": "off"
|
|
@@ -1868,6 +1899,7 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
1868
1899
|
isInEditor = !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI),
|
|
1869
1900
|
overrides = {},
|
|
1870
1901
|
react: enableReact = ReactPackages.some((i) => isPackageExists3(i)),
|
|
1902
|
+
regexp: enableRegexp = true,
|
|
1871
1903
|
typescript: enableTypeScript = isPackageExists3("typescript"),
|
|
1872
1904
|
unocss: enableUnoCSS = false,
|
|
1873
1905
|
vue: enableVue = VuePackages.some((i) => isPackageExists3(i))
|
|
@@ -1878,17 +1910,17 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
1878
1910
|
stylisticOptions.jsx = options.jsx ?? true;
|
|
1879
1911
|
}
|
|
1880
1912
|
}
|
|
1881
|
-
const
|
|
1913
|
+
const configs2 = [];
|
|
1882
1914
|
if (enableGitignore) {
|
|
1883
1915
|
if (typeof enableGitignore !== "boolean") {
|
|
1884
|
-
|
|
1916
|
+
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)]));
|
|
1885
1917
|
} else {
|
|
1886
1918
|
if (fs.existsSync(".gitignore")) {
|
|
1887
|
-
|
|
1919
|
+
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
|
|
1888
1920
|
}
|
|
1889
1921
|
}
|
|
1890
1922
|
}
|
|
1891
|
-
|
|
1923
|
+
configs2.push(
|
|
1892
1924
|
ignores({
|
|
1893
1925
|
ignores: overrides.ignores
|
|
1894
1926
|
}),
|
|
@@ -1912,27 +1944,33 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
1912
1944
|
componentExts.push("vue");
|
|
1913
1945
|
}
|
|
1914
1946
|
if (enableTypeScript) {
|
|
1915
|
-
|
|
1947
|
+
configs2.push(typescript({
|
|
1916
1948
|
...typeof enableTypeScript !== "boolean" ? enableTypeScript : {},
|
|
1917
1949
|
componentExts,
|
|
1918
1950
|
overrides: overrides.typescript
|
|
1919
1951
|
}));
|
|
1920
1952
|
}
|
|
1921
1953
|
if (stylisticOptions) {
|
|
1922
|
-
|
|
1954
|
+
configs2.push(stylistic({
|
|
1923
1955
|
overrides: overrides.stylistic,
|
|
1924
1956
|
stylistic: stylisticOptions
|
|
1925
1957
|
}));
|
|
1926
1958
|
}
|
|
1959
|
+
if (enableRegexp) {
|
|
1960
|
+
configs2.push(regexp({
|
|
1961
|
+
...typeof enableRegexp === "boolean" ? {} : enableRegexp,
|
|
1962
|
+
overrides: overrides.regexp
|
|
1963
|
+
}));
|
|
1964
|
+
}
|
|
1927
1965
|
if (options.test ?? true) {
|
|
1928
|
-
|
|
1966
|
+
configs2.push(test({
|
|
1929
1967
|
...typeof options.test !== "boolean" ? options.test : {},
|
|
1930
1968
|
isInEditor,
|
|
1931
1969
|
overrides: overrides.test
|
|
1932
1970
|
}));
|
|
1933
1971
|
}
|
|
1934
1972
|
if (enableVue) {
|
|
1935
|
-
|
|
1973
|
+
configs2.push(vue({
|
|
1936
1974
|
...typeof options.vue !== "boolean" ? options.vue : {},
|
|
1937
1975
|
overrides: overrides.vue,
|
|
1938
1976
|
stylistic: stylisticOptions,
|
|
@@ -1940,20 +1978,20 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
1940
1978
|
}));
|
|
1941
1979
|
}
|
|
1942
1980
|
if (enableReact) {
|
|
1943
|
-
|
|
1981
|
+
configs2.push(react({
|
|
1944
1982
|
...typeof enableReact !== "boolean" ? enableReact : {},
|
|
1945
1983
|
overrides: overrides.react,
|
|
1946
1984
|
typescript: !!enableTypeScript
|
|
1947
1985
|
}));
|
|
1948
1986
|
}
|
|
1949
1987
|
if (enableUnoCSS) {
|
|
1950
|
-
|
|
1988
|
+
configs2.push(unocss({
|
|
1951
1989
|
...typeof enableUnoCSS === "boolean" ? {} : enableUnoCSS,
|
|
1952
1990
|
overrides: overrides.unocss
|
|
1953
1991
|
}));
|
|
1954
1992
|
}
|
|
1955
1993
|
if (options.jsonc ?? true) {
|
|
1956
|
-
|
|
1994
|
+
configs2.push(
|
|
1957
1995
|
jsonc({
|
|
1958
1996
|
...typeof options.jsonc !== "boolean" ? options.jsonc : {},
|
|
1959
1997
|
overrides: overrides.jsonc,
|
|
@@ -1964,27 +2002,27 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
1964
2002
|
);
|
|
1965
2003
|
}
|
|
1966
2004
|
if (options.yaml ?? true) {
|
|
1967
|
-
|
|
2005
|
+
configs2.push(yaml({
|
|
1968
2006
|
...typeof options.yaml !== "boolean" ? options.yaml : {},
|
|
1969
2007
|
overrides: overrides.yaml,
|
|
1970
2008
|
stylistic: stylisticOptions
|
|
1971
2009
|
}));
|
|
1972
2010
|
}
|
|
1973
2011
|
if (options.toml) {
|
|
1974
|
-
|
|
2012
|
+
configs2.push(toml({
|
|
1975
2013
|
overrides: overrides.toml,
|
|
1976
2014
|
stylistic: stylisticOptions
|
|
1977
2015
|
}));
|
|
1978
2016
|
}
|
|
1979
2017
|
if (options.markdown ?? true) {
|
|
1980
|
-
|
|
2018
|
+
configs2.push(markdown({
|
|
1981
2019
|
...typeof options.markdown !== "boolean" ? options.markdown : {},
|
|
1982
2020
|
componentExts,
|
|
1983
2021
|
overrides: overrides.markdown
|
|
1984
2022
|
}));
|
|
1985
2023
|
}
|
|
1986
2024
|
if (options.formatters) {
|
|
1987
|
-
|
|
2025
|
+
configs2.push(formatters(
|
|
1988
2026
|
options.formatters,
|
|
1989
2027
|
typeof stylisticOptions === "boolean" ? {} : stylisticOptions
|
|
1990
2028
|
));
|
|
@@ -1996,11 +2034,11 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
1996
2034
|
return acc;
|
|
1997
2035
|
}, {});
|
|
1998
2036
|
if (Object.keys(fusedConfig).length) {
|
|
1999
|
-
|
|
2037
|
+
configs2.push([fusedConfig]);
|
|
2000
2038
|
}
|
|
2001
2039
|
let composer = new FlatConfigComposer();
|
|
2002
2040
|
composer = composer.append(
|
|
2003
|
-
...
|
|
2041
|
+
...configs2,
|
|
2004
2042
|
...userConfigs
|
|
2005
2043
|
);
|
|
2006
2044
|
if (autoRenamePlugins) {
|
|
@@ -2015,6 +2053,7 @@ export {
|
|
|
2015
2053
|
GLOB_ALL_SRC,
|
|
2016
2054
|
GLOB_CSS,
|
|
2017
2055
|
GLOB_EXCLUDE,
|
|
2056
|
+
GLOB_GRAPHQL,
|
|
2018
2057
|
GLOB_HTML,
|
|
2019
2058
|
GLOB_JS,
|
|
2020
2059
|
GLOB_JSON,
|
|
@@ -2055,6 +2094,7 @@ export {
|
|
|
2055
2094
|
node,
|
|
2056
2095
|
perfectionist,
|
|
2057
2096
|
react,
|
|
2097
|
+
regexp,
|
|
2058
2098
|
renamePluginInConfigs,
|
|
2059
2099
|
renameRules,
|
|
2060
2100
|
sortPackageJson,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincy/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
5
|
-
"packageManager": "pnpm@
|
|
4
|
+
"version": "4.6.1",
|
|
5
|
+
"packageManager": "pnpm@9.1.0",
|
|
6
6
|
"description": "LinCenYing's ESLint config",
|
|
7
7
|
"author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
|
|
8
8
|
"license": "MIT",
|
|
@@ -63,70 +63,71 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@antfu/eslint-define-config": "1.23.0-2",
|
|
66
|
-
"@antfu/install-pkg": "^0.3.
|
|
67
|
-
"@stylistic/eslint-plugin": "1.
|
|
68
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
69
|
-
"@typescript-eslint/parser": "^7.
|
|
66
|
+
"@antfu/install-pkg": "^0.3.3",
|
|
67
|
+
"@stylistic/eslint-plugin": "2.1.0",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^7.10.0",
|
|
69
|
+
"@typescript-eslint/parser": "^7.10.0",
|
|
70
70
|
"eslint-config-flat-gitignore": "^0.1.5",
|
|
71
|
-
"eslint-flat-config-utils": "^0.2.
|
|
71
|
+
"eslint-flat-config-utils": "^0.2.5",
|
|
72
72
|
"eslint-merge-processors": "^0.1.0",
|
|
73
73
|
"eslint-parser-plain": "^0.1.0",
|
|
74
|
-
"eslint-plugin-antfu": "^2.
|
|
74
|
+
"eslint-plugin-antfu": "^2.3.0",
|
|
75
75
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
76
|
-
"eslint-plugin-import-x": "^0.5.
|
|
77
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
78
|
-
"eslint-plugin-jsonc": "^2.
|
|
79
|
-
"eslint-plugin-markdown": "^
|
|
80
|
-
"eslint-plugin-n": "^17.
|
|
76
|
+
"eslint-plugin-import-x": "^0.5.1",
|
|
77
|
+
"eslint-plugin-jsdoc": "^48.2.6",
|
|
78
|
+
"eslint-plugin-jsonc": "^2.16.0",
|
|
79
|
+
"eslint-plugin-markdown": "^5.0.0",
|
|
80
|
+
"eslint-plugin-n": "^17.7.0",
|
|
81
81
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
82
|
-
"eslint-plugin-perfectionist": "^2.
|
|
82
|
+
"eslint-plugin-perfectionist": "^2.10.0",
|
|
83
|
+
"eslint-plugin-regexp": "^2.6.0",
|
|
83
84
|
"eslint-plugin-toml": "^0.11.0",
|
|
84
|
-
"eslint-plugin-unicorn": "^
|
|
85
|
-
"eslint-plugin-unused-imports": "^
|
|
86
|
-
"eslint-plugin-vitest": "^0.5.
|
|
87
|
-
"eslint-plugin-vue": "^9.
|
|
85
|
+
"eslint-plugin-unicorn": "^53.0.0",
|
|
86
|
+
"eslint-plugin-unused-imports": "^4.0.0",
|
|
87
|
+
"eslint-plugin-vitest": "^0.5.4",
|
|
88
|
+
"eslint-plugin-vue": "^9.26.0",
|
|
88
89
|
"eslint-plugin-yml": "^1.14.0",
|
|
89
90
|
"eslint-processor-vue-blocks": "^0.1.2",
|
|
90
|
-
"globals": "^15.
|
|
91
|
+
"globals": "^15.3.0",
|
|
91
92
|
"jsonc-eslint-parser": "^2.4.0",
|
|
92
93
|
"local-pkg": "^0.5.0",
|
|
93
94
|
"prompts": "^2.4.2",
|
|
94
95
|
"toml-eslint-parser": "^0.9.3",
|
|
95
96
|
"vue-eslint-parser": "^9.4.2",
|
|
96
|
-
"yaml-eslint-parser": "^1.2.
|
|
97
|
+
"yaml-eslint-parser": "^1.2.3"
|
|
97
98
|
},
|
|
98
99
|
"devDependencies": {
|
|
99
100
|
"@antfu/ni": "^0.21.12",
|
|
100
|
-
"@eslint-react/eslint-plugin": "^1.5.
|
|
101
|
+
"@eslint-react/eslint-plugin": "^1.5.12",
|
|
101
102
|
"@eslint-types/jsdoc": "48.2.2",
|
|
102
103
|
"@eslint-types/typescript-eslint": "^7.5.0",
|
|
103
104
|
"@eslint-types/unicorn": "^52.0.0",
|
|
104
|
-
"@eslint/config-inspector": "^0.4.
|
|
105
|
+
"@eslint/config-inspector": "^0.4.8",
|
|
105
106
|
"@lincy/eslint-config": "workspace:*",
|
|
106
|
-
"@stylistic/eslint-plugin-migrate": "^1.
|
|
107
|
+
"@stylistic/eslint-plugin-migrate": "^2.1.0",
|
|
107
108
|
"@types/eslint": "^8.56.10",
|
|
108
|
-
"@types/node": "^20.12.
|
|
109
|
+
"@types/node": "^20.12.12",
|
|
109
110
|
"@types/prompts": "^2.4.9",
|
|
110
|
-
"@unocss/eslint-plugin": "^0.
|
|
111
|
-
"bumpp": "^9.4.
|
|
112
|
-
"eslint": "^9.
|
|
111
|
+
"@unocss/eslint-plugin": "^0.60.3",
|
|
112
|
+
"bumpp": "^9.4.1",
|
|
113
|
+
"eslint": "^9.3.0",
|
|
113
114
|
"eslint-plugin-format": "^0.1.1",
|
|
114
|
-
"eslint-plugin-react-hooks": "^4.6.
|
|
115
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
115
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
116
|
+
"eslint-plugin-react-refresh": "^0.4.7",
|
|
116
117
|
"eslint-typegen": "^0.2.4",
|
|
117
118
|
"esno": "^4.7.0",
|
|
118
|
-
"lint-staged": "^15.2.
|
|
119
|
+
"lint-staged": "^15.2.5",
|
|
119
120
|
"prettier": "^3.2.5",
|
|
120
|
-
"react": "^18.
|
|
121
|
-
"rimraf": "^5.0.
|
|
121
|
+
"react": "^18.3.1",
|
|
122
|
+
"rimraf": "^5.0.7",
|
|
122
123
|
"simple-git-hooks": "^2.11.1",
|
|
123
124
|
"simple-open-url": "^3.0.1",
|
|
124
125
|
"sucrase": "^3.35.0",
|
|
125
126
|
"tsup": "^8.0.2",
|
|
126
127
|
"typescript": "^5.4.5",
|
|
127
128
|
"unbuild": "^2.0.0",
|
|
128
|
-
"vitest": "^1.
|
|
129
|
-
"vue": "^3.4.
|
|
129
|
+
"vitest": "^1.6.0",
|
|
130
|
+
"vue": "^3.4.27"
|
|
130
131
|
},
|
|
131
132
|
"pnpm": {
|
|
132
133
|
"peerDependencyRules": {
|