@lincy/eslint-config 5.2.5 → 5.2.6
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 +62 -30
- package/dist/index.d.cts +648 -357
- package/dist/index.d.ts +648 -357
- package/dist/index.js +61 -29
- package/package.json +29 -29
package/dist/index.js
CHANGED
|
@@ -144,13 +144,6 @@ async function disables() {
|
|
|
144
144
|
"unused-imports/no-unused-vars": "off"
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
|
-
{
|
|
148
|
-
files: ["**/*.{test,spec}.([tj])s?(x)"],
|
|
149
|
-
name: "eslint/disables/test",
|
|
150
|
-
rules: {
|
|
151
|
-
"no-unused-expressions": "off"
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
147
|
{
|
|
155
148
|
files: ["**/*.js", "**/*.cjs"],
|
|
156
149
|
name: "eslint/disables/cjs",
|
|
@@ -323,6 +316,16 @@ async function stylistic(options = {}) {
|
|
|
323
316
|
}
|
|
324
317
|
|
|
325
318
|
// src/configs/formatters.ts
|
|
319
|
+
function mergePrettierOptions(options, overrides = {}) {
|
|
320
|
+
return {
|
|
321
|
+
...options,
|
|
322
|
+
...overrides,
|
|
323
|
+
plugins: [
|
|
324
|
+
...overrides.plugins || [],
|
|
325
|
+
...options.plugins || []
|
|
326
|
+
]
|
|
327
|
+
};
|
|
328
|
+
}
|
|
326
329
|
async function formatters(options = {}, stylistic2 = {}) {
|
|
327
330
|
const defaultIndent = 4;
|
|
328
331
|
if (options === true) {
|
|
@@ -394,10 +397,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
394
397
|
rules: {
|
|
395
398
|
"format/prettier": [
|
|
396
399
|
"error",
|
|
397
|
-
{
|
|
400
|
+
mergePrettierOptions(prettierOptions, {
|
|
398
401
|
...prettierOptions,
|
|
399
402
|
parser: "css"
|
|
400
|
-
}
|
|
403
|
+
})
|
|
401
404
|
]
|
|
402
405
|
}
|
|
403
406
|
},
|
|
@@ -410,10 +413,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
410
413
|
rules: {
|
|
411
414
|
"format/prettier": [
|
|
412
415
|
"error",
|
|
413
|
-
{
|
|
416
|
+
mergePrettierOptions(prettierOptions, {
|
|
414
417
|
...prettierOptions,
|
|
415
418
|
parser: "scss"
|
|
416
|
-
}
|
|
419
|
+
})
|
|
417
420
|
]
|
|
418
421
|
}
|
|
419
422
|
},
|
|
@@ -426,10 +429,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
426
429
|
rules: {
|
|
427
430
|
"format/prettier": [
|
|
428
431
|
"error",
|
|
429
|
-
{
|
|
432
|
+
mergePrettierOptions(prettierOptions, {
|
|
430
433
|
...prettierOptions,
|
|
431
434
|
parser: "less"
|
|
432
|
-
}
|
|
435
|
+
})
|
|
433
436
|
]
|
|
434
437
|
}
|
|
435
438
|
}
|
|
@@ -445,10 +448,30 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
445
448
|
rules: {
|
|
446
449
|
"format/prettier": [
|
|
447
450
|
"error",
|
|
448
|
-
{
|
|
451
|
+
mergePrettierOptions(prettierOptions, {
|
|
449
452
|
...prettierOptions,
|
|
450
453
|
parser: "html"
|
|
451
|
-
}
|
|
454
|
+
})
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
if (options.xml) {
|
|
460
|
+
configs2.push({
|
|
461
|
+
files: [GLOB_XML],
|
|
462
|
+
languageOptions: {
|
|
463
|
+
parser: parserPlain
|
|
464
|
+
},
|
|
465
|
+
name: "eslint/formatter/xml",
|
|
466
|
+
rules: {
|
|
467
|
+
"format/prettier": [
|
|
468
|
+
"error",
|
|
469
|
+
mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
|
|
470
|
+
parser: "xml",
|
|
471
|
+
plugins: [
|
|
472
|
+
"@prettier/plugin-xml"
|
|
473
|
+
]
|
|
474
|
+
})
|
|
452
475
|
]
|
|
453
476
|
}
|
|
454
477
|
});
|
|
@@ -463,14 +486,12 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
463
486
|
rules: {
|
|
464
487
|
"format/prettier": [
|
|
465
488
|
"error",
|
|
466
|
-
{
|
|
467
|
-
...prettierXmlOptions,
|
|
468
|
-
...prettierOptions,
|
|
489
|
+
mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
|
|
469
490
|
parser: "xml",
|
|
470
491
|
plugins: [
|
|
471
492
|
"@prettier/plugin-xml"
|
|
472
493
|
]
|
|
473
|
-
}
|
|
494
|
+
})
|
|
474
495
|
]
|
|
475
496
|
}
|
|
476
497
|
});
|
|
@@ -486,11 +507,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
486
507
|
rules: {
|
|
487
508
|
[`format/${formater}`]: [
|
|
488
509
|
"error",
|
|
489
|
-
formater === "prettier" ? {
|
|
490
|
-
...prettierOptions,
|
|
510
|
+
formater === "prettier" ? mergePrettierOptions(prettierOptions, {
|
|
491
511
|
embeddedLanguageFormatting: "off",
|
|
492
512
|
parser: "markdown"
|
|
493
|
-
} : {
|
|
513
|
+
}) : {
|
|
494
514
|
...dprintOptions,
|
|
495
515
|
language: "markdown"
|
|
496
516
|
}
|
|
@@ -508,10 +528,9 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
508
528
|
rules: {
|
|
509
529
|
"format/prettier": [
|
|
510
530
|
"error",
|
|
511
|
-
{
|
|
512
|
-
...prettierOptions,
|
|
531
|
+
mergePrettierOptions(prettierOptions, {
|
|
513
532
|
parser: "graphql"
|
|
514
|
-
}
|
|
533
|
+
})
|
|
515
534
|
]
|
|
516
535
|
}
|
|
517
536
|
});
|
|
@@ -948,6 +967,7 @@ async function markdown(options = {}) {
|
|
|
948
967
|
},
|
|
949
968
|
name: "eslint/markdown/disables",
|
|
950
969
|
rules: {
|
|
970
|
+
"antfu/no-top-level-await": "off",
|
|
951
971
|
"import/newline-after-import": "off",
|
|
952
972
|
"no-alert": "off",
|
|
953
973
|
"no-console": "off",
|
|
@@ -1481,14 +1501,19 @@ async function test(options = {}) {
|
|
|
1481
1501
|
files,
|
|
1482
1502
|
name: "eslint/test/rules",
|
|
1483
1503
|
rules: {
|
|
1484
|
-
"node/prefer-global/process": "off",
|
|
1485
1504
|
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1486
1505
|
"test/no-identical-title": "error",
|
|
1487
1506
|
"test/no-import-node-test": "error",
|
|
1488
1507
|
"test/no-only-tests": isInEditor ? "off" : "error",
|
|
1489
1508
|
"test/prefer-hooks-in-order": "error",
|
|
1490
1509
|
"test/prefer-lowercase-title": "error",
|
|
1491
|
-
|
|
1510
|
+
// Disables
|
|
1511
|
+
...{
|
|
1512
|
+
"antfu/no-top-level-await": "off",
|
|
1513
|
+
"no-unused-expressions": "off",
|
|
1514
|
+
"node/prefer-global/process": "off",
|
|
1515
|
+
"ts/explicit-function-return-type": "off"
|
|
1516
|
+
},
|
|
1492
1517
|
...overrides
|
|
1493
1518
|
}
|
|
1494
1519
|
}
|
|
@@ -1812,7 +1837,6 @@ async function vue(options = {}) {
|
|
|
1812
1837
|
parserVue,
|
|
1813
1838
|
processorVueBlocks
|
|
1814
1839
|
] = await Promise.all([
|
|
1815
|
-
// @ts-expect-error missing types
|
|
1816
1840
|
interopDefault(import("eslint-plugin-vue")),
|
|
1817
1841
|
interopDefault(import("vue-eslint-parser")),
|
|
1818
1842
|
interopDefault(import("eslint-processor-vue-blocks"))
|
|
@@ -1889,6 +1913,7 @@ async function vue(options = {}) {
|
|
|
1889
1913
|
...vueVersion === "2" ? {
|
|
1890
1914
|
"vue/require-explicit-emits": "off"
|
|
1891
1915
|
} : null,
|
|
1916
|
+
"no-irregular-whitespace": "off",
|
|
1892
1917
|
"vue/define-macros-order": ["error", {
|
|
1893
1918
|
order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
|
|
1894
1919
|
}],
|
|
@@ -1917,7 +1942,14 @@ async function vue(options = {}) {
|
|
|
1917
1942
|
"vue/no-dupe-keys": "off",
|
|
1918
1943
|
"vue/no-empty-pattern": "error",
|
|
1919
1944
|
"vue/no-extra-parens": ["error", "functions"],
|
|
1920
|
-
"vue/no-irregular-whitespace": "error",
|
|
1945
|
+
"vue/no-irregular-whitespace": ["error", {
|
|
1946
|
+
skipComments: false,
|
|
1947
|
+
skipHTMLAttributeValues: false,
|
|
1948
|
+
skipHTMLTextContents: true,
|
|
1949
|
+
skipRegExps: false,
|
|
1950
|
+
skipStrings: true,
|
|
1951
|
+
skipTemplates: false
|
|
1952
|
+
}],
|
|
1921
1953
|
"vue/no-loss-of-precision": "error",
|
|
1922
1954
|
"vue/no-restricted-syntax": [
|
|
1923
1955
|
"error",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincy/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.6",
|
|
5
5
|
"packageManager": "pnpm@9.1.0",
|
|
6
6
|
"description": "LinCenYing's ESLint config",
|
|
7
7
|
"author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"prepare": "npx simple-git-hooks"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@eslint-react/eslint-plugin": "^
|
|
40
|
+
"@eslint-react/eslint-plugin": "^1.15.0",
|
|
41
41
|
"@prettier/plugin-xml": "^3.4.1",
|
|
42
42
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
43
43
|
"eslint": ">=9.5.0",
|
|
44
44
|
"eslint-plugin-format": ">=0.1.0",
|
|
45
|
-
"eslint-plugin-react-hooks": "^
|
|
46
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
45
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
46
|
+
"eslint-plugin-react-refresh": "^0.4.13"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"@eslint-react/eslint-plugin": {
|
|
@@ -70,30 +70,30 @@
|
|
|
70
70
|
"@antfu/install-pkg": "^0.4.1",
|
|
71
71
|
"@clack/prompts": "^0.7.0",
|
|
72
72
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
73
|
-
"@eslint/markdown": "^6.1
|
|
74
|
-
"@stylistic/eslint-plugin": "2.
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
76
|
-
"@typescript-eslint/parser": "8.
|
|
77
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
73
|
+
"@eslint/markdown": "^6.2.1",
|
|
74
|
+
"@stylistic/eslint-plugin": "2.9.0",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "8.10.0",
|
|
76
|
+
"@typescript-eslint/parser": "8.10.0",
|
|
77
|
+
"@vitest/eslint-plugin": "^1.1.7",
|
|
78
78
|
"eslint-config-flat-gitignore": "^0.3.0",
|
|
79
79
|
"eslint-flat-config-utils": "^0.4.0",
|
|
80
80
|
"eslint-merge-processors": "^0.1.0",
|
|
81
81
|
"eslint-parser-plain": "^0.1.0",
|
|
82
82
|
"eslint-plugin-antfu": "^2.7.0",
|
|
83
|
-
"eslint-plugin-import-x": "^4.3.
|
|
84
|
-
"eslint-plugin-jsdoc": "^50.
|
|
83
|
+
"eslint-plugin-import-x": "^4.3.1",
|
|
84
|
+
"eslint-plugin-jsdoc": "^50.4.3",
|
|
85
85
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
86
|
-
"eslint-plugin-n": "^17.
|
|
86
|
+
"eslint-plugin-n": "^17.11.1",
|
|
87
87
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
88
|
-
"eslint-plugin-perfectionist": "^3.
|
|
88
|
+
"eslint-plugin-perfectionist": "^3.9.1",
|
|
89
89
|
"eslint-plugin-regexp": "^2.6.0",
|
|
90
90
|
"eslint-plugin-toml": "^0.11.1",
|
|
91
|
-
"eslint-plugin-unicorn": "^
|
|
91
|
+
"eslint-plugin-unicorn": "^56.0.0",
|
|
92
92
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
93
|
-
"eslint-plugin-vue": "^9.
|
|
93
|
+
"eslint-plugin-vue": "^9.29.1",
|
|
94
94
|
"eslint-plugin-yml": "^1.14.0",
|
|
95
95
|
"eslint-processor-vue-blocks": "^0.1.2",
|
|
96
|
-
"globals": "^15.
|
|
96
|
+
"globals": "^15.11.0",
|
|
97
97
|
"jsonc-eslint-parser": "^2.4.0",
|
|
98
98
|
"local-pkg": "^0.5.0",
|
|
99
99
|
"prompts": "^2.4.2",
|
|
@@ -103,25 +103,25 @@
|
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@antfu/ni": "^0.23.0",
|
|
106
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
106
|
+
"@eslint-react/eslint-plugin": "^1.15.0",
|
|
107
107
|
"@eslint-types/jsdoc": "48.2.2",
|
|
108
108
|
"@eslint-types/typescript-eslint": "^7.5.0",
|
|
109
109
|
"@eslint-types/unicorn": "^52.0.0",
|
|
110
|
-
"@eslint/config-inspector": "^0.5.
|
|
110
|
+
"@eslint/config-inspector": "^0.5.5",
|
|
111
111
|
"@lincy/eslint-config": "workspace:*",
|
|
112
112
|
"@prettier/plugin-xml": "^3.4.1",
|
|
113
|
-
"@stylistic/eslint-plugin-migrate": "^2.
|
|
114
|
-
"@types/node": "^22.7.
|
|
113
|
+
"@stylistic/eslint-plugin-migrate": "^2.9.0",
|
|
114
|
+
"@types/node": "^22.7.7",
|
|
115
115
|
"@types/prompts": "^2.4.9",
|
|
116
|
-
"@unocss/eslint-plugin": "^0.
|
|
117
|
-
"bumpp": "^9.
|
|
118
|
-
"eslint": "^9.
|
|
116
|
+
"@unocss/eslint-plugin": "^0.63.4",
|
|
117
|
+
"bumpp": "^9.7.1",
|
|
118
|
+
"eslint": "^9.13.0",
|
|
119
119
|
"eslint-plugin-format": "^0.1.2",
|
|
120
|
-
"eslint-plugin-react-hooks": "^
|
|
121
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
120
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
121
|
+
"eslint-plugin-react-refresh": "^0.4.13",
|
|
122
122
|
"eslint-ts-patch": "9.8.0-1",
|
|
123
123
|
"eslint-typegen": "^0.3.2",
|
|
124
|
-
"esno": "^4.
|
|
124
|
+
"esno": "^4.8.0",
|
|
125
125
|
"lint-staged": "^15.2.10",
|
|
126
126
|
"prettier": "^3.3.3",
|
|
127
127
|
"react": "^18.3.1",
|
|
@@ -130,10 +130,10 @@
|
|
|
130
130
|
"simple-open-url": "^3.0.1",
|
|
131
131
|
"sucrase": "^3.35.0",
|
|
132
132
|
"tsup": "^8.3.0",
|
|
133
|
-
"typescript": "^5.6.
|
|
133
|
+
"typescript": "^5.6.3",
|
|
134
134
|
"unbuild": "^2.0.0",
|
|
135
|
-
"vitest": "^2.1.
|
|
136
|
-
"vue": "^3.5.
|
|
135
|
+
"vitest": "^2.1.3",
|
|
136
|
+
"vue": "^3.5.12"
|
|
137
137
|
},
|
|
138
138
|
"pnpm": {
|
|
139
139
|
"peerDependencyRules": {
|