@sxzz/eslint-config 7.8.3 → 7.8.5
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.d.mts +437 -153
- package/dist/index.mjs +2 -32
- package/package.json +29 -30
package/dist/index.mjs
CHANGED
|
@@ -26,15 +26,11 @@ import configCommand from "eslint-plugin-command/config";
|
|
|
26
26
|
const parserVue = __cjs_require("vue-eslint-parser");
|
|
27
27
|
const globals = __cjs_require("globals");
|
|
28
28
|
import { configs } from "eslint-plugin-regexp";
|
|
29
|
-
const {
|
|
30
|
-
defineConfig
|
|
31
|
-
} = __cjs_require("eslint/config");
|
|
29
|
+
const { defineConfig } = __cjs_require("eslint/config");
|
|
32
30
|
import process from "node:process";
|
|
33
31
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
34
|
-
|
|
35
32
|
//#region \0rolldown/runtime.js
|
|
36
33
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
37
|
-
|
|
38
34
|
//#endregion
|
|
39
35
|
//#region src/utils.ts
|
|
40
36
|
async function importWithError(pkg) {
|
|
@@ -44,7 +40,6 @@ async function importWithError(pkg) {
|
|
|
44
40
|
throw new Error(`Failed to import "${pkg}". Please install it with: npm i -D ${pkg}`);
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
|
-
|
|
48
43
|
//#endregion
|
|
49
44
|
//#region src/configs/astro.ts
|
|
50
45
|
const astro = async () => {
|
|
@@ -53,7 +48,6 @@ const astro = async () => {
|
|
|
53
48
|
name: `sxzz/${config.name || "anonymous"}`
|
|
54
49
|
}));
|
|
55
50
|
};
|
|
56
|
-
|
|
57
51
|
//#endregion
|
|
58
52
|
//#region src/configs/baseline.ts
|
|
59
53
|
const baseline = (options = {}) => [{
|
|
@@ -66,14 +60,12 @@ const baseline = (options = {}) => [{
|
|
|
66
60
|
...options
|
|
67
61
|
}] }
|
|
68
62
|
}];
|
|
69
|
-
|
|
70
63
|
//#endregion
|
|
71
64
|
//#region src/configs/command.ts
|
|
72
65
|
const command = () => [{
|
|
73
66
|
...configCommand(),
|
|
74
67
|
name: "sxzz/command"
|
|
75
68
|
}];
|
|
76
|
-
|
|
77
69
|
//#endregion
|
|
78
70
|
//#region src/configs/comments.ts
|
|
79
71
|
const comments = () => [{
|
|
@@ -83,14 +75,12 @@ const comments = () => [{
|
|
|
83
75
|
name: "sxzz/comments",
|
|
84
76
|
rules: { "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }] }
|
|
85
77
|
}];
|
|
86
|
-
|
|
87
78
|
//#endregion
|
|
88
79
|
//#region src/configs/de-morgan.ts
|
|
89
80
|
const deMorgan = () => [{
|
|
90
81
|
...pluginDeMorgan.configs.recommended,
|
|
91
82
|
name: "sxzz/de-morgan"
|
|
92
83
|
}];
|
|
93
|
-
|
|
94
84
|
//#endregion
|
|
95
85
|
//#region src/globs.ts
|
|
96
86
|
const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
@@ -154,7 +144,6 @@ const GLOB_EXCLUDE = [
|
|
|
154
144
|
"**/auto-import?(s).d.ts",
|
|
155
145
|
"**/components.d.ts"
|
|
156
146
|
];
|
|
157
|
-
|
|
158
147
|
//#endregion
|
|
159
148
|
//#region src/configs/ignores.ts
|
|
160
149
|
const ignores = () => [{
|
|
@@ -164,7 +153,6 @@ const ignores = () => [{
|
|
|
164
153
|
...pluginIgnore({ strict: false }),
|
|
165
154
|
name: "sxzz/gitignore"
|
|
166
155
|
}];
|
|
167
|
-
|
|
168
156
|
//#endregion
|
|
169
157
|
//#region src/configs/imports.ts
|
|
170
158
|
const imports = () => [{
|
|
@@ -182,7 +170,6 @@ const imports = () => [{
|
|
|
182
170
|
"import/no-named-default": "error"
|
|
183
171
|
}
|
|
184
172
|
}];
|
|
185
|
-
|
|
186
173
|
//#endregion
|
|
187
174
|
//#region src/configs/javascript.ts
|
|
188
175
|
const restrictedSyntaxJs = ["ForInStatement", "LabeledStatement"];
|
|
@@ -277,7 +264,6 @@ const javascript = () => [{
|
|
|
277
264
|
"vars-on-top": "error"
|
|
278
265
|
}
|
|
279
266
|
}];
|
|
280
|
-
|
|
281
267
|
//#endregion
|
|
282
268
|
//#region src/configs/jsdoc.ts
|
|
283
269
|
const jsdoc = () => [{
|
|
@@ -301,7 +287,6 @@ const jsdoc = () => [{
|
|
|
301
287
|
"jsdoc/require-yields-check": "warn"
|
|
302
288
|
}
|
|
303
289
|
}];
|
|
304
|
-
|
|
305
290
|
//#endregion
|
|
306
291
|
//#region src/configs/jsonc.ts
|
|
307
292
|
const jsonc = () => [...pluginJsonc.configs["recommended-with-jsonc"].map((config) => ({
|
|
@@ -314,7 +299,6 @@ const jsonc = () => [...pluginJsonc.configs["recommended-with-jsonc"].map((confi
|
|
|
314
299
|
"jsonc/quotes": "off"
|
|
315
300
|
}
|
|
316
301
|
}];
|
|
317
|
-
|
|
318
302
|
//#endregion
|
|
319
303
|
//#region src/configs/markdown.ts
|
|
320
304
|
const markdown = () => [...pluginMarkdown.configs.processor.map((config) => ({
|
|
@@ -348,7 +332,6 @@ const markdown = () => [...pluginMarkdown.configs.processor.map((config) => ({
|
|
|
348
332
|
"unused-imports/no-unused-vars": "off"
|
|
349
333
|
}
|
|
350
334
|
}];
|
|
351
|
-
|
|
352
335
|
//#endregion
|
|
353
336
|
//#region src/configs/node.ts
|
|
354
337
|
const node = () => [{
|
|
@@ -366,7 +349,6 @@ const node = () => [{
|
|
|
366
349
|
"node/process-exit-as-throw": "error"
|
|
367
350
|
}
|
|
368
351
|
}];
|
|
369
|
-
|
|
370
352
|
//#endregion
|
|
371
353
|
//#region src/configs/pnpm.ts
|
|
372
354
|
async function pnpm() {
|
|
@@ -391,7 +373,6 @@ async function pnpm() {
|
|
|
391
373
|
}
|
|
392
374
|
}];
|
|
393
375
|
}
|
|
394
|
-
|
|
395
376
|
//#endregion
|
|
396
377
|
//#region src/configs/prettier.ts
|
|
397
378
|
const rules = { ...pluginPrettierRecommended.rules };
|
|
@@ -404,14 +385,12 @@ const prettier = () => [{
|
|
|
404
385
|
"prettier/prettier": "warn"
|
|
405
386
|
}
|
|
406
387
|
}];
|
|
407
|
-
|
|
408
388
|
//#endregion
|
|
409
389
|
//#region src/configs/regexp.ts
|
|
410
390
|
const regexp = () => [{
|
|
411
391
|
...configs["flat/recommended"],
|
|
412
392
|
name: "sxzz/regexp"
|
|
413
393
|
}];
|
|
414
|
-
|
|
415
394
|
//#endregion
|
|
416
395
|
//#region src/configs/sort.ts
|
|
417
396
|
const sortPackageJson = () => [{
|
|
@@ -676,7 +655,6 @@ const sortImports = () => [{
|
|
|
676
655
|
}]
|
|
677
656
|
}
|
|
678
657
|
}];
|
|
679
|
-
|
|
680
658
|
//#endregion
|
|
681
659
|
//#region src/configs/special-cases.ts
|
|
682
660
|
const specialCases = () => [
|
|
@@ -721,7 +699,6 @@ const specialCases = () => [
|
|
|
721
699
|
rules: { "unicorn/no-anonymous-default-export": "off" }
|
|
722
700
|
}
|
|
723
701
|
];
|
|
724
|
-
|
|
725
702
|
//#endregion
|
|
726
703
|
//#region src/configs/typescript.ts
|
|
727
704
|
const typescriptCore = defineConfig({
|
|
@@ -779,7 +756,6 @@ const typescript = () => [
|
|
|
779
756
|
rules: { "@typescript-eslint/no-require-imports": "off" }
|
|
780
757
|
}
|
|
781
758
|
];
|
|
782
|
-
|
|
783
759
|
//#endregion
|
|
784
760
|
//#region src/configs/unicorn.ts
|
|
785
761
|
const unicorn = () => [{
|
|
@@ -819,7 +795,6 @@ const unicorn = () => [{
|
|
|
819
795
|
"unicorn/require-module-specifiers": "off"
|
|
820
796
|
}
|
|
821
797
|
}];
|
|
822
|
-
|
|
823
798
|
//#endregion
|
|
824
799
|
//#region src/configs/unocss.ts
|
|
825
800
|
const unocss = async () => {
|
|
@@ -828,7 +803,6 @@ const unocss = async () => {
|
|
|
828
803
|
name: "sxzz/unocss"
|
|
829
804
|
}];
|
|
830
805
|
};
|
|
831
|
-
|
|
832
806
|
//#endregion
|
|
833
807
|
//#region src/configs/vue.ts
|
|
834
808
|
const vueTs = typescriptCore.filter((config) => config.name !== "typescript-eslint/base").map((config) => {
|
|
@@ -903,7 +877,6 @@ const vue = () => [...vueTs, {
|
|
|
903
877
|
"vue/return-in-computed-property": ["error", { treatUndefinedAsUnspecified: false }]
|
|
904
878
|
}
|
|
905
879
|
}];
|
|
906
|
-
|
|
907
880
|
//#endregion
|
|
908
881
|
//#region src/configs/yml.ts
|
|
909
882
|
const yamlConfigs = Array.from(new Set([...pluginYml.configs.standard, ...pluginYml.configs.prettier]));
|
|
@@ -916,7 +889,6 @@ const yml = () => [...yamlConfigs.map((config) => ({
|
|
|
916
889
|
name: "sxzz/yaml",
|
|
917
890
|
rules: { "yml/no-empty-mapping-value": "off" }
|
|
918
891
|
}];
|
|
919
|
-
|
|
920
892
|
//#endregion
|
|
921
893
|
//#region src/env.ts
|
|
922
894
|
const cwd = process.cwd();
|
|
@@ -940,7 +912,6 @@ function isInEditorEnv() {
|
|
|
940
912
|
function isInGitHooksOrLintStaged() {
|
|
941
913
|
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
|
|
942
914
|
}
|
|
943
|
-
|
|
944
915
|
//#endregion
|
|
945
916
|
//#region src/presets.ts
|
|
946
917
|
/** Ignore common files and include javascript support */
|
|
@@ -1014,6 +985,5 @@ function sxzz(options = {}, ...userConfigs) {
|
|
|
1014
985
|
configs.push(specialCases());
|
|
1015
986
|
return new FlatConfigComposer(...configs, ...userConfigs);
|
|
1016
987
|
}
|
|
1017
|
-
|
|
1018
988
|
//#endregion
|
|
1019
|
-
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, astro, baseline, command, comments, configCommand, configComments, configJs, deMorgan, hasAstro, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, node, parserVue, pluginAntfu, pluginDeMorgan, pluginIgnore, pluginImport, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPnpm, pluginPrettier, pluginPrettierRecommended, pluginSxzz, pluginUnicorn, pluginUnusedImports, pluginVue, pluginYml, pnpm, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, regexp, restrictedSyntaxJs, sortImports, sortPackageJson, sortPnpmWorkspace, sortTsconfig, specialCases, sxzz, tseslint, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
|
989
|
+
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, astro, baseline, command, comments, configCommand, configComments, configJs, deMorgan, hasAstro, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, node, parserVue, pluginAntfu, pluginDeMorgan, pluginIgnore, pluginImport, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPnpm, pluginPrettier, pluginPrettierRecommended, pluginSxzz, pluginUnicorn, pluginUnusedImports, pluginVue, pluginYml, pnpm, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, regexp, restrictedSyntaxJs, sortImports, sortPackageJson, sortPnpmWorkspace, sortTsconfig, specialCases, sxzz, tseslint, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sxzz/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.8.
|
|
4
|
+
"version": "7.8.5",
|
|
5
5
|
"description": "ESLint config for @sxzz.",
|
|
6
6
|
"author": "Kevin Deng <sxzz@sxzz.moe>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,50 +42,49 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
45
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
46
46
|
"@eslint/js": "^10.0.1",
|
|
47
|
-
"@eslint/markdown": "^
|
|
48
|
-
"eslint-config-flat-gitignore": "^2.
|
|
47
|
+
"@eslint/markdown": "^8.0.1",
|
|
48
|
+
"eslint-config-flat-gitignore": "^2.3.0",
|
|
49
49
|
"eslint-config-prettier": "^10.1.8",
|
|
50
|
-
"eslint-flat-config-utils": "^3.0
|
|
50
|
+
"eslint-flat-config-utils": "^3.1.0",
|
|
51
51
|
"eslint-plugin-antfu": "^3.2.2",
|
|
52
|
-
"eslint-plugin-baseline-js": "^0.
|
|
52
|
+
"eslint-plugin-baseline-js": "^0.6.2",
|
|
53
53
|
"eslint-plugin-command": "^3.5.2",
|
|
54
|
-
"eslint-plugin-de-morgan": "^2.
|
|
54
|
+
"eslint-plugin-de-morgan": "^2.1.1",
|
|
55
55
|
"eslint-plugin-importer": "^0.3.0",
|
|
56
|
-
"eslint-plugin-jsdoc": "^62.
|
|
57
|
-
"eslint-plugin-jsonc": "^3.1.
|
|
56
|
+
"eslint-plugin-jsdoc": "^62.9.0",
|
|
57
|
+
"eslint-plugin-jsonc": "^3.1.2",
|
|
58
58
|
"eslint-plugin-n": "^17.24.0",
|
|
59
|
-
"eslint-plugin-perfectionist": "^5.
|
|
59
|
+
"eslint-plugin-perfectionist": "^5.9.0",
|
|
60
60
|
"eslint-plugin-pnpm": "^1.6.0",
|
|
61
61
|
"eslint-plugin-prettier": "^5.5.5",
|
|
62
|
-
"eslint-plugin-regexp": "^3.
|
|
62
|
+
"eslint-plugin-regexp": "^3.1.0",
|
|
63
63
|
"eslint-plugin-sxzz": "^0.4.4",
|
|
64
|
-
"eslint-plugin-unicorn": "^
|
|
64
|
+
"eslint-plugin-unicorn": "^64.0.0",
|
|
65
65
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
66
|
-
"eslint-plugin-vue": "^10.
|
|
67
|
-
"eslint-plugin-yml": "^3.3.
|
|
68
|
-
"globals": "^17.
|
|
66
|
+
"eslint-plugin-vue": "^10.9.0",
|
|
67
|
+
"eslint-plugin-yml": "^3.3.1",
|
|
68
|
+
"globals": "^17.5.0",
|
|
69
69
|
"jsonc-eslint-parser": "^3.1.0",
|
|
70
|
-
"typescript-eslint": "^8.
|
|
70
|
+
"typescript-eslint": "^8.59.1",
|
|
71
71
|
"vue-eslint-parser": "^10.4.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@eslint/config-inspector": "^
|
|
74
|
+
"@eslint/config-inspector": "^2.0.0",
|
|
75
75
|
"@sxzz/prettier-config": "^2.3.1",
|
|
76
|
-
"@types/node": "^25.
|
|
77
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
78
|
-
"@unocss/eslint-plugin": "^66.6.
|
|
79
|
-
"bumpp": "^
|
|
80
|
-
"eslint": "^10.
|
|
81
|
-
"eslint-plugin-astro": "^1.
|
|
76
|
+
"@types/node": "^25.6.0",
|
|
77
|
+
"@typescript/native-preview": "7.0.0-dev.20260429.1",
|
|
78
|
+
"@unocss/eslint-plugin": "^66.6.8",
|
|
79
|
+
"bumpp": "^11.0.1",
|
|
80
|
+
"eslint": "^10.2.1",
|
|
81
|
+
"eslint-plugin-astro": "^1.7.0",
|
|
82
82
|
"eslint-typegen": "^2.3.1",
|
|
83
|
-
"prettier": "^3.8.
|
|
84
|
-
"rolldown-plugin-require-cjs": "^0.
|
|
85
|
-
"tsdown": "^0.21.
|
|
86
|
-
"tsdown-preset-sxzz": "^0.
|
|
87
|
-
"typescript": "^
|
|
88
|
-
"unrun": "^0.2.28"
|
|
83
|
+
"prettier": "^3.8.3",
|
|
84
|
+
"rolldown-plugin-require-cjs": "^0.4.0",
|
|
85
|
+
"tsdown": "^0.21.10",
|
|
86
|
+
"tsdown-preset-sxzz": "^0.5.0",
|
|
87
|
+
"typescript": "^6.0.3"
|
|
89
88
|
},
|
|
90
89
|
"resolutions": {
|
|
91
90
|
"@types/eslint": "-"
|
|
@@ -94,7 +93,7 @@
|
|
|
94
93
|
"scripts": {
|
|
95
94
|
"dev": "eslint-config-inspector --config eslint-inspector.config.ts",
|
|
96
95
|
"build": "pnpm run build:typegen && tsdown",
|
|
97
|
-
"build:typegen": "
|
|
96
|
+
"build:typegen": "node scripts/typegen.ts",
|
|
98
97
|
"build:inspector": "eslint-config-inspector build --config eslint-inspector.config.ts",
|
|
99
98
|
"test": "echo Skip",
|
|
100
99
|
"lint": "eslint --max-warnings=0",
|