@lobehub/eslint-config 2.1.3 → 2.1.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/eslint-typegen.d.ts +158 -144
- package/dist/index.cjs +72 -59
- package/dist/index.d.cts +3 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -60
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -57,6 +57,24 @@ const GLOB_TEST = [
|
|
|
57
57
|
"**/__tests__/**/*.{js,jsx,ts,tsx}"
|
|
58
58
|
];
|
|
59
59
|
const GLOB_YAML = ["**/*.yaml", "**/*.yml"];
|
|
60
|
+
const GLOB_CONFIG_FILES = ["**/*.config.{js,mjs,ts,mts,cjs,cts}"];
|
|
61
|
+
const GLOB_NEXT_APP_FILES = [
|
|
62
|
+
"**/app/**/page.{js,jsx,ts,tsx}",
|
|
63
|
+
"**/app/**/layout.{js,jsx,ts,tsx}",
|
|
64
|
+
"**/app/**/loading.{js,jsx,ts,tsx}",
|
|
65
|
+
"**/app/**/error.{js,jsx,ts,tsx}",
|
|
66
|
+
"**/app/**/not-found.{js,jsx,ts,tsx}",
|
|
67
|
+
"**/app/**/template.{js,jsx,ts,tsx}",
|
|
68
|
+
"**/app/**/default.{js,jsx,ts,tsx}",
|
|
69
|
+
"**/app/**/route.{js,ts}",
|
|
70
|
+
"**/app/**/opengraph-image.{js,jsx,ts,tsx}",
|
|
71
|
+
"**/app/**/twitter-image.{js,jsx,ts,tsx}",
|
|
72
|
+
"**/app/**/apple-icon.{js,jsx,ts,tsx}",
|
|
73
|
+
"**/app/**/icon.{js,jsx,ts,tsx}",
|
|
74
|
+
"**/app/**/sitemap.{js,ts}",
|
|
75
|
+
"**/app/**/robots.{js,ts}",
|
|
76
|
+
"**/app/**/manifest.{js,ts}"
|
|
77
|
+
];
|
|
60
78
|
const GLOB_IGNORES = [
|
|
61
79
|
"**/node_modules/**",
|
|
62
80
|
"**/dist/**",
|
|
@@ -148,51 +166,62 @@ function imports(options) {
|
|
|
148
166
|
//#region src/configs/javascript.ts
|
|
149
167
|
const GLOB_SCRIPTS = ["**/scripts/**"];
|
|
150
168
|
function javascript() {
|
|
151
|
-
return (0, eslint_config.defineConfig)([
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
globals: {
|
|
157
|
-
...globals.default.browser,
|
|
158
|
-
...globals.default.node,
|
|
159
|
-
...globals.default.es2021
|
|
160
|
-
},
|
|
161
|
-
parserOptions: {
|
|
162
|
-
ecmaFeatures: { jsx: true },
|
|
169
|
+
return (0, eslint_config.defineConfig)([
|
|
170
|
+
{
|
|
171
|
+
...__eslint_js.default.configs.recommended,
|
|
172
|
+
files: GLOB_SRC,
|
|
173
|
+
languageOptions: {
|
|
163
174
|
ecmaVersion: "latest",
|
|
175
|
+
globals: {
|
|
176
|
+
...globals.default.browser,
|
|
177
|
+
...globals.default.node,
|
|
178
|
+
...globals.default.es2021
|
|
179
|
+
},
|
|
180
|
+
parserOptions: {
|
|
181
|
+
ecmaFeatures: { jsx: true },
|
|
182
|
+
ecmaVersion: "latest",
|
|
183
|
+
sourceType: "module"
|
|
184
|
+
},
|
|
164
185
|
sourceType: "module"
|
|
165
186
|
},
|
|
166
|
-
|
|
187
|
+
linterOptions: { reportUnusedDisableDirectives: "error" },
|
|
188
|
+
rules: {
|
|
189
|
+
...__eslint_js.default.configs.recommended.rules,
|
|
190
|
+
"no-useless-rename": "error",
|
|
191
|
+
"object-shorthand": [
|
|
192
|
+
"error",
|
|
193
|
+
"properties",
|
|
194
|
+
{ avoidQuotes: true }
|
|
195
|
+
],
|
|
196
|
+
"no-console": ["error", { allow: [
|
|
197
|
+
"warn",
|
|
198
|
+
"error",
|
|
199
|
+
"info",
|
|
200
|
+
"table",
|
|
201
|
+
"group",
|
|
202
|
+
"groupCollapsed",
|
|
203
|
+
"groupEnd",
|
|
204
|
+
"assert",
|
|
205
|
+
"clear"
|
|
206
|
+
] }],
|
|
207
|
+
"no-empty": "warn",
|
|
208
|
+
"no-extra-boolean-cast": "off",
|
|
209
|
+
"no-unused-vars": "off",
|
|
210
|
+
"no-restricted-syntax": ["warn", {
|
|
211
|
+
selector: "ExportDefaultDeclaration",
|
|
212
|
+
message: "Default export is not allowed. Use named exports instead."
|
|
213
|
+
}]
|
|
214
|
+
}
|
|
167
215
|
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
{ avoidQuotes: true }
|
|
176
|
-
],
|
|
177
|
-
"no-console": ["error", { allow: [
|
|
178
|
-
"warn",
|
|
179
|
-
"error",
|
|
180
|
-
"info",
|
|
181
|
-
"table",
|
|
182
|
-
"group",
|
|
183
|
-
"groupCollapsed",
|
|
184
|
-
"groupEnd",
|
|
185
|
-
"assert",
|
|
186
|
-
"clear"
|
|
187
|
-
] }],
|
|
188
|
-
"no-empty": "warn",
|
|
189
|
-
"no-extra-boolean-cast": "off",
|
|
190
|
-
"no-unused-vars": "off"
|
|
216
|
+
{
|
|
217
|
+
files: [...GLOB_CONFIG_FILES, ...GLOB_NEXT_APP_FILES],
|
|
218
|
+
rules: { "no-restricted-syntax": "off" }
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
files: [...GLOB_TEST, ...GLOB_SCRIPTS],
|
|
222
|
+
rules: { "no-console": "off" }
|
|
191
223
|
}
|
|
192
|
-
|
|
193
|
-
files: [...GLOB_TEST, ...GLOB_SCRIPTS],
|
|
194
|
-
rules: { "no-console": "off" }
|
|
195
|
-
}]);
|
|
224
|
+
]);
|
|
196
225
|
}
|
|
197
226
|
|
|
198
227
|
//#endregion
|
|
@@ -355,7 +384,7 @@ function typescript(options) {
|
|
|
355
384
|
rules: {
|
|
356
385
|
"@typescript-eslint/consistent-type-imports": ["error", {
|
|
357
386
|
disallowTypeAnnotations: false,
|
|
358
|
-
fixStyle: "
|
|
387
|
+
fixStyle: "separate-type-imports",
|
|
359
388
|
prefer: "type-imports"
|
|
360
389
|
}],
|
|
361
390
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
@@ -390,24 +419,6 @@ function typescript(options) {
|
|
|
390
419
|
|
|
391
420
|
//#endregion
|
|
392
421
|
//#region src/configs/unicorn.ts
|
|
393
|
-
const GLOB_NEXT_APP_FILES = [
|
|
394
|
-
"**/app/**/page.{js,jsx,ts,tsx}",
|
|
395
|
-
"**/app/**/layout.{js,jsx,ts,tsx}",
|
|
396
|
-
"**/app/**/loading.{js,jsx,ts,tsx}",
|
|
397
|
-
"**/app/**/error.{js,jsx,ts,tsx}",
|
|
398
|
-
"**/app/**/not-found.{js,jsx,ts,tsx}",
|
|
399
|
-
"**/app/**/template.{js,jsx,ts,tsx}",
|
|
400
|
-
"**/app/**/default.{js,jsx,ts,tsx}",
|
|
401
|
-
"**/app/**/route.{js,ts}",
|
|
402
|
-
"**/app/**/opengraph-image.{js,jsx,ts,tsx}",
|
|
403
|
-
"**/app/**/twitter-image.{js,jsx,ts,tsx}",
|
|
404
|
-
"**/app/**/apple-icon.{js,jsx,ts,tsx}",
|
|
405
|
-
"**/app/**/icon.{js,jsx,ts,tsx}",
|
|
406
|
-
"**/app/**/sitemap.{js,ts}",
|
|
407
|
-
"**/app/**/robots.{js,ts}",
|
|
408
|
-
"**/app/**/manifest.{js,ts}"
|
|
409
|
-
];
|
|
410
|
-
const GLOB_CONFIG_FILES = ["**/*.config.{js,mjs,ts,mts,cjs,cts}"];
|
|
411
422
|
function unicorn() {
|
|
412
423
|
return (0, eslint_config.defineConfig)([
|
|
413
424
|
{
|
|
@@ -574,10 +585,12 @@ function defineConfig(options = {}, ...userConfigs) {
|
|
|
574
585
|
}
|
|
575
586
|
|
|
576
587
|
//#endregion
|
|
588
|
+
exports.GLOB_CONFIG_FILES = GLOB_CONFIG_FILES
|
|
577
589
|
exports.GLOB_IGNORES = GLOB_IGNORES
|
|
578
590
|
exports.GLOB_JS = GLOB_JS
|
|
579
591
|
exports.GLOB_JSX = GLOB_JSX
|
|
580
592
|
exports.GLOB_JS_ALL = GLOB_JS_ALL
|
|
593
|
+
exports.GLOB_NEXT_APP_FILES = GLOB_NEXT_APP_FILES
|
|
581
594
|
exports.GLOB_SRC = GLOB_SRC
|
|
582
595
|
exports.GLOB_TEST = GLOB_TEST
|
|
583
596
|
exports.GLOB_TS = GLOB_TS
|
package/dist/index.d.cts
CHANGED
|
@@ -84,6 +84,8 @@ declare const GLOB_TS_ALL: string[];
|
|
|
84
84
|
declare const GLOB_SRC: string[];
|
|
85
85
|
declare const GLOB_TEST: string[];
|
|
86
86
|
declare const GLOB_YAML: string[];
|
|
87
|
+
declare const GLOB_CONFIG_FILES: string[];
|
|
88
|
+
declare const GLOB_NEXT_APP_FILES: string[];
|
|
87
89
|
declare const GLOB_IGNORES: string[];
|
|
88
90
|
|
|
89
91
|
//#endregion
|
|
@@ -92,5 +94,5 @@ declare const GLOB_IGNORES: string[];
|
|
|
92
94
|
declare function defineConfig(options?: Options, ...userConfigs: FlatConfig[]): FlatConfigArray;
|
|
93
95
|
|
|
94
96
|
//#endregion
|
|
95
|
-
export { FlatConfig, FlatConfigArray, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_JS_ALL, GLOB_SRC, GLOB_TEST, GLOB_TS, GLOB_TSX, GLOB_TS_ALL, GLOB_YAML, Linter, Options, ParserOptions, defineConfig };
|
|
97
|
+
export { FlatConfig, FlatConfigArray, GLOB_CONFIG_FILES, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_JS_ALL, GLOB_NEXT_APP_FILES, GLOB_SRC, GLOB_TEST, GLOB_TS, GLOB_TSX, GLOB_TS_ALL, GLOB_YAML, Linter, Options, ParserOptions, defineConfig };
|
|
96
98
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/globs.ts","../src/index.ts"],"sourcesContent":null,"mappings":";;;;UAGiB,OAAA;;AAAjB;AAmFA;AACA;;;;ACvFA;EACa,OAAA,CAAA,EAAA,MAAQ,EAAA;EACR;AACb;AAEA;AACA;EACa,IAAA,CAAA,EAAA,OAA2C;EAE3C;AAMb;AAEA;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/globs.ts","../src/index.ts"],"sourcesContent":null,"mappings":";;;;UAGiB,OAAA;;AAAjB;AAmFA;AACA;;;;ACvFA;EACa,OAAA,CAAA,EAAA,MAAQ,EAAA;EACR;AACb;AAEA;AACA;EACa,IAAA,CAAA,EAAA,OAA2C;EAE3C;AAMb;AAEA;EAEa,aAAA,CAAA,EDKK,eCWjB;EAEY;;;;EChBG,KAAA,CAAA,EAAA,OAAY,GAAA,MAAA,GAAA,OAAA,GAAA,MAAA,GAAA,MAAA;EAAA;;;;EAAsE,aAAA,CAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KFiEtF,UAAA,GAAa,QAAA,CAAO;KACpB,eAAA,GAAkB,QAAA,CAAO;;cCvFxB,OAAA;cACA,QAAA;cACA,OAAA;cACA,QAAA;ADAI,cCEJ,WDmBK,EAAA,MAAa,EAAA;AA8DnB,cChFC,WDgFY,EAAA,MAAO,EAAA;AACpB,cChFC,QDgFc,EAAA,MAAG,EAAA;cC9EjB;cAMA;cAEA;AAjBA,cAmBA,mBAnBO,EAAA,MAAA,EAAA;AACP,cAoCA,YApCQ,EAAA,MAAA,EAAA;;;;AACrB;iBCmBgB,YAAA,WAAsB,yBAA8B,eAAe"}
|
package/dist/index.d.ts
CHANGED
|
@@ -84,6 +84,8 @@ declare const GLOB_TS_ALL: string[];
|
|
|
84
84
|
declare const GLOB_SRC: string[];
|
|
85
85
|
declare const GLOB_TEST: string[];
|
|
86
86
|
declare const GLOB_YAML: string[];
|
|
87
|
+
declare const GLOB_CONFIG_FILES: string[];
|
|
88
|
+
declare const GLOB_NEXT_APP_FILES: string[];
|
|
87
89
|
declare const GLOB_IGNORES: string[];
|
|
88
90
|
|
|
89
91
|
//#endregion
|
|
@@ -92,5 +94,5 @@ declare const GLOB_IGNORES: string[];
|
|
|
92
94
|
declare function defineConfig(options?: Options, ...userConfigs: FlatConfig[]): FlatConfigArray;
|
|
93
95
|
|
|
94
96
|
//#endregion
|
|
95
|
-
export { FlatConfig, FlatConfigArray, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_JS_ALL, GLOB_SRC, GLOB_TEST, GLOB_TS, GLOB_TSX, GLOB_TS_ALL, GLOB_YAML, Linter, Options, ParserOptions, defineConfig };
|
|
97
|
+
export { FlatConfig, FlatConfigArray, GLOB_CONFIG_FILES, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_JS_ALL, GLOB_NEXT_APP_FILES, GLOB_SRC, GLOB_TEST, GLOB_TS, GLOB_TSX, GLOB_TS_ALL, GLOB_YAML, Linter, Options, ParserOptions, defineConfig };
|
|
96
98
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/globs.ts","../src/index.ts"],"sourcesContent":null,"mappings":";;;;UAGiB,OAAA;;AAAjB;AAmFA;AACA;;;;ACvFA;EACa,OAAA,CAAA,EAAA,MAAQ,EAAA;EACR;AACb;AAEA;AACA;EACa,IAAA,CAAA,EAAA,OAA2C;EAE3C;AAMb;AAEA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/globs.ts","../src/index.ts"],"sourcesContent":null,"mappings":";;;;UAGiB,OAAA;;AAAjB;AAmFA;AACA;;;;ACvFA;EACa,OAAA,CAAA,EAAA,MAAQ,EAAA;EACR;AACb;AAEA;AACA;EACa,IAAA,CAAA,EAAA,OAA2C;EAE3C;AAMb;AAEA;EAEa,aAAA,CAAA,EDKK,eCWjB;EAEY;;;;EChBG,KAAA,CAAA,EAAA,OAAY,GAAA,MAAA,GAAA,OAAA,GAAA,MAAA,GAAA,MAAA;EAAA;;;;EAAsE,aAAA,CAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KFiEtF,UAAA,GAAa,QAAA,CAAO;KACpB,eAAA,GAAkB,QAAA,CAAO;;cCvFxB,OAAA;cACA,QAAA;cACA,OAAA;cACA,QAAA;ADAI,cCEJ,WDmBK,EAAA,MAAa,EAAA;AA8DnB,cChFC,WDgFY,EAAA,MAAO,EAAA;AACpB,cChFC,QDgFc,EAAA,MAAG,EAAA;cC9EjB;cAMA;cAEA;AAjBA,cAmBA,mBAnBO,EAAA,MAAA,EAAA;AACP,cAoCA,YApCQ,EAAA,MAAA,EAAA;;;;AACrB;iBCmBgB,YAAA,WAAsB,yBAA8B,eAAe"}
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,24 @@ const GLOB_TEST = [
|
|
|
33
33
|
"**/__tests__/**/*.{js,jsx,ts,tsx}"
|
|
34
34
|
];
|
|
35
35
|
const GLOB_YAML = ["**/*.yaml", "**/*.yml"];
|
|
36
|
+
const GLOB_CONFIG_FILES = ["**/*.config.{js,mjs,ts,mts,cjs,cts}"];
|
|
37
|
+
const GLOB_NEXT_APP_FILES = [
|
|
38
|
+
"**/app/**/page.{js,jsx,ts,tsx}",
|
|
39
|
+
"**/app/**/layout.{js,jsx,ts,tsx}",
|
|
40
|
+
"**/app/**/loading.{js,jsx,ts,tsx}",
|
|
41
|
+
"**/app/**/error.{js,jsx,ts,tsx}",
|
|
42
|
+
"**/app/**/not-found.{js,jsx,ts,tsx}",
|
|
43
|
+
"**/app/**/template.{js,jsx,ts,tsx}",
|
|
44
|
+
"**/app/**/default.{js,jsx,ts,tsx}",
|
|
45
|
+
"**/app/**/route.{js,ts}",
|
|
46
|
+
"**/app/**/opengraph-image.{js,jsx,ts,tsx}",
|
|
47
|
+
"**/app/**/twitter-image.{js,jsx,ts,tsx}",
|
|
48
|
+
"**/app/**/apple-icon.{js,jsx,ts,tsx}",
|
|
49
|
+
"**/app/**/icon.{js,jsx,ts,tsx}",
|
|
50
|
+
"**/app/**/sitemap.{js,ts}",
|
|
51
|
+
"**/app/**/robots.{js,ts}",
|
|
52
|
+
"**/app/**/manifest.{js,ts}"
|
|
53
|
+
];
|
|
36
54
|
const GLOB_IGNORES = [
|
|
37
55
|
"**/node_modules/**",
|
|
38
56
|
"**/dist/**",
|
|
@@ -124,51 +142,62 @@ function imports(options) {
|
|
|
124
142
|
//#region src/configs/javascript.ts
|
|
125
143
|
const GLOB_SCRIPTS = ["**/scripts/**"];
|
|
126
144
|
function javascript() {
|
|
127
|
-
return defineConfig$1([
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
globals: {
|
|
133
|
-
...globals.browser,
|
|
134
|
-
...globals.node,
|
|
135
|
-
...globals.es2021
|
|
136
|
-
},
|
|
137
|
-
parserOptions: {
|
|
138
|
-
ecmaFeatures: { jsx: true },
|
|
145
|
+
return defineConfig$1([
|
|
146
|
+
{
|
|
147
|
+
...js.configs.recommended,
|
|
148
|
+
files: GLOB_SRC,
|
|
149
|
+
languageOptions: {
|
|
139
150
|
ecmaVersion: "latest",
|
|
151
|
+
globals: {
|
|
152
|
+
...globals.browser,
|
|
153
|
+
...globals.node,
|
|
154
|
+
...globals.es2021
|
|
155
|
+
},
|
|
156
|
+
parserOptions: {
|
|
157
|
+
ecmaFeatures: { jsx: true },
|
|
158
|
+
ecmaVersion: "latest",
|
|
159
|
+
sourceType: "module"
|
|
160
|
+
},
|
|
140
161
|
sourceType: "module"
|
|
141
162
|
},
|
|
142
|
-
|
|
163
|
+
linterOptions: { reportUnusedDisableDirectives: "error" },
|
|
164
|
+
rules: {
|
|
165
|
+
...js.configs.recommended.rules,
|
|
166
|
+
"no-useless-rename": "error",
|
|
167
|
+
"object-shorthand": [
|
|
168
|
+
"error",
|
|
169
|
+
"properties",
|
|
170
|
+
{ avoidQuotes: true }
|
|
171
|
+
],
|
|
172
|
+
"no-console": ["error", { allow: [
|
|
173
|
+
"warn",
|
|
174
|
+
"error",
|
|
175
|
+
"info",
|
|
176
|
+
"table",
|
|
177
|
+
"group",
|
|
178
|
+
"groupCollapsed",
|
|
179
|
+
"groupEnd",
|
|
180
|
+
"assert",
|
|
181
|
+
"clear"
|
|
182
|
+
] }],
|
|
183
|
+
"no-empty": "warn",
|
|
184
|
+
"no-extra-boolean-cast": "off",
|
|
185
|
+
"no-unused-vars": "off",
|
|
186
|
+
"no-restricted-syntax": ["warn", {
|
|
187
|
+
selector: "ExportDefaultDeclaration",
|
|
188
|
+
message: "Default export is not allowed. Use named exports instead."
|
|
189
|
+
}]
|
|
190
|
+
}
|
|
143
191
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
{ avoidQuotes: true }
|
|
152
|
-
],
|
|
153
|
-
"no-console": ["error", { allow: [
|
|
154
|
-
"warn",
|
|
155
|
-
"error",
|
|
156
|
-
"info",
|
|
157
|
-
"table",
|
|
158
|
-
"group",
|
|
159
|
-
"groupCollapsed",
|
|
160
|
-
"groupEnd",
|
|
161
|
-
"assert",
|
|
162
|
-
"clear"
|
|
163
|
-
] }],
|
|
164
|
-
"no-empty": "warn",
|
|
165
|
-
"no-extra-boolean-cast": "off",
|
|
166
|
-
"no-unused-vars": "off"
|
|
192
|
+
{
|
|
193
|
+
files: [...GLOB_CONFIG_FILES, ...GLOB_NEXT_APP_FILES],
|
|
194
|
+
rules: { "no-restricted-syntax": "off" }
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
files: [...GLOB_TEST, ...GLOB_SCRIPTS],
|
|
198
|
+
rules: { "no-console": "off" }
|
|
167
199
|
}
|
|
168
|
-
|
|
169
|
-
files: [...GLOB_TEST, ...GLOB_SCRIPTS],
|
|
170
|
-
rules: { "no-console": "off" }
|
|
171
|
-
}]);
|
|
200
|
+
]);
|
|
172
201
|
}
|
|
173
202
|
|
|
174
203
|
//#endregion
|
|
@@ -331,7 +360,7 @@ function typescript(options) {
|
|
|
331
360
|
rules: {
|
|
332
361
|
"@typescript-eslint/consistent-type-imports": ["error", {
|
|
333
362
|
disallowTypeAnnotations: false,
|
|
334
|
-
fixStyle: "
|
|
363
|
+
fixStyle: "separate-type-imports",
|
|
335
364
|
prefer: "type-imports"
|
|
336
365
|
}],
|
|
337
366
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
@@ -366,24 +395,6 @@ function typescript(options) {
|
|
|
366
395
|
|
|
367
396
|
//#endregion
|
|
368
397
|
//#region src/configs/unicorn.ts
|
|
369
|
-
const GLOB_NEXT_APP_FILES = [
|
|
370
|
-
"**/app/**/page.{js,jsx,ts,tsx}",
|
|
371
|
-
"**/app/**/layout.{js,jsx,ts,tsx}",
|
|
372
|
-
"**/app/**/loading.{js,jsx,ts,tsx}",
|
|
373
|
-
"**/app/**/error.{js,jsx,ts,tsx}",
|
|
374
|
-
"**/app/**/not-found.{js,jsx,ts,tsx}",
|
|
375
|
-
"**/app/**/template.{js,jsx,ts,tsx}",
|
|
376
|
-
"**/app/**/default.{js,jsx,ts,tsx}",
|
|
377
|
-
"**/app/**/route.{js,ts}",
|
|
378
|
-
"**/app/**/opengraph-image.{js,jsx,ts,tsx}",
|
|
379
|
-
"**/app/**/twitter-image.{js,jsx,ts,tsx}",
|
|
380
|
-
"**/app/**/apple-icon.{js,jsx,ts,tsx}",
|
|
381
|
-
"**/app/**/icon.{js,jsx,ts,tsx}",
|
|
382
|
-
"**/app/**/sitemap.{js,ts}",
|
|
383
|
-
"**/app/**/robots.{js,ts}",
|
|
384
|
-
"**/app/**/manifest.{js,ts}"
|
|
385
|
-
];
|
|
386
|
-
const GLOB_CONFIG_FILES = ["**/*.config.{js,mjs,ts,mts,cjs,cts}"];
|
|
387
398
|
function unicorn() {
|
|
388
399
|
return defineConfig$1([
|
|
389
400
|
{
|
|
@@ -550,5 +561,5 @@ function defineConfig(options = {}, ...userConfigs) {
|
|
|
550
561
|
}
|
|
551
562
|
|
|
552
563
|
//#endregion
|
|
553
|
-
export { GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_JS_ALL, GLOB_SRC, GLOB_TEST, GLOB_TS, GLOB_TSX, GLOB_TS_ALL, GLOB_YAML, defineConfig };
|
|
564
|
+
export { GLOB_CONFIG_FILES, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_JS_ALL, GLOB_NEXT_APP_FILES, GLOB_SRC, GLOB_TEST, GLOB_TS, GLOB_TSX, GLOB_TS_ALL, GLOB_YAML, defineConfig };
|
|
554
565
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["options: Options","userIgnores: string[]","options: Options","options: Options","options: Options","options: Options","options: Options","options: Options","options: Options","options: Options","options: Options","configs: FlatConfigArray"],"sources":["../src/globs.ts","../src/configs/a11y.ts","../src/configs/eslint-comments.ts","../src/configs/ignores.ts","../src/configs/imports.ts","../src/configs/javascript.ts","../src/configs/next.ts","../src/configs/react.ts","../src/configs/react-native.ts","../src/configs/regexp.ts","../src/configs/sorting.ts","../src/configs/typescript.ts","../src/configs/unicorn.ts","../src/configs/unused.ts","../src/configs/yml.ts","../src/index.ts"],"sourcesContent":["export const GLOB_JS = '**/*.?([cm])js';\nexport const GLOB_JSX = '**/*.?([cm])jsx';\nexport const GLOB_TS = '**/*.?([cm])ts';\nexport const GLOB_TSX = '**/*.?([cm])tsx';\n\nexport const GLOB_JS_ALL = [GLOB_JS, GLOB_JSX];\nexport const GLOB_TS_ALL = [GLOB_TS, GLOB_TSX];\nexport const GLOB_SRC = [...GLOB_JS_ALL, ...GLOB_TS_ALL];\n\nexport const GLOB_TEST = [\n '**/*.test.{js,jsx,ts,tsx}',\n '**/*.spec.{js,jsx,ts,tsx}',\n '**/__tests__/**/*.{js,jsx,ts,tsx}',\n];\n\nexport const GLOB_YAML = ['**/*.yaml', '**/*.yml'];\n\nexport const GLOB_IGNORES = [\n '**/node_modules/**',\n '**/dist/**',\n '**/build/**',\n '**/.next/**',\n '**/coverage/**',\n '**/.turbo/**',\n '**/out/**',\n '**/*.min.*',\n '**/public/**',\n];\n","import { defineConfig } from 'eslint/config';\nimport jsxA11y from 'eslint-plugin-jsx-a11y';\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs';\nimport { type Options } from '../types';\n\nexport function a11y(options: Options) {\n const { a11y: a11yOption, react: reactOption } = options;\n\n if (!a11yOption || !reactOption) return [];\n\n const files = [GLOB_JSX, GLOB_TSX];\n\n return defineConfig([\n {\n files,\n plugins: {\n 'jsx-a11y': jsxA11y,\n },\n rules: {\n ...jsxA11y.flatConfigs.recommended.rules,\n 'jsx-a11y/alt-text': 'warn',\n 'jsx-a11y/anchor-has-content': 'warn',\n 'jsx-a11y/anchor-is-valid': 'warn',\n 'jsx-a11y/click-events-have-key-events': 'warn',\n 'jsx-a11y/no-static-element-interactions': 'warn',\n },\n },\n ]);\n}\n","import eslintComments from '@eslint-community/eslint-plugin-eslint-comments/configs';\nimport { defineConfig } from 'eslint/config';\n\nimport { GLOB_SRC } from '../globs';\n\nexport function eslintCommentsConfig() {\n return defineConfig([\n {\n ...eslintComments.recommended,\n files: GLOB_SRC,\n rules: {\n ...eslintComments.recommended.rules,\n // 允许文件级别的 eslint-disable 没有对应的 eslint-enable\n '@eslint-community/eslint-comments/disable-enable-pair': 'off',\n // 禁止未使用的 eslint-disable 注释(可自动修复)\n '@eslint-community/eslint-comments/no-unused-disable': 'error',\n // 禁止没有规则名的 eslint-disable(必须指定具体规则)\n '@eslint-community/eslint-comments/no-unlimited-disable': 'error',\n // 禁止重复的 eslint-disable\n '@eslint-community/eslint-comments/no-duplicate-disable': 'error',\n // 禁止一个 eslint-enable 同时启用多个 eslint-disable(鼓励合并多行 disable 注释)\n '@eslint-community/eslint-comments/no-aggregating-enable': 'error',\n },\n },\n ]);\n}\n","import { GLOB_IGNORES } from '../globs';\nimport { type FlatConfig } from '../types';\n\nexport function ignores(userIgnores: string[] = []): FlatConfig {\n return {\n ignores: [...GLOB_IGNORES, ...userIgnores],\n };\n}\n","import { defineConfig } from 'eslint/config';\nimport { importX } from 'eslint-plugin-import-x';\nimport simpleImportSort from 'eslint-plugin-simple-import-sort';\n\nimport { GLOB_SRC } from '../globs';\nimport { type Options } from '../types';\n\nexport function imports(options: Options) {\n const { sortImports = true } = options;\n\n const configs = defineConfig([\n {\n files: GLOB_SRC,\n plugins: {\n 'import-x': importX as any,\n },\n settings: {\n 'import-x/resolver': {\n node: true,\n typescript: true,\n },\n },\n rules: {\n 'import-x/first': 'error',\n 'import-x/newline-after-import': 'error',\n 'import-x/no-duplicates': 'error',\n 'import-x/no-mutable-exports': 'error',\n 'import-x/no-self-import': 'error',\n 'import-x/consistent-type-specifier-style': 0,\n },\n },\n ]);\n\n if (sortImports) {\n configs.push({\n files: GLOB_SRC,\n plugins: {\n 'simple-import-sort': simpleImportSort,\n },\n rules: {\n 'simple-import-sort/imports': 'error',\n 'simple-import-sort/exports': 'error',\n 'sort-imports': 'off',\n },\n });\n }\n\n return configs;\n}\n","import js from '@eslint/js';\nimport { defineConfig } from 'eslint/config';\nimport globals from 'globals';\n\nimport { GLOB_SRC, GLOB_TEST } from '../globs';\n\nconst GLOB_SCRIPTS = ['**/scripts/**'];\n\nexport function javascript() {\n return defineConfig([\n {\n ...js.configs.recommended,\n files: GLOB_SRC,\n languageOptions: {\n ecmaVersion: 'latest',\n globals: {\n ...globals.browser,\n ...globals.node,\n ...globals.es2021,\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n ecmaVersion: 'latest',\n sourceType: 'module',\n },\n sourceType: 'module',\n },\n linterOptions: {\n reportUnusedDisableDirectives: 'error',\n },\n rules: {\n ...js.configs.recommended.rules,\n 'no-useless-rename': 'error',\n 'object-shorthand': ['error', 'properties', { avoidQuotes: true }],\n // Only disallow console.log, allow console.warn/error/info/etc.\n 'no-console': [\n 'error',\n {\n allow: [\n 'warn',\n 'error',\n 'info',\n\n 'table',\n\n 'group',\n 'groupCollapsed',\n 'groupEnd',\n\n 'assert',\n 'clear',\n ],\n },\n ],\n 'no-empty': 'warn',\n 'no-extra-boolean-cast': 'off',\n 'no-unused-vars': 'off',\n },\n },\n // Allow all console in test and script files\n {\n files: [...GLOB_TEST, ...GLOB_SCRIPTS],\n rules: {\n 'no-console': 'off',\n },\n },\n ]);\n}\n","import nextPlugin from '@next/eslint-plugin-next';\nimport { defineConfig } from 'eslint/config';\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs';\nimport { type Options } from '../types';\n\nexport function next(options: Options) {\n const { next: nextOption } = options;\n\n if (!nextOption) return [];\n\n const files = [GLOB_JSX, GLOB_TSX];\n\n return defineConfig([\n {\n files,\n plugins: {\n '@next/next': nextPlugin,\n },\n rules: {\n ...nextPlugin.configs.recommended.rules,\n ...nextPlugin.configs['core-web-vitals'].rules,\n '@next/next/no-img-element': 'off',\n },\n },\n ]);\n}\n","import eslintReact from '@eslint-react/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport reactPlugin from 'eslint-plugin-react';\nimport reactCompiler from 'eslint-plugin-react-compiler';\nimport reactHooksPlugin from 'eslint-plugin-react-hooks';\nimport reactRefresh from 'eslint-plugin-react-refresh';\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs';\nimport { type Options } from '../types';\n\nexport function react(options: Options) {\n const { react: reactOption, reactCompiler: reactCompilerOption } = options;\n\n if (!reactOption) return [];\n\n const files = [GLOB_JSX, GLOB_TSX];\n\n const configs = defineConfig([\n {\n files,\n ...eslintReact.configs['recommended-typescript'],\n },\n {\n files,\n plugins: {\n 'react': reactPlugin,\n 'react-hooks': reactHooksPlugin,\n 'react-refresh': reactRefresh,\n },\n rules: {\n ...reactHooksPlugin.configs.recommended.rules,\n\n '@eslint-react/dom/no-dangerously-set-innerhtml': 'off',\n '@eslint-react/no-array-index-key': 'warn',\n '@eslint-react/no-leaked-conditional-rendering': 'off',\n\n 'react/self-closing-comp': 'warn',\n\n 'react-refresh/only-export-components': [\n 'warn',\n {\n allowConstantExport: true,\n allowExportNames:\n reactOption === 'next'\n ? [\n 'dynamic',\n 'dynamicParams',\n 'revalidate',\n 'fetchCache',\n 'runtime',\n 'preferredRegion',\n 'maxDuration',\n 'config',\n 'generateStaticParams',\n 'metadata',\n 'generateMetadata',\n 'viewport',\n 'generateViewport',\n ]\n : reactOption === 'remix'\n ? ['meta', 'links', 'headers', 'loader', 'action']\n : undefined,\n },\n ],\n },\n settings: {\n 'react-x': {\n version: 'detect',\n },\n },\n },\n ]);\n\n if (reactCompilerOption) {\n configs.push({\n files,\n plugins: {\n 'react-compiler': reactCompiler,\n },\n rules: {\n 'react-compiler/react-compiler': 'error',\n },\n });\n }\n\n return configs;\n}\n","import { defineConfig } from 'eslint/config';\nimport reactNativePlugin from 'eslint-plugin-react-native';\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs';\nimport { type Options } from '../types';\n\nexport function reactNative(options: Options) {\n const { reactNative: reactNativeOption } = options;\n\n if (!reactNativeOption) return [];\n\n const files = [GLOB_JSX, GLOB_TSX];\n\n return defineConfig([\n {\n files,\n plugins: {\n 'react-native': reactNativePlugin,\n },\n languageOptions: {\n globals: {\n __DEV__: 'readonly',\n },\n },\n rules: {\n 'react-native/no-color-literals': 'warn',\n 'react-native/no-inline-styles': 'warn',\n 'react-native/no-raw-text': 'off',\n 'react-native/no-single-element-style-arrays': 'warn',\n 'react-native/no-unused-styles': 'error',\n 'react-native/split-platform-components': 'warn',\n },\n },\n ]);\n}\n","import { defineConfig } from 'eslint/config';\nimport regexpPlugin from 'eslint-plugin-regexp';\n\nimport { GLOB_SRC } from '../globs';\nimport { type Options } from '../types';\n\nexport function regexp(options: Options) {\n const { regexp: regexpOption = true } = options;\n\n if (!regexpOption) return [];\n\n return defineConfig([\n {\n files: GLOB_SRC,\n plugins: {\n regexp: regexpPlugin,\n },\n rules: {\n ...regexpPlugin.configs['flat/recommended'].rules,\n },\n },\n ]);\n}\n","import { defineConfig } from 'eslint/config';\nimport perfectionistPlugin from 'eslint-plugin-perfectionist';\nimport reactPlugin from 'eslint-plugin-react';\n\nimport { GLOB_JSX, GLOB_TS_ALL, GLOB_TSX } from '../globs';\nimport { type Options } from '../types';\n\nexport function sorting(options: Options) {\n const { sortKeys = true } = options;\n\n if (!sortKeys) return [];\n\n return defineConfig([\n // TypeScript interface and enum sorting\n {\n files: GLOB_TS_ALL,\n plugins: {\n perfectionist: perfectionistPlugin,\n },\n rules: {\n 'perfectionist/sort-enums': [\n 'error',\n {\n order: 'asc',\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n {\n order: 'asc',\n type: 'natural',\n },\n ],\n },\n },\n // JSX props sorting\n {\n files: [GLOB_JSX, GLOB_TSX],\n plugins: {\n react: reactPlugin,\n },\n rules: {\n 'react/jsx-sort-props': [\n 'warn',\n {\n callbacksLast: true,\n multiline: 'last',\n shorthandFirst: true,\n },\n ],\n },\n },\n ]);\n}\n","import { defineConfig } from 'eslint/config';\nimport tseslint from 'typescript-eslint';\n\nimport { GLOB_TS_ALL } from '../globs';\nimport { type Options } from '../types';\n\nexport function typescript(options: Options) {\n const {\n typescript: tsOption,\n typeChecked,\n tsconfigPath,\n parserOptions: userParserOptions,\n } = options;\n\n if (!tsOption) return [];\n\n const isStrict = tsOption === 'strict';\n\n const baseConfigs = isStrict\n ? typeChecked\n ? tseslint.configs.strictTypeChecked\n : tseslint.configs.strict\n : typeChecked\n ? tseslint.configs.recommendedTypeChecked\n : tseslint.configs.recommended;\n\n const configs = defineConfig([\n ...baseConfigs,\n {\n files: GLOB_TS_ALL,\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n ...(typeChecked && {\n projectService: !tsconfigPath,\n project: tsconfigPath,\n }),\n ...userParserOptions,\n },\n },\n rules: {\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {\n disallowTypeAnnotations: false,\n fixStyle: 'inline-type-imports',\n prefer: 'type-imports',\n },\n ],\n '@typescript-eslint/method-signature-style': ['error', 'property'],\n '@typescript-eslint/no-import-type-side-effects': 'off',\n '@typescript-eslint/no-unused-expressions': [\n 'error',\n {\n allowShortCircuit: true,\n allowTaggedTemplates: true,\n allowTernary: true,\n },\n ],\n\n ...(isStrict\n ? {}\n : {\n '@typescript-eslint/ban-ts-comment': 'off',\n '@typescript-eslint/no-explicit-any': 'off',\n '@typescript-eslint/no-empty-object-type': 'off',\n '@typescript-eslint/no-require-imports': 'off',\n }),\n\n '@typescript-eslint/no-unused-vars': 'off',\n '@typescript-eslint/no-use-before-define': 'off',\n '@typescript-eslint/no-useless-constructor': 'off',\n },\n },\n ]);\n\n if (typeChecked) {\n configs.push({\n files: GLOB_TS_ALL,\n rules: {\n '@typescript-eslint/await-thenable': 'error',\n '@typescript-eslint/no-floating-promises': 'error',\n '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],\n '@typescript-eslint/require-await': 'error',\n },\n });\n }\n\n return configs;\n}\n","import { defineConfig } from 'eslint/config';\nimport unicornPlugin from 'eslint-plugin-unicorn';\n\nimport { GLOB_SRC } from '../globs';\n\nconst GLOB_NEXT_APP_FILES = [\n '**/app/**/page.{js,jsx,ts,tsx}',\n '**/app/**/layout.{js,jsx,ts,tsx}',\n '**/app/**/loading.{js,jsx,ts,tsx}',\n '**/app/**/error.{js,jsx,ts,tsx}',\n '**/app/**/not-found.{js,jsx,ts,tsx}',\n '**/app/**/template.{js,jsx,ts,tsx}',\n '**/app/**/default.{js,jsx,ts,tsx}',\n '**/app/**/route.{js,ts}',\n '**/app/**/opengraph-image.{js,jsx,ts,tsx}',\n '**/app/**/twitter-image.{js,jsx,ts,tsx}',\n '**/app/**/apple-icon.{js,jsx,ts,tsx}',\n '**/app/**/icon.{js,jsx,ts,tsx}',\n '**/app/**/sitemap.{js,ts}',\n '**/app/**/robots.{js,ts}',\n '**/app/**/manifest.{js,ts}',\n];\n\nconst GLOB_CONFIG_FILES = ['**/*.config.{js,mjs,ts,mts,cjs,cts}'];\n\nexport function unicorn() {\n return defineConfig([\n {\n files: GLOB_SRC,\n plugins: {\n unicorn: unicornPlugin,\n },\n rules: {\n // ===== Error Prevention / Bug Detection =====\n 'unicorn/better-regex': 'warn',\n 'unicorn/error-message': 'error',\n 'unicorn/new-for-builtins': 'error',\n 'unicorn/no-abusive-eslint-disable': 'error',\n 'unicorn/no-accessor-recursion': 'error',\n 'unicorn/no-await-in-promise-methods': 'error',\n 'unicorn/no-immediate-mutation': 'error',\n 'unicorn/no-instanceof-builtins': 'error',\n 'unicorn/no-invalid-fetch-options': 'error',\n 'unicorn/no-invalid-remove-event-listener': 'error',\n 'unicorn/no-negation-in-equality-check': 'error',\n 'unicorn/no-single-promise-in-promise-methods': 'error',\n 'unicorn/no-thenable': 'error',\n 'unicorn/throw-new-error': 'error',\n\n // ===== Code Cleanliness =====\n 'unicorn/escape-case': 'warn',\n 'unicorn/no-anonymous-default-export': 'error',\n 'unicorn/no-console-spaces': 'warn',\n 'unicorn/no-empty-file': 'warn',\n 'unicorn/no-lonely-if': 'warn',\n 'unicorn/no-new-array': 'error',\n 'unicorn/no-new-buffer': 'error',\n 'unicorn/no-unnecessary-await': 'error',\n 'unicorn/no-unreadable-iife': 'warn',\n 'unicorn/no-useless-fallback-in-spread': 'warn',\n 'unicorn/no-useless-length-check': 'warn',\n 'unicorn/no-useless-promise-resolve-reject': 'warn',\n 'unicorn/no-useless-spread': 'warn',\n 'unicorn/no-useless-switch-case': 'warn',\n 'unicorn/no-zero-fractions': 'warn',\n 'unicorn/number-literal-case': 'warn',\n 'unicorn/switch-case-braces': 'warn',\n 'unicorn/text-encoding-identifier-case': 'warn',\n 'unicorn/import-style': 'warn',\n\n // ===== Modern APIs =====\n 'unicorn/prefer-array-find': 'warn',\n 'unicorn/prefer-array-flat': 'warn',\n 'unicorn/prefer-array-flat-map': 'warn',\n 'unicorn/prefer-array-index-of': 'warn',\n 'unicorn/prefer-array-some': 'warn',\n 'unicorn/prefer-at': 'warn',\n 'unicorn/prefer-date-now': 'warn',\n 'unicorn/prefer-includes': 'warn',\n 'unicorn/prefer-logical-operator-over-ternary': 'warn',\n 'unicorn/prefer-node-protocol': 'warn',\n 'unicorn/prefer-object-from-entries': 'warn',\n 'unicorn/prefer-regexp-test': 'warn',\n 'unicorn/prefer-string-replace-all': 'warn',\n 'unicorn/prefer-string-slice': 'warn',\n 'unicorn/prefer-string-starts-ends-with': 'warn',\n 'unicorn/prefer-structured-clone': 'warn',\n\n // Styles\n 'unicorn/catch-error-name': 0,\n 'unicorn/explicit-length-check': 0,\n 'unicorn/no-array-callback-reference': 0,\n 'unicorn/require-module-specifiers': 0,\n 'unicorn/no-array-for-each': 0,\n 'unicorn/no-negated-condition': 0,\n 'unicorn/no-null': 0,\n 'unicorn/no-typeof-undefined': 0,\n 'unicorn/no-useless-undefined': 0,\n 'unicorn/prefer-code-point': 0,\n 'unicorn/prefer-number-properties': 0,\n 'unicorn/prefer-query-selector': 0,\n 'unicorn/prefer-spread': 0,\n 'unicorn/prefer-ternary': 0,\n 'unicorn/prefer-type-error': 0,\n },\n },\n {\n files: GLOB_NEXT_APP_FILES,\n rules: {\n 'unicorn/no-anonymous-default-export': 'off',\n },\n },\n {\n files: GLOB_CONFIG_FILES,\n rules: {\n 'unicorn/no-anonymous-default-export': 'off',\n },\n },\n ]);\n}\n","import { defineConfig } from 'eslint/config';\nimport unusedImportsPlugin from 'eslint-plugin-unused-imports';\n\nimport { GLOB_SRC } from '../globs';\n\nexport function unused() {\n return defineConfig([\n {\n files: GLOB_SRC,\n plugins: {\n 'unused-imports': unusedImportsPlugin,\n },\n rules: {\n 'unused-imports/no-unused-imports': 'error',\n 'unused-imports/no-unused-vars': [\n 'warn',\n {\n args: 'after-used',\n argsIgnorePattern: '^_',\n vars: 'all',\n varsIgnorePattern: '^_',\n },\n ],\n },\n },\n ]);\n}\n","import { defineConfig } from 'eslint/config';\nimport eslintPluginYml from 'eslint-plugin-yml';\n\nimport { type Options } from '../types';\n\nexport function yml(options: Options) {\n const { yml: ymlOption = true } = options;\n\n if (!ymlOption) return [];\n\n return defineConfig([\n ...eslintPluginYml.configs.recommended,\n {\n rules: {\n 'yml/quotes': [\n 'error',\n {\n avoidEscape: true,\n prefer: 'single',\n },\n ],\n },\n },\n ]);\n}\n","// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// <reference path=\"./eslint-typegen.d.ts\" />\n\nimport { a11y } from './configs/a11y';\nimport { eslintCommentsConfig } from './configs/eslint-comments';\nimport { ignores } from './configs/ignores';\nimport { imports } from './configs/imports';\nimport { javascript } from './configs/javascript';\nimport { next } from './configs/next';\nimport { react } from './configs/react';\nimport { reactNative } from './configs/react-native';\nimport { regexp } from './configs/regexp';\nimport { sorting } from './configs/sorting';\nimport { typescript } from './configs/typescript';\nimport { unicorn } from './configs/unicorn';\nimport { unused } from './configs/unused';\nimport { yml } from './configs/yml';\nimport { type FlatConfig, type FlatConfigArray, type Options } from './types';\n\nexport type { FlatConfig, FlatConfigArray, Linter, Options, ParserOptions } from './types';\n\nexport function defineConfig(options: Options = {}, ...userConfigs: FlatConfig[]): FlatConfigArray {\n const {\n a11y: a11yOption = false,\n ignores: userIgnores = [],\n next: nextOption = false,\n react: reactOption = false,\n reactNative: reactNativeOption = false,\n regexp: regexpOption = true,\n sortImports = true,\n sortKeys = true,\n typeChecked = false,\n typescript: tsOption = true,\n yml: ymlOption = true,\n } = options;\n\n const configs: FlatConfigArray = [\n ignores(userIgnores),\n ...javascript(),\n ...typescript({ ...options, typeChecked, typescript: tsOption }),\n ...react({ ...options, react: reactOption }),\n ...reactNative({ ...options, reactNative: reactNativeOption }),\n ...next({ ...options, next: nextOption }),\n ...a11y({ ...options, a11y: a11yOption, react: reactOption }),\n ...imports({ ...options, sortImports }),\n ...unicorn(),\n ...sorting({ ...options, sortKeys }),\n ...regexp({ ...options, regexp: regexpOption }),\n ...unused(),\n ...yml({ ...options, yml: ymlOption }),\n ...eslintCommentsConfig(),\n // 用户自定义配置(最高优先级)\n ...userConfigs,\n ];\n\n return configs;\n}\n\nexport * from './globs';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,UAAU;AACvB,MAAa,WAAW;AACxB,MAAa,UAAU;AACvB,MAAa,WAAW;AAExB,MAAa,cAAc,CAAC,SAAS,QAAS;AAC9C,MAAa,cAAc,CAAC,SAAS,QAAS;AAC9C,MAAa,WAAW,CAAC,GAAG,aAAa,GAAG,WAAY;AAExD,MAAa,YAAY;CACvB;CACA;CACA;AACD;AAED,MAAa,YAAY,CAAC,aAAa,UAAW;AAElD,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;ACrBD,SAAgB,KAAKA,SAAkB;CACrC,MAAM,EAAE,MAAM,YAAY,OAAO,aAAa,GAAG;AAEjD,MAAK,eAAe,YAAa,QAAO,CAAE;CAE1C,MAAM,QAAQ,CAAC,UAAU,QAAS;AAElC,QAAO,eAAa,CAClB;EACE;EACA,SAAS,EACP,YAAY,QACb;EACD,OAAO;GACL,GAAG,QAAQ,YAAY,YAAY;GACnC,qBAAqB;GACrB,+BAA+B;GAC/B,4BAA4B;GAC5B,yCAAyC;GACzC,2CAA2C;EAC5C;CAEJ,CAAA,EAAC;AACH;;;;ACxBD,SAAgB,uBAAuB;AACrC,QAAO,eAAa,CAClB;EACE,GAAG,eAAe;EAClB,OAAO;EACP,OAAO;GACL,GAAG,eAAe,YAAY;GAE9B,yDAAyD;GAEzD,uDAAuD;GAEvD,0DAA0D;GAE1D,0DAA0D;GAE1D,2DAA2D;EAC5D;CAEJ,CAAA,EAAC;AACH;;;;ACtBD,SAAgB,QAAQC,cAAwB,CAAE,GAAc;AAC9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ACb,QAAQ;CAEX,CAAA,EACF,EAEJ,CAAA,EAAC;AACH;;;;ACHD,SAAgB,aAAaC,UAAmB,CAAE,GAAE,GAAG,aAA4C;CACjG,MAAM,EACJ,MAAM,aAAa,OACnB,SAAS,cAAc,CAAE,GACzB,MAAM,aAAa,OACnB,OAAO,cAAc,OACrB,aAAa,oBAAoB,OACjC,QAAQ,eAAe,MACvB,cAAc,MACd,WAAW,MACX,cAAc,OACd,YAAY,WAAW,MACvB,KAAK,YAAY,MAClB,GAAG;CAEJ,MAAMC,UAA2B;EAC/B,QAAQ,YAAY;EACpB,GAAG,YAAY;EACf,GAAG,WAAW;GAAE,GAAG;GAAS;GAAa,YAAY;EAAU,EAAC;EAChE,GAAG,MAAM;GAAE,GAAG;GAAS,OAAO;EAAa,EAAC;EAC5C,GAAG,YAAY;GAAE,GAAG;GAAS,aAAa;EAAmB,EAAC;EAC9D,GAAG,KAAK;GAAE,GAAG;GAAS,MAAM;EAAY,EAAC;EACzC,GAAG,KAAK;GAAE,GAAG;GAAS,MAAM;GAAY,OAAO;EAAa,EAAC;EAC7D,GAAG,QAAQ;GAAE,GAAG;GAAS;EAAa,EAAC;EACvC,GAAG,SAAS;EACZ,GAAG,QAAQ;GAAE,GAAG;GAAS;EAAU,EAAC;EACpC,GAAG,OAAO;GAAE,GAAG;GAAS,QAAQ;EAAc,EAAC;EAC/C,GAAG,QAAQ;EACX,GAAG,IAAI;GAAE,GAAG;GAAS,KAAK;EAAW,EAAC;EACtC,GAAG,sBAAsB;EAEzB,GAAG;CACJ;AAED,QAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["options: Options","userIgnores: string[]","options: Options","options: Options","options: Options","options: Options","options: Options","options: Options","options: Options","options: Options","options: Options","configs: FlatConfigArray"],"sources":["../src/globs.ts","../src/configs/a11y.ts","../src/configs/eslint-comments.ts","../src/configs/ignores.ts","../src/configs/imports.ts","../src/configs/javascript.ts","../src/configs/next.ts","../src/configs/react.ts","../src/configs/react-native.ts","../src/configs/regexp.ts","../src/configs/sorting.ts","../src/configs/typescript.ts","../src/configs/unicorn.ts","../src/configs/unused.ts","../src/configs/yml.ts","../src/index.ts"],"sourcesContent":["export const GLOB_JS = '**/*.?([cm])js';\nexport const GLOB_JSX = '**/*.?([cm])jsx';\nexport const GLOB_TS = '**/*.?([cm])ts';\nexport const GLOB_TSX = '**/*.?([cm])tsx';\n\nexport const GLOB_JS_ALL = [GLOB_JS, GLOB_JSX];\nexport const GLOB_TS_ALL = [GLOB_TS, GLOB_TSX];\nexport const GLOB_SRC = [...GLOB_JS_ALL, ...GLOB_TS_ALL];\n\nexport const GLOB_TEST = [\n '**/*.test.{js,jsx,ts,tsx}',\n '**/*.spec.{js,jsx,ts,tsx}',\n '**/__tests__/**/*.{js,jsx,ts,tsx}',\n];\n\nexport const GLOB_YAML = ['**/*.yaml', '**/*.yml'];\n\nexport const GLOB_CONFIG_FILES = ['**/*.config.{js,mjs,ts,mts,cjs,cts}'];\n\nexport const GLOB_NEXT_APP_FILES = [\n '**/app/**/page.{js,jsx,ts,tsx}',\n '**/app/**/layout.{js,jsx,ts,tsx}',\n '**/app/**/loading.{js,jsx,ts,tsx}',\n '**/app/**/error.{js,jsx,ts,tsx}',\n '**/app/**/not-found.{js,jsx,ts,tsx}',\n '**/app/**/template.{js,jsx,ts,tsx}',\n '**/app/**/default.{js,jsx,ts,tsx}',\n '**/app/**/route.{js,ts}',\n '**/app/**/opengraph-image.{js,jsx,ts,tsx}',\n '**/app/**/twitter-image.{js,jsx,ts,tsx}',\n '**/app/**/apple-icon.{js,jsx,ts,tsx}',\n '**/app/**/icon.{js,jsx,ts,tsx}',\n '**/app/**/sitemap.{js,ts}',\n '**/app/**/robots.{js,ts}',\n '**/app/**/manifest.{js,ts}',\n];\n\nexport const GLOB_IGNORES = [\n '**/node_modules/**',\n '**/dist/**',\n '**/build/**',\n '**/.next/**',\n '**/coverage/**',\n '**/.turbo/**',\n '**/out/**',\n '**/*.min.*',\n '**/public/**',\n];\n","import { defineConfig } from 'eslint/config';\nimport jsxA11y from 'eslint-plugin-jsx-a11y';\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs';\nimport { type Options } from '../types';\n\nexport function a11y(options: Options) {\n const { a11y: a11yOption, react: reactOption } = options;\n\n if (!a11yOption || !reactOption) return [];\n\n const files = [GLOB_JSX, GLOB_TSX];\n\n return defineConfig([\n {\n files,\n plugins: {\n 'jsx-a11y': jsxA11y,\n },\n rules: {\n ...jsxA11y.flatConfigs.recommended.rules,\n 'jsx-a11y/alt-text': 'warn',\n 'jsx-a11y/anchor-has-content': 'warn',\n 'jsx-a11y/anchor-is-valid': 'warn',\n 'jsx-a11y/click-events-have-key-events': 'warn',\n 'jsx-a11y/no-static-element-interactions': 'warn',\n },\n },\n ]);\n}\n","import eslintComments from '@eslint-community/eslint-plugin-eslint-comments/configs';\nimport { defineConfig } from 'eslint/config';\n\nimport { GLOB_SRC } from '../globs';\n\nexport function eslintCommentsConfig() {\n return defineConfig([\n {\n ...eslintComments.recommended,\n files: GLOB_SRC,\n rules: {\n ...eslintComments.recommended.rules,\n // 允许文件级别的 eslint-disable 没有对应的 eslint-enable\n '@eslint-community/eslint-comments/disable-enable-pair': 'off',\n // 禁止未使用的 eslint-disable 注释(可自动修复)\n '@eslint-community/eslint-comments/no-unused-disable': 'error',\n // 禁止没有规则名的 eslint-disable(必须指定具体规则)\n '@eslint-community/eslint-comments/no-unlimited-disable': 'error',\n // 禁止重复的 eslint-disable\n '@eslint-community/eslint-comments/no-duplicate-disable': 'error',\n // 禁止一个 eslint-enable 同时启用多个 eslint-disable(鼓励合并多行 disable 注释)\n '@eslint-community/eslint-comments/no-aggregating-enable': 'error',\n },\n },\n ]);\n}\n","import { GLOB_IGNORES } from '../globs';\nimport { type FlatConfig } from '../types';\n\nexport function ignores(userIgnores: string[] = []): FlatConfig {\n return {\n ignores: [...GLOB_IGNORES, ...userIgnores],\n };\n}\n","import { defineConfig } from 'eslint/config';\nimport { importX } from 'eslint-plugin-import-x';\nimport simpleImportSort from 'eslint-plugin-simple-import-sort';\n\nimport { GLOB_SRC } from '../globs';\nimport { type Options } from '../types';\n\nexport function imports(options: Options) {\n const { sortImports = true } = options;\n\n const configs = defineConfig([\n {\n files: GLOB_SRC,\n plugins: {\n 'import-x': importX as any,\n },\n settings: {\n 'import-x/resolver': {\n node: true,\n typescript: true,\n },\n },\n rules: {\n 'import-x/first': 'error',\n 'import-x/newline-after-import': 'error',\n 'import-x/no-duplicates': 'error',\n 'import-x/no-mutable-exports': 'error',\n 'import-x/no-self-import': 'error',\n 'import-x/consistent-type-specifier-style': 0,\n },\n },\n ]);\n\n if (sortImports) {\n configs.push({\n files: GLOB_SRC,\n plugins: {\n 'simple-import-sort': simpleImportSort,\n },\n rules: {\n 'simple-import-sort/imports': 'error',\n 'simple-import-sort/exports': 'error',\n 'sort-imports': 'off',\n },\n });\n }\n\n return configs;\n}\n","import js from '@eslint/js';\nimport { defineConfig } from 'eslint/config';\nimport globals from 'globals';\n\nimport { GLOB_CONFIG_FILES, GLOB_NEXT_APP_FILES, GLOB_SRC, GLOB_TEST } from '../globs';\n\nconst GLOB_SCRIPTS = ['**/scripts/**'];\n\nexport function javascript() {\n return defineConfig([\n {\n ...js.configs.recommended,\n files: GLOB_SRC,\n languageOptions: {\n ecmaVersion: 'latest',\n globals: {\n ...globals.browser,\n ...globals.node,\n ...globals.es2021,\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n ecmaVersion: 'latest',\n sourceType: 'module',\n },\n sourceType: 'module',\n },\n linterOptions: {\n reportUnusedDisableDirectives: 'error',\n },\n rules: {\n ...js.configs.recommended.rules,\n 'no-useless-rename': 'error',\n 'object-shorthand': ['error', 'properties', { avoidQuotes: true }],\n // Only disallow console.log, allow console.warn/error/info/etc.\n 'no-console': [\n 'error',\n {\n allow: [\n 'warn',\n 'error',\n 'info',\n\n 'table',\n\n 'group',\n 'groupCollapsed',\n 'groupEnd',\n\n 'assert',\n 'clear',\n ],\n },\n ],\n 'no-empty': 'warn',\n 'no-extra-boolean-cast': 'off',\n 'no-unused-vars': 'off',\n 'no-restricted-syntax': [\n 'warn',\n {\n selector: 'ExportDefaultDeclaration',\n message: 'Default export is not allowed. Use named exports instead.',\n },\n ],\n },\n },\n // Allow default export in config and Next.js App Router files\n {\n files: [...GLOB_CONFIG_FILES, ...GLOB_NEXT_APP_FILES],\n rules: {\n 'no-restricted-syntax': 'off',\n },\n },\n // Allow all console in test and script files\n {\n files: [...GLOB_TEST, ...GLOB_SCRIPTS],\n rules: {\n 'no-console': 'off',\n },\n },\n ]);\n}\n","import nextPlugin from '@next/eslint-plugin-next';\nimport { defineConfig } from 'eslint/config';\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs';\nimport { type Options } from '../types';\n\nexport function next(options: Options) {\n const { next: nextOption } = options;\n\n if (!nextOption) return [];\n\n const files = [GLOB_JSX, GLOB_TSX];\n\n return defineConfig([\n {\n files,\n plugins: {\n '@next/next': nextPlugin as any,\n },\n rules: {\n ...nextPlugin.configs.recommended.rules,\n ...nextPlugin.configs['core-web-vitals'].rules,\n '@next/next/no-img-element': 'off',\n },\n },\n ]);\n}\n","import eslintReact from '@eslint-react/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport reactPlugin from 'eslint-plugin-react';\nimport reactCompiler from 'eslint-plugin-react-compiler';\nimport reactHooksPlugin from 'eslint-plugin-react-hooks';\nimport reactRefresh from 'eslint-plugin-react-refresh';\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs';\nimport { type Options } from '../types';\n\nexport function react(options: Options) {\n const { react: reactOption, reactCompiler: reactCompilerOption } = options;\n\n if (!reactOption) return [];\n\n const files = [GLOB_JSX, GLOB_TSX];\n\n const configs = defineConfig([\n {\n files,\n ...eslintReact.configs['recommended-typescript'],\n },\n {\n files,\n plugins: {\n 'react': reactPlugin,\n 'react-hooks': reactHooksPlugin,\n 'react-refresh': reactRefresh,\n },\n rules: {\n ...reactHooksPlugin.configs.recommended.rules,\n\n '@eslint-react/dom/no-dangerously-set-innerhtml': 'off',\n '@eslint-react/no-array-index-key': 'warn',\n '@eslint-react/no-leaked-conditional-rendering': 'off',\n\n 'react/self-closing-comp': 'warn',\n\n 'react-refresh/only-export-components': [\n 'warn',\n {\n allowConstantExport: true,\n allowExportNames:\n reactOption === 'next'\n ? [\n 'dynamic',\n 'dynamicParams',\n 'revalidate',\n 'fetchCache',\n 'runtime',\n 'preferredRegion',\n 'maxDuration',\n 'config',\n 'generateStaticParams',\n 'metadata',\n 'generateMetadata',\n 'viewport',\n 'generateViewport',\n ]\n : reactOption === 'remix'\n ? ['meta', 'links', 'headers', 'loader', 'action']\n : undefined,\n },\n ],\n },\n settings: {\n 'react-x': {\n version: 'detect',\n },\n },\n },\n ]);\n\n if (reactCompilerOption) {\n configs.push({\n files,\n plugins: {\n 'react-compiler': reactCompiler,\n },\n rules: {\n 'react-compiler/react-compiler': 'error',\n },\n });\n }\n\n return configs;\n}\n","import { defineConfig } from 'eslint/config';\nimport reactNativePlugin from 'eslint-plugin-react-native';\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs';\nimport { type Options } from '../types';\n\nexport function reactNative(options: Options) {\n const { reactNative: reactNativeOption } = options;\n\n if (!reactNativeOption) return [];\n\n const files = [GLOB_JSX, GLOB_TSX];\n\n return defineConfig([\n {\n files,\n plugins: {\n 'react-native': reactNativePlugin,\n },\n languageOptions: {\n globals: {\n __DEV__: 'readonly',\n },\n },\n rules: {\n 'react-native/no-color-literals': 'warn',\n 'react-native/no-inline-styles': 'warn',\n 'react-native/no-raw-text': 'off',\n 'react-native/no-single-element-style-arrays': 'warn',\n 'react-native/no-unused-styles': 'error',\n 'react-native/split-platform-components': 'warn',\n },\n },\n ]);\n}\n","import { defineConfig } from 'eslint/config';\nimport regexpPlugin from 'eslint-plugin-regexp';\n\nimport { GLOB_SRC } from '../globs';\nimport { type Options } from '../types';\n\nexport function regexp(options: Options) {\n const { regexp: regexpOption = true } = options;\n\n if (!regexpOption) return [];\n\n return defineConfig([\n {\n files: GLOB_SRC,\n plugins: {\n regexp: regexpPlugin,\n },\n rules: {\n ...regexpPlugin.configs['flat/recommended'].rules,\n },\n },\n ]);\n}\n","import { defineConfig } from 'eslint/config';\nimport perfectionistPlugin from 'eslint-plugin-perfectionist';\nimport reactPlugin from 'eslint-plugin-react';\n\nimport { GLOB_JSX, GLOB_TS_ALL, GLOB_TSX } from '../globs';\nimport { type Options } from '../types';\n\nexport function sorting(options: Options) {\n const { sortKeys = true } = options;\n\n if (!sortKeys) return [];\n\n return defineConfig([\n // TypeScript interface and enum sorting\n {\n files: GLOB_TS_ALL,\n plugins: {\n perfectionist: perfectionistPlugin,\n },\n rules: {\n 'perfectionist/sort-enums': [\n 'error',\n {\n order: 'asc',\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n {\n order: 'asc',\n type: 'natural',\n },\n ],\n },\n },\n // JSX props sorting\n {\n files: [GLOB_JSX, GLOB_TSX],\n plugins: {\n react: reactPlugin,\n },\n rules: {\n 'react/jsx-sort-props': [\n 'warn',\n {\n callbacksLast: true,\n multiline: 'last',\n shorthandFirst: true,\n },\n ],\n },\n },\n ]);\n}\n","import { defineConfig } from 'eslint/config';\nimport tseslint from 'typescript-eslint';\n\nimport { GLOB_TS_ALL } from '../globs';\nimport { type Options } from '../types';\n\nexport function typescript(options: Options) {\n const {\n typescript: tsOption,\n typeChecked,\n tsconfigPath,\n parserOptions: userParserOptions,\n } = options;\n\n if (!tsOption) return [];\n\n const isStrict = tsOption === 'strict';\n\n const baseConfigs = isStrict\n ? typeChecked\n ? tseslint.configs.strictTypeChecked\n : tseslint.configs.strict\n : typeChecked\n ? tseslint.configs.recommendedTypeChecked\n : tseslint.configs.recommended;\n\n const configs = defineConfig([\n ...baseConfigs,\n {\n files: GLOB_TS_ALL,\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n ...(typeChecked && {\n projectService: !tsconfigPath,\n project: tsconfigPath,\n }),\n ...userParserOptions,\n },\n },\n rules: {\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {\n disallowTypeAnnotations: false,\n fixStyle: 'separate-type-imports',\n prefer: 'type-imports',\n },\n ],\n '@typescript-eslint/method-signature-style': ['error', 'property'],\n '@typescript-eslint/no-import-type-side-effects': 'off',\n '@typescript-eslint/no-unused-expressions': [\n 'error',\n {\n allowShortCircuit: true,\n allowTaggedTemplates: true,\n allowTernary: true,\n },\n ],\n\n ...(isStrict\n ? {}\n : {\n '@typescript-eslint/ban-ts-comment': 'off',\n '@typescript-eslint/no-explicit-any': 'off',\n '@typescript-eslint/no-empty-object-type': 'off',\n '@typescript-eslint/no-require-imports': 'off',\n }),\n\n '@typescript-eslint/no-unused-vars': 'off',\n '@typescript-eslint/no-use-before-define': 'off',\n '@typescript-eslint/no-useless-constructor': 'off',\n },\n },\n ]);\n\n if (typeChecked) {\n configs.push({\n files: GLOB_TS_ALL,\n rules: {\n '@typescript-eslint/await-thenable': 'error',\n '@typescript-eslint/no-floating-promises': 'error',\n '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],\n '@typescript-eslint/require-await': 'error',\n },\n });\n }\n\n return configs;\n}\n","import { defineConfig } from 'eslint/config';\nimport unicornPlugin from 'eslint-plugin-unicorn';\n\nimport { GLOB_CONFIG_FILES, GLOB_NEXT_APP_FILES, GLOB_SRC } from '../globs';\n\nexport function unicorn() {\n return defineConfig([\n {\n files: GLOB_SRC,\n plugins: {\n unicorn: unicornPlugin,\n },\n rules: {\n // ===== Error Prevention / Bug Detection =====\n 'unicorn/better-regex': 'warn',\n 'unicorn/error-message': 'error',\n 'unicorn/new-for-builtins': 'error',\n 'unicorn/no-abusive-eslint-disable': 'error',\n 'unicorn/no-accessor-recursion': 'error',\n 'unicorn/no-await-in-promise-methods': 'error',\n 'unicorn/no-immediate-mutation': 'error',\n 'unicorn/no-instanceof-builtins': 'error',\n 'unicorn/no-invalid-fetch-options': 'error',\n 'unicorn/no-invalid-remove-event-listener': 'error',\n 'unicorn/no-negation-in-equality-check': 'error',\n 'unicorn/no-single-promise-in-promise-methods': 'error',\n 'unicorn/no-thenable': 'error',\n 'unicorn/throw-new-error': 'error',\n\n // ===== Code Cleanliness =====\n 'unicorn/escape-case': 'warn',\n 'unicorn/no-anonymous-default-export': 'error',\n 'unicorn/no-console-spaces': 'warn',\n 'unicorn/no-empty-file': 'warn',\n 'unicorn/no-lonely-if': 'warn',\n 'unicorn/no-new-array': 'error',\n 'unicorn/no-new-buffer': 'error',\n 'unicorn/no-unnecessary-await': 'error',\n 'unicorn/no-unreadable-iife': 'warn',\n 'unicorn/no-useless-fallback-in-spread': 'warn',\n 'unicorn/no-useless-length-check': 'warn',\n 'unicorn/no-useless-promise-resolve-reject': 'warn',\n 'unicorn/no-useless-spread': 'warn',\n 'unicorn/no-useless-switch-case': 'warn',\n 'unicorn/no-zero-fractions': 'warn',\n 'unicorn/number-literal-case': 'warn',\n 'unicorn/switch-case-braces': 'warn',\n 'unicorn/text-encoding-identifier-case': 'warn',\n 'unicorn/import-style': 'warn',\n\n // ===== Modern APIs =====\n 'unicorn/prefer-array-find': 'warn',\n 'unicorn/prefer-array-flat': 'warn',\n 'unicorn/prefer-array-flat-map': 'warn',\n 'unicorn/prefer-array-index-of': 'warn',\n 'unicorn/prefer-array-some': 'warn',\n 'unicorn/prefer-at': 'warn',\n 'unicorn/prefer-date-now': 'warn',\n 'unicorn/prefer-includes': 'warn',\n 'unicorn/prefer-logical-operator-over-ternary': 'warn',\n 'unicorn/prefer-node-protocol': 'warn',\n 'unicorn/prefer-object-from-entries': 'warn',\n 'unicorn/prefer-regexp-test': 'warn',\n 'unicorn/prefer-string-replace-all': 'warn',\n 'unicorn/prefer-string-slice': 'warn',\n 'unicorn/prefer-string-starts-ends-with': 'warn',\n 'unicorn/prefer-structured-clone': 'warn',\n\n // Styles\n 'unicorn/catch-error-name': 0,\n 'unicorn/explicit-length-check': 0,\n 'unicorn/no-array-callback-reference': 0,\n 'unicorn/require-module-specifiers': 0,\n 'unicorn/no-array-for-each': 0,\n 'unicorn/no-negated-condition': 0,\n 'unicorn/no-null': 0,\n 'unicorn/no-typeof-undefined': 0,\n 'unicorn/no-useless-undefined': 0,\n 'unicorn/prefer-code-point': 0,\n 'unicorn/prefer-number-properties': 0,\n 'unicorn/prefer-query-selector': 0,\n 'unicorn/prefer-spread': 0,\n 'unicorn/prefer-ternary': 0,\n 'unicorn/prefer-type-error': 0,\n },\n },\n {\n files: GLOB_NEXT_APP_FILES,\n rules: {\n 'unicorn/no-anonymous-default-export': 'off',\n },\n },\n {\n files: GLOB_CONFIG_FILES,\n rules: {\n 'unicorn/no-anonymous-default-export': 'off',\n },\n },\n ]);\n}\n","import { defineConfig } from 'eslint/config';\nimport unusedImportsPlugin from 'eslint-plugin-unused-imports';\n\nimport { GLOB_SRC } from '../globs';\n\nexport function unused() {\n return defineConfig([\n {\n files: GLOB_SRC,\n plugins: {\n 'unused-imports': unusedImportsPlugin,\n },\n rules: {\n 'unused-imports/no-unused-imports': 'error',\n 'unused-imports/no-unused-vars': [\n 'warn',\n {\n args: 'after-used',\n argsIgnorePattern: '^_',\n vars: 'all',\n varsIgnorePattern: '^_',\n },\n ],\n },\n },\n ]);\n}\n","import { defineConfig } from 'eslint/config';\nimport eslintPluginYml from 'eslint-plugin-yml';\n\nimport { type Options } from '../types';\n\nexport function yml(options: Options) {\n const { yml: ymlOption = true } = options;\n\n if (!ymlOption) return [];\n\n return defineConfig([\n ...eslintPluginYml.configs.recommended,\n {\n rules: {\n 'yml/quotes': [\n 'error',\n {\n avoidEscape: true,\n prefer: 'single',\n },\n ],\n },\n },\n ]);\n}\n","// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// <reference path=\"./eslint-typegen.d.ts\" />\n\nimport { a11y } from './configs/a11y';\nimport { eslintCommentsConfig } from './configs/eslint-comments';\nimport { ignores } from './configs/ignores';\nimport { imports } from './configs/imports';\nimport { javascript } from './configs/javascript';\nimport { next } from './configs/next';\nimport { react } from './configs/react';\nimport { reactNative } from './configs/react-native';\nimport { regexp } from './configs/regexp';\nimport { sorting } from './configs/sorting';\nimport { typescript } from './configs/typescript';\nimport { unicorn } from './configs/unicorn';\nimport { unused } from './configs/unused';\nimport { yml } from './configs/yml';\nimport { type FlatConfig, type FlatConfigArray, type Options } from './types';\n\nexport type { FlatConfig, FlatConfigArray, Linter, Options, ParserOptions } from './types';\n\nexport function defineConfig(options: Options = {}, ...userConfigs: FlatConfig[]): FlatConfigArray {\n const {\n a11y: a11yOption = false,\n ignores: userIgnores = [],\n next: nextOption = false,\n react: reactOption = false,\n reactNative: reactNativeOption = false,\n regexp: regexpOption = true,\n sortImports = true,\n sortKeys = true,\n typeChecked = false,\n typescript: tsOption = true,\n yml: ymlOption = true,\n } = options;\n\n const configs: FlatConfigArray = [\n ignores(userIgnores),\n ...javascript(),\n ...typescript({ ...options, typeChecked, typescript: tsOption }),\n ...react({ ...options, react: reactOption }),\n ...reactNative({ ...options, reactNative: reactNativeOption }),\n ...next({ ...options, next: nextOption }),\n ...a11y({ ...options, a11y: a11yOption, react: reactOption }),\n ...imports({ ...options, sortImports }),\n ...unicorn(),\n ...sorting({ ...options, sortKeys }),\n ...regexp({ ...options, regexp: regexpOption }),\n ...unused(),\n ...yml({ ...options, yml: ymlOption }),\n ...eslintCommentsConfig(),\n // 用户自定义配置(最高优先级)\n ...userConfigs,\n ];\n\n return configs;\n}\n\nexport * from './globs';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,UAAU;AACvB,MAAa,WAAW;AACxB,MAAa,UAAU;AACvB,MAAa,WAAW;AAExB,MAAa,cAAc,CAAC,SAAS,QAAS;AAC9C,MAAa,cAAc,CAAC,SAAS,QAAS;AAC9C,MAAa,WAAW,CAAC,GAAG,aAAa,GAAG,WAAY;AAExD,MAAa,YAAY;CACvB;CACA;CACA;AACD;AAED,MAAa,YAAY,CAAC,aAAa,UAAW;AAElD,MAAa,oB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;GAAS;GAAa,YAAY;EAAU,EAAC;EAChE,GAAG,MAAM;GAAE,GAAG;GAAS,OAAO;EAAa,EAAC;EAC5C,GAAG,YAAY;GAAE,GAAG;GAAS,aAAa;EAAmB,EAAC;EAC9D,GAAG,KAAK;GAAE,GAAG;GAAS,MAAM;EAAY,EAAC;EACzC,GAAG,KAAK;GAAE,GAAG;GAAS,MAAM;GAAY,OAAO;EAAa,EAAC;EAC7D,GAAG,QAAQ;GAAE,GAAG;GAAS;EAAa,EAAC;EACvC,GAAG,SAAS;EACZ,GAAG,QAAQ;GAAE,GAAG;GAAS;EAAU,EAAC;EACpC,GAAG,OAAO;GAAE,GAAG;GAAS,QAAQ;EAAc,EAAC;EAC/C,GAAG,QAAQ;EACX,GAAG,IAAI;GAAE,GAAG;GAAS,KAAK;EAAW,EAAC;EACtC,GAAG,sBAAsB;EAEzB,GAAG;CACJ;AAED,QAAO;AACR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/eslint-config",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"description": "ESLint Flat Config configuration for LobeHub projects",
|
|
5
5
|
"homepage": "https://github.com/lobehub/lobe-lint/tree/master/packages/eslint-config",
|
|
6
6
|
"bugs": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
32
|
-
"@eslint-react/eslint-plugin": "^2.
|
|
33
|
-
"@eslint/js": "^
|
|
31
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
|
|
32
|
+
"@eslint-react/eslint-plugin": "^2.12.4",
|
|
33
|
+
"@eslint/js": "^10.0.1",
|
|
34
34
|
"@next/eslint-plugin-next": "^16.1.6",
|
|
35
35
|
"eslint-config-prettier": "^9.1.2",
|
|
36
36
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
@@ -44,18 +44,18 @@
|
|
|
44
44
|
"eslint-plugin-react-refresh": "^0.5.0",
|
|
45
45
|
"eslint-plugin-regexp": "^3.0.0",
|
|
46
46
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
47
|
-
"eslint-plugin-unicorn": "^
|
|
48
|
-
"eslint-plugin-unused-imports": "^4.
|
|
47
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
48
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
49
49
|
"eslint-plugin-yml": "^3.1.2",
|
|
50
50
|
"globals": "^17.3.0",
|
|
51
|
-
"typescript-eslint": "^8.
|
|
51
|
+
"typescript-eslint": "^8.55.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"eslint-typegen": "^2.3.0",
|
|
55
|
-
"glob": "^13.0.
|
|
55
|
+
"glob": "^13.0.2"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"eslint": "
|
|
58
|
+
"eslint": "^10.0.0",
|
|
59
59
|
"typescript": ">=5.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|