@sxzz/eslint-config 3.7.4 → 3.7.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/README.md +1 -1
- package/dist/index.cjs +17 -19
- package/dist/index.d.cts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +16 -19
- package/package.json +19 -19
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -89,6 +89,7 @@ __export(src_exports, {
|
|
|
89
89
|
presetLangsExtensions: () => presetLangsExtensions,
|
|
90
90
|
prettier: () => prettier,
|
|
91
91
|
reactivityTransform: () => reactivityTransform,
|
|
92
|
+
restrictedSyntaxJs: () => restrictedSyntaxJs,
|
|
92
93
|
sortKeys: () => sortKeys,
|
|
93
94
|
sortPackageJson: () => sortPackageJson,
|
|
94
95
|
sortTsconfig: () => sortTsconfig,
|
|
@@ -254,7 +255,8 @@ var imports = [
|
|
|
254
255
|
`**/pages/${GLOB_SRC}`,
|
|
255
256
|
`**/{index,vite,esbuild,rollup,webpack,rspack}.ts`,
|
|
256
257
|
"**/*.d.ts",
|
|
257
|
-
`${GLOB_MARKDOWN}
|
|
258
|
+
`${GLOB_MARKDOWN}/**`,
|
|
259
|
+
"**/.prettierrc*"
|
|
258
260
|
],
|
|
259
261
|
plugins: {
|
|
260
262
|
import: pluginImport
|
|
@@ -277,6 +279,11 @@ var hasVue = (0, import_local_pkg.isPackageExists)("vue") || (0, import_local_pk
|
|
|
277
279
|
var hasUnocss = (0, import_local_pkg.isPackageExists)("unocss") || (0, import_local_pkg.isPackageExists)("@unocss/webpack") || (0, import_local_pkg.isPackageExists)("@unocss/nuxt");
|
|
278
280
|
|
|
279
281
|
// src/configs/javascript.ts
|
|
282
|
+
var restrictedSyntaxJs = [
|
|
283
|
+
"ForInStatement",
|
|
284
|
+
"LabeledStatement",
|
|
285
|
+
"WithStatement"
|
|
286
|
+
];
|
|
280
287
|
var javascript = [
|
|
281
288
|
{
|
|
282
289
|
languageOptions: {
|
|
@@ -346,12 +353,7 @@ var javascript = [
|
|
|
346
353
|
"no-prototype-builtins": "error",
|
|
347
354
|
"no-redeclare": "error",
|
|
348
355
|
"no-regex-spaces": "error",
|
|
349
|
-
"no-restricted-syntax": [
|
|
350
|
-
"error",
|
|
351
|
-
"ForInStatement",
|
|
352
|
-
"LabeledStatement",
|
|
353
|
-
"WithStatement"
|
|
354
|
-
],
|
|
356
|
+
"no-restricted-syntax": ["error", ...restrictedSyntaxJs],
|
|
355
357
|
"no-return-await": "warn",
|
|
356
358
|
"no-self-assign": "error",
|
|
357
359
|
"no-setter-return": "error",
|
|
@@ -767,7 +769,11 @@ var typescript = [
|
|
|
767
769
|
"error",
|
|
768
770
|
{ allowBitwiseExpressions: true }
|
|
769
771
|
],
|
|
770
|
-
"
|
|
772
|
+
"no-restricted-syntax": [
|
|
773
|
+
"error",
|
|
774
|
+
...restrictedSyntaxJs,
|
|
775
|
+
"TSEnumDeclaration[const=true]"
|
|
776
|
+
]
|
|
771
777
|
}
|
|
772
778
|
},
|
|
773
779
|
{
|
|
@@ -865,16 +871,7 @@ var unicorn = [
|
|
|
865
871
|
];
|
|
866
872
|
|
|
867
873
|
// src/configs/unocss.ts
|
|
868
|
-
var unocss = [
|
|
869
|
-
{
|
|
870
|
-
plugins: {
|
|
871
|
-
"@unocss": pluginUnocss
|
|
872
|
-
},
|
|
873
|
-
rules: {
|
|
874
|
-
...pluginUnocss.configs.recommended.rules
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
];
|
|
874
|
+
var unocss = [pluginUnocss.configs.flat];
|
|
878
875
|
|
|
879
876
|
// src/configs/vue.ts
|
|
880
877
|
var import_local_pkg2 = require("local-pkg");
|
|
@@ -918,7 +915,7 @@ var vueCustomRules = {
|
|
|
918
915
|
html: {
|
|
919
916
|
component: "always",
|
|
920
917
|
normal: "always",
|
|
921
|
-
void: "
|
|
918
|
+
void: "any"
|
|
922
919
|
},
|
|
923
920
|
math: "always",
|
|
924
921
|
svg: "always"
|
|
@@ -1119,6 +1116,7 @@ function sxzz(config = [], {
|
|
|
1119
1116
|
presetLangsExtensions,
|
|
1120
1117
|
prettier,
|
|
1121
1118
|
reactivityTransform,
|
|
1119
|
+
restrictedSyntaxJs,
|
|
1122
1120
|
sortKeys,
|
|
1123
1121
|
sortPackageJson,
|
|
1124
1122
|
sortTsconfig,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
2
|
+
import * as _unocss_eslint_plugin from '@unocss/eslint-plugin';
|
|
3
|
+
import * as _typescript_eslint_eslint_plugin_use_at_your_own_risk_rules from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules';
|
|
4
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
5
|
+
import * as eslint_plugin_antfu from 'eslint-plugin-antfu';
|
|
2
6
|
import * as eslintPluginI from 'eslint-plugin-i';
|
|
3
7
|
export { eslintPluginI as pluginImport };
|
|
4
8
|
import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
@@ -24,6 +28,7 @@ declare const ignores: FlatESLintConfigItem[];
|
|
|
24
28
|
|
|
25
29
|
declare const imports: FlatESLintConfigItem[];
|
|
26
30
|
|
|
31
|
+
declare const restrictedSyntaxJs: string[];
|
|
27
32
|
declare const javascript: FlatESLintConfigItem[];
|
|
28
33
|
|
|
29
34
|
declare const jsonc: FlatESLintConfigItem[];
|
|
@@ -77,13 +82,19 @@ declare const GLOB_DIST: "**/dist";
|
|
|
77
82
|
declare const GLOB_LOCKFILE: string[];
|
|
78
83
|
declare const GLOB_EXCLUDE: string[];
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
type InteropDefault<T> = T extends {
|
|
86
|
+
default: infer U;
|
|
87
|
+
} ? U : T;
|
|
88
|
+
declare const pluginAntfu: typeof eslint_plugin_antfu.default;
|
|
81
89
|
declare const pluginComments: any;
|
|
82
90
|
declare const pluginMarkdown: any;
|
|
83
|
-
declare const pluginTypeScript:
|
|
91
|
+
declare const pluginTypeScript: {
|
|
92
|
+
configs: Record<string, _typescript_eslint_utils_ts_eslint.ClassicConfig.Config>;
|
|
93
|
+
rules: _typescript_eslint_eslint_plugin_use_at_your_own_risk_rules.TypeScriptESLintRules;
|
|
94
|
+
};
|
|
84
95
|
declare const pluginUnicorn: any;
|
|
85
96
|
declare const pluginVue: any;
|
|
86
|
-
declare const pluginUnocss:
|
|
97
|
+
declare const pluginUnocss: typeof _unocss_eslint_plugin.default;
|
|
87
98
|
declare const pluginPrettier: any;
|
|
88
99
|
declare const configPrettier: any;
|
|
89
100
|
|
|
@@ -101,4 +112,4 @@ declare function sxzz(config?: FlatESLintConfigItem | FlatESLintConfigItem[], {
|
|
|
101
112
|
sortKeys: boolean;
|
|
102
113
|
}>): FlatESLintConfigItem[];
|
|
103
114
|
|
|
104
|
-
export { GLOB_ALL_SRC, 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, all, basic, comments, configPrettier, getVueVersion, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, sortKeys, sortPackageJson, sortTsconfig, sxzz, typescript, unicorn, unocss, vue, yml };
|
|
115
|
+
export { GLOB_ALL_SRC, 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, type InteropDefault, all, basic, comments, configPrettier, getVueVersion, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, restrictedSyntaxJs, sortKeys, sortPackageJson, sortTsconfig, sxzz, typescript, unicorn, unocss, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
2
|
+
import * as _unocss_eslint_plugin from '@unocss/eslint-plugin';
|
|
3
|
+
import * as _typescript_eslint_eslint_plugin_use_at_your_own_risk_rules from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules';
|
|
4
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
5
|
+
import * as eslint_plugin_antfu from 'eslint-plugin-antfu';
|
|
2
6
|
import * as eslintPluginI from 'eslint-plugin-i';
|
|
3
7
|
export { eslintPluginI as pluginImport };
|
|
4
8
|
import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
@@ -24,6 +28,7 @@ declare const ignores: FlatESLintConfigItem[];
|
|
|
24
28
|
|
|
25
29
|
declare const imports: FlatESLintConfigItem[];
|
|
26
30
|
|
|
31
|
+
declare const restrictedSyntaxJs: string[];
|
|
27
32
|
declare const javascript: FlatESLintConfigItem[];
|
|
28
33
|
|
|
29
34
|
declare const jsonc: FlatESLintConfigItem[];
|
|
@@ -77,13 +82,19 @@ declare const GLOB_DIST: "**/dist";
|
|
|
77
82
|
declare const GLOB_LOCKFILE: string[];
|
|
78
83
|
declare const GLOB_EXCLUDE: string[];
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
type InteropDefault<T> = T extends {
|
|
86
|
+
default: infer U;
|
|
87
|
+
} ? U : T;
|
|
88
|
+
declare const pluginAntfu: typeof eslint_plugin_antfu.default;
|
|
81
89
|
declare const pluginComments: any;
|
|
82
90
|
declare const pluginMarkdown: any;
|
|
83
|
-
declare const pluginTypeScript:
|
|
91
|
+
declare const pluginTypeScript: {
|
|
92
|
+
configs: Record<string, _typescript_eslint_utils_ts_eslint.ClassicConfig.Config>;
|
|
93
|
+
rules: _typescript_eslint_eslint_plugin_use_at_your_own_risk_rules.TypeScriptESLintRules;
|
|
94
|
+
};
|
|
84
95
|
declare const pluginUnicorn: any;
|
|
85
96
|
declare const pluginVue: any;
|
|
86
|
-
declare const pluginUnocss:
|
|
97
|
+
declare const pluginUnocss: typeof _unocss_eslint_plugin.default;
|
|
87
98
|
declare const pluginPrettier: any;
|
|
88
99
|
declare const configPrettier: any;
|
|
89
100
|
|
|
@@ -101,4 +112,4 @@ declare function sxzz(config?: FlatESLintConfigItem | FlatESLintConfigItem[], {
|
|
|
101
112
|
sortKeys: boolean;
|
|
102
113
|
}>): FlatESLintConfigItem[];
|
|
103
114
|
|
|
104
|
-
export { GLOB_ALL_SRC, 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, all, basic, comments, configPrettier, getVueVersion, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, sortKeys, sortPackageJson, sortTsconfig, sxzz, typescript, unicorn, unocss, vue, yml };
|
|
115
|
+
export { GLOB_ALL_SRC, 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, type InteropDefault, all, basic, comments, configPrettier, getVueVersion, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, restrictedSyntaxJs, sortKeys, sortPackageJson, sortTsconfig, sxzz, typescript, unicorn, unocss, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -151,7 +151,8 @@ var imports = [
|
|
|
151
151
|
`**/pages/${GLOB_SRC}`,
|
|
152
152
|
`**/{index,vite,esbuild,rollup,webpack,rspack}.ts`,
|
|
153
153
|
"**/*.d.ts",
|
|
154
|
-
`${GLOB_MARKDOWN}
|
|
154
|
+
`${GLOB_MARKDOWN}/**`,
|
|
155
|
+
"**/.prettierrc*"
|
|
155
156
|
],
|
|
156
157
|
plugins: {
|
|
157
158
|
import: pluginImport
|
|
@@ -174,6 +175,11 @@ var hasVue = isPackageExists("vue") || isPackageExists("nuxt") || isPackageExist
|
|
|
174
175
|
var hasUnocss = isPackageExists("unocss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
|
|
175
176
|
|
|
176
177
|
// src/configs/javascript.ts
|
|
178
|
+
var restrictedSyntaxJs = [
|
|
179
|
+
"ForInStatement",
|
|
180
|
+
"LabeledStatement",
|
|
181
|
+
"WithStatement"
|
|
182
|
+
];
|
|
177
183
|
var javascript = [
|
|
178
184
|
{
|
|
179
185
|
languageOptions: {
|
|
@@ -243,12 +249,7 @@ var javascript = [
|
|
|
243
249
|
"no-prototype-builtins": "error",
|
|
244
250
|
"no-redeclare": "error",
|
|
245
251
|
"no-regex-spaces": "error",
|
|
246
|
-
"no-restricted-syntax": [
|
|
247
|
-
"error",
|
|
248
|
-
"ForInStatement",
|
|
249
|
-
"LabeledStatement",
|
|
250
|
-
"WithStatement"
|
|
251
|
-
],
|
|
252
|
+
"no-restricted-syntax": ["error", ...restrictedSyntaxJs],
|
|
252
253
|
"no-return-await": "warn",
|
|
253
254
|
"no-self-assign": "error",
|
|
254
255
|
"no-setter-return": "error",
|
|
@@ -664,7 +665,11 @@ var typescript = [
|
|
|
664
665
|
"error",
|
|
665
666
|
{ allowBitwiseExpressions: true }
|
|
666
667
|
],
|
|
667
|
-
"
|
|
668
|
+
"no-restricted-syntax": [
|
|
669
|
+
"error",
|
|
670
|
+
...restrictedSyntaxJs,
|
|
671
|
+
"TSEnumDeclaration[const=true]"
|
|
672
|
+
]
|
|
668
673
|
}
|
|
669
674
|
},
|
|
670
675
|
{
|
|
@@ -762,16 +767,7 @@ var unicorn = [
|
|
|
762
767
|
];
|
|
763
768
|
|
|
764
769
|
// src/configs/unocss.ts
|
|
765
|
-
var unocss = [
|
|
766
|
-
{
|
|
767
|
-
plugins: {
|
|
768
|
-
"@unocss": pluginUnocss
|
|
769
|
-
},
|
|
770
|
-
rules: {
|
|
771
|
-
...pluginUnocss.configs.recommended.rules
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
];
|
|
770
|
+
var unocss = [pluginUnocss.configs.flat];
|
|
775
771
|
|
|
776
772
|
// src/configs/vue.ts
|
|
777
773
|
import { getPackageInfoSync } from "local-pkg";
|
|
@@ -815,7 +811,7 @@ var vueCustomRules = {
|
|
|
815
811
|
html: {
|
|
816
812
|
component: "always",
|
|
817
813
|
normal: "always",
|
|
818
|
-
void: "
|
|
814
|
+
void: "any"
|
|
819
815
|
},
|
|
820
816
|
math: "always",
|
|
821
817
|
svg: "always"
|
|
@@ -1015,6 +1011,7 @@ export {
|
|
|
1015
1011
|
presetLangsExtensions,
|
|
1016
1012
|
prettier,
|
|
1017
1013
|
reactivityTransform,
|
|
1014
|
+
restrictedSyntaxJs,
|
|
1018
1015
|
sortKeys,
|
|
1019
1016
|
sortPackageJson,
|
|
1020
1017
|
sortTsconfig,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sxzz/eslint-config",
|
|
3
|
-
"version": "3.7.
|
|
4
|
-
"packageManager": "pnpm@8.
|
|
3
|
+
"version": "3.7.6",
|
|
4
|
+
"packageManager": "pnpm@8.12.1",
|
|
5
5
|
"description": "ESLint config for @sxzz.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -31,37 +31,37 @@
|
|
|
31
31
|
"eslint": "^8.0.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
35
|
-
"@typescript-eslint/parser": "^6.
|
|
36
|
-
"@unocss/eslint-plugin": "^0.
|
|
37
|
-
"eslint-config-prettier": "^9.
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
|
35
|
+
"@typescript-eslint/parser": "^6.15.0",
|
|
36
|
+
"@unocss/eslint-plugin": "^0.58.0",
|
|
37
|
+
"eslint-config-prettier": "^9.1.0",
|
|
38
38
|
"eslint-define-config": "^1.24.1",
|
|
39
|
-
"eslint-plugin-antfu": "^
|
|
39
|
+
"eslint-plugin-antfu": "^2.0.0",
|
|
40
40
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
41
|
-
"eslint-plugin-i": "^2.29.
|
|
42
|
-
"eslint-plugin-jsonc": "^2.
|
|
41
|
+
"eslint-plugin-i": "^2.29.1",
|
|
42
|
+
"eslint-plugin-jsonc": "^2.11.2",
|
|
43
43
|
"eslint-plugin-markdown": "^3.0.1",
|
|
44
44
|
"eslint-plugin-prettier": "^5.0.1",
|
|
45
45
|
"eslint-plugin-sort-keys": "^2.3.5",
|
|
46
46
|
"eslint-plugin-unicorn": "^49.0.0",
|
|
47
47
|
"eslint-plugin-unused-imports": "^3.0.0",
|
|
48
|
-
"eslint-plugin-vue": "^9.
|
|
49
|
-
"eslint-plugin-yml": "^1.
|
|
50
|
-
"globals": "^13.
|
|
48
|
+
"eslint-plugin-vue": "^9.19.2",
|
|
49
|
+
"eslint-plugin-yml": "^1.11.0",
|
|
50
|
+
"globals": "^13.24.0",
|
|
51
51
|
"jsonc-eslint-parser": "^2.4.0",
|
|
52
52
|
"local-pkg": "^0.5.0",
|
|
53
|
-
"prettier": "^3.
|
|
53
|
+
"prettier": "^3.1.1",
|
|
54
54
|
"vue-eslint-parser": "^9.3.2",
|
|
55
55
|
"yaml-eslint-parser": "^1.2.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@sxzz/prettier-config": "^
|
|
59
|
-
"@types/node": "^20.
|
|
60
|
-
"bumpp": "^9.2.
|
|
61
|
-
"eslint": "^8.
|
|
58
|
+
"@sxzz/prettier-config": "^2.0.0",
|
|
59
|
+
"@types/node": "^20.10.5",
|
|
60
|
+
"bumpp": "^9.2.1",
|
|
61
|
+
"eslint": "^8.56.0",
|
|
62
62
|
"sucrase": "^3.34.0",
|
|
63
|
-
"tsup": "^
|
|
64
|
-
"typescript": "^5.
|
|
63
|
+
"tsup": "^8.0.1",
|
|
64
|
+
"typescript": "^5.3.3"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=16.14.0"
|