@cany748/eslint-config 2.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -0
- package/dist/index.cjs +1330 -0
- package/dist/index.d.cts +10544 -0
- package/dist/index.d.ts +10544 -0
- package/dist/index.js +1244 -0
- package/package.json +70 -16
- package/index.js +0 -366
package/package.json
CHANGED
|
@@ -1,26 +1,80 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cany748/eslint-config",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "3.0.1",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"import": "./dist/index.js",
|
|
8
|
+
"require": "./dist/index.cjs"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
5
13
|
"files": [
|
|
6
|
-
"
|
|
14
|
+
"dist"
|
|
7
15
|
],
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@unocss/eslint-plugin": "^0.62.1",
|
|
18
|
+
"eslint-plugin-vue": "^9.27.0",
|
|
19
|
+
"typescript-eslint": "^8.1.0"
|
|
20
|
+
},
|
|
21
|
+
"peerDependenciesMeta": {
|
|
22
|
+
"@unocss/eslint-plugin": {
|
|
23
|
+
"optional": true
|
|
24
|
+
},
|
|
25
|
+
"eslint-plugin-vue": {
|
|
26
|
+
"optional": true
|
|
27
|
+
},
|
|
28
|
+
"typescript-eslint": {
|
|
29
|
+
"optional": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
8
32
|
"dependencies": {
|
|
9
|
-
"eslint": "^
|
|
33
|
+
"eslint": "^9.9.0",
|
|
34
|
+
"eslint-config-flat-gitignore": "^0.1.8",
|
|
10
35
|
"eslint-config-prettier": "^9.1.0",
|
|
11
|
-
"eslint-config-
|
|
36
|
+
"eslint-flat-config-utils": "^0.3.0",
|
|
12
37
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
13
|
-
"eslint-plugin-
|
|
14
|
-
"eslint-plugin-
|
|
15
|
-
"eslint-plugin-
|
|
16
|
-
"eslint-plugin-
|
|
17
|
-
"eslint-plugin-prettier": "5.1
|
|
18
|
-
"eslint-plugin-
|
|
19
|
-
"eslint-plugin-unicorn": "^
|
|
20
|
-
"eslint-plugin-unused-imports": "^
|
|
21
|
-
"eslint-plugin-
|
|
38
|
+
"eslint-plugin-import-x": "^3.1.0",
|
|
39
|
+
"eslint-plugin-jsonc": "^2.16.0",
|
|
40
|
+
"eslint-plugin-n": "^17.10.2",
|
|
41
|
+
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
42
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
43
|
+
"eslint-plugin-regexp": "^2.6.0",
|
|
44
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
45
|
+
"eslint-plugin-unused-imports": "^4.1.3",
|
|
46
|
+
"eslint-plugin-vitest": "^0.5.4",
|
|
47
|
+
"globals": "^15.9.0",
|
|
22
48
|
"jsonc-eslint-parser": "^2.4.0",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
49
|
+
"local-pkg": "^0.5.0",
|
|
50
|
+
"prettier": "^3.3.3"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/node": "^22.2.0",
|
|
54
|
+
"@unocss/eslint-plugin": "^0.62.1",
|
|
55
|
+
"bumpp": "^9.4.2",
|
|
56
|
+
"eslint-plugin-vue": "^9.27.0",
|
|
57
|
+
"eslint-typegen": "^0.3.0",
|
|
58
|
+
"esno": "^4.7.0",
|
|
59
|
+
"lint-staged": "^15.2.9",
|
|
60
|
+
"simple-git-hooks": "^2.11.1",
|
|
61
|
+
"tsup": "^8.2.4",
|
|
62
|
+
"typescript": "^5.5.4",
|
|
63
|
+
"typescript-eslint": "^8.1.0"
|
|
64
|
+
},
|
|
65
|
+
"simple-git-hooks": {
|
|
66
|
+
"pre-commit": "pnpm lint-staged"
|
|
67
|
+
},
|
|
68
|
+
"lint-staged": {
|
|
69
|
+
"*": "eslint --fix --flag unstable_ts_config"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"build": "pnpm typegen && tsup --format esm,cjs --clean --dts",
|
|
73
|
+
"typegen": "esno scripts/typegen.ts",
|
|
74
|
+
"dev": "npx @eslint/config-inspector --config eslint.config.ts",
|
|
75
|
+
"lint": "eslint . --flag unstable_ts_config",
|
|
76
|
+
"lint:fix": "eslint . --fix --flag unstable_ts_config",
|
|
77
|
+
"release": "bumpp && pnpm publish",
|
|
78
|
+
"typecheck": "tsc --noEmit"
|
|
25
79
|
}
|
|
26
80
|
}
|
package/index.js
DELETED
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-module */
|
|
2
|
-
module.exports = {
|
|
3
|
-
env: {
|
|
4
|
-
browser: true,
|
|
5
|
-
},
|
|
6
|
-
reportUnusedDisableDirectives: true,
|
|
7
|
-
extends: [
|
|
8
|
-
"eslint:recommended",
|
|
9
|
-
"standard",
|
|
10
|
-
"plugin:unicorn/recommended",
|
|
11
|
-
"plugin:import/recommended",
|
|
12
|
-
"plugin:n/recommended",
|
|
13
|
-
"plugin:eslint-comments/recommended",
|
|
14
|
-
"plugin:prettier/recommended",
|
|
15
|
-
"plugin:jsonc/recommended-with-jsonc",
|
|
16
|
-
"plugin:jsonc/prettier",
|
|
17
|
-
"plugin:yml/recommended",
|
|
18
|
-
"plugin:yml/prettier",
|
|
19
|
-
],
|
|
20
|
-
ignorePatterns: [
|
|
21
|
-
"*.min.*",
|
|
22
|
-
"dist",
|
|
23
|
-
"build",
|
|
24
|
-
"LICENSE*",
|
|
25
|
-
"fixtures",
|
|
26
|
-
".nuxt",
|
|
27
|
-
"output",
|
|
28
|
-
".output",
|
|
29
|
-
"out",
|
|
30
|
-
"coverage",
|
|
31
|
-
"public",
|
|
32
|
-
"temp",
|
|
33
|
-
"auto-import.d.ts",
|
|
34
|
-
"components.d.ts",
|
|
35
|
-
"package-lock.json",
|
|
36
|
-
"pnpm-lock.yaml",
|
|
37
|
-
"yarn.lock",
|
|
38
|
-
"__snapshots__",
|
|
39
|
-
// ignore for in lint-staged
|
|
40
|
-
"*.css",
|
|
41
|
-
"*.png",
|
|
42
|
-
"*.ico",
|
|
43
|
-
"*.toml",
|
|
44
|
-
"*.patch",
|
|
45
|
-
"*.txt",
|
|
46
|
-
"*.crt",
|
|
47
|
-
"*.key",
|
|
48
|
-
"Dockerfile",
|
|
49
|
-
"vendor/*",
|
|
50
|
-
// force include
|
|
51
|
-
"!.github",
|
|
52
|
-
"!.vitepress",
|
|
53
|
-
"!.vscode",
|
|
54
|
-
// force exclude
|
|
55
|
-
"**/.vitepress/cache",
|
|
56
|
-
],
|
|
57
|
-
plugins: ["html", "unused-imports"],
|
|
58
|
-
settings: {
|
|
59
|
-
"import/resolver": {
|
|
60
|
-
node: { extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".d.ts"] },
|
|
61
|
-
},
|
|
62
|
-
node: {
|
|
63
|
-
version: ">=16.0.0",
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
overrides: [
|
|
67
|
-
{
|
|
68
|
-
files: ["*.json", "*.json5", "*.jsonc"],
|
|
69
|
-
parser: "jsonc-eslint-parser",
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
files: ["*.yaml", "*.yml"],
|
|
73
|
-
parser: "yaml-eslint-parser",
|
|
74
|
-
},
|
|
75
|
-
// package.json sorting
|
|
76
|
-
{
|
|
77
|
-
files: ["package.json"],
|
|
78
|
-
parser: "jsonc-eslint-parser",
|
|
79
|
-
rules: {
|
|
80
|
-
"jsonc/sort-keys": [
|
|
81
|
-
"error",
|
|
82
|
-
{
|
|
83
|
-
pathPattern: "^$",
|
|
84
|
-
order: [
|
|
85
|
-
"publisher",
|
|
86
|
-
"name",
|
|
87
|
-
"displayName",
|
|
88
|
-
"type",
|
|
89
|
-
"version",
|
|
90
|
-
"private",
|
|
91
|
-
"packageManager",
|
|
92
|
-
"description",
|
|
93
|
-
"author",
|
|
94
|
-
"license",
|
|
95
|
-
"funding",
|
|
96
|
-
"homepage",
|
|
97
|
-
"repository",
|
|
98
|
-
"bugs",
|
|
99
|
-
"keywords",
|
|
100
|
-
"categories",
|
|
101
|
-
"sideEffects",
|
|
102
|
-
"exports",
|
|
103
|
-
"main",
|
|
104
|
-
"module",
|
|
105
|
-
"unpkg",
|
|
106
|
-
"jsdelivr",
|
|
107
|
-
"types",
|
|
108
|
-
"typesVersions",
|
|
109
|
-
"bin",
|
|
110
|
-
"icon",
|
|
111
|
-
"files",
|
|
112
|
-
"engines",
|
|
113
|
-
"activationEvents",
|
|
114
|
-
"contributes",
|
|
115
|
-
"scripts",
|
|
116
|
-
"peerDependencies",
|
|
117
|
-
"peerDependenciesMeta",
|
|
118
|
-
"dependencies",
|
|
119
|
-
"optionalDependencies",
|
|
120
|
-
"devDependencies",
|
|
121
|
-
"pnpm",
|
|
122
|
-
"overrides",
|
|
123
|
-
"resolutions",
|
|
124
|
-
"husky",
|
|
125
|
-
"simple-git-hooks",
|
|
126
|
-
"lint-staged",
|
|
127
|
-
"eslintConfig",
|
|
128
|
-
"prettier",
|
|
129
|
-
"stylelint",
|
|
130
|
-
],
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$",
|
|
134
|
-
order: { type: "asc" },
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
pathPattern: "^resolutions$",
|
|
138
|
-
order: { type: "asc" },
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
pathPattern: "^pnpm.overrides$",
|
|
142
|
-
order: { type: "asc" },
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
pathPattern: "^exports.*$",
|
|
146
|
-
order: ["types", "import", "require", "default"],
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
// tsconfig.json sorting
|
|
152
|
-
{
|
|
153
|
-
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
154
|
-
parser: "jsonc-eslint-parser",
|
|
155
|
-
rules: {
|
|
156
|
-
"jsonc/sort-keys": [
|
|
157
|
-
"error",
|
|
158
|
-
{
|
|
159
|
-
pathPattern: "^$",
|
|
160
|
-
order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
pathPattern: "^compilerOptions$",
|
|
164
|
-
order: [
|
|
165
|
-
/* Projects */
|
|
166
|
-
"incremental",
|
|
167
|
-
"composite",
|
|
168
|
-
"tsBuildInfoFile",
|
|
169
|
-
"disableSourceOfProjectReferenceRedirect",
|
|
170
|
-
"disableSolutionSearching",
|
|
171
|
-
"disableReferencedProjectLoad",
|
|
172
|
-
/* Language and Environment */
|
|
173
|
-
"target",
|
|
174
|
-
"lib",
|
|
175
|
-
"jsx",
|
|
176
|
-
"experimentalDecorators",
|
|
177
|
-
"emitDecoratorMetadata",
|
|
178
|
-
"jsxFactory",
|
|
179
|
-
"jsxFragmentFactory",
|
|
180
|
-
"jsxImportSource",
|
|
181
|
-
"reactNamespace",
|
|
182
|
-
"noLib",
|
|
183
|
-
"useDefineForClassFields",
|
|
184
|
-
"moduleDetection",
|
|
185
|
-
/* Modules */
|
|
186
|
-
"module",
|
|
187
|
-
"rootDir",
|
|
188
|
-
"moduleResolution",
|
|
189
|
-
"baseUrl",
|
|
190
|
-
"paths",
|
|
191
|
-
"rootDirs",
|
|
192
|
-
"typeRoots",
|
|
193
|
-
"types",
|
|
194
|
-
"allowUmdGlobalAccess",
|
|
195
|
-
"moduleSuffixes",
|
|
196
|
-
"allowImportingTsExtensions",
|
|
197
|
-
"resolvePackageJsonExports",
|
|
198
|
-
"resolvePackageJsonImports",
|
|
199
|
-
"customConditions",
|
|
200
|
-
"resolveJsonModule",
|
|
201
|
-
"allowArbitraryExtensions",
|
|
202
|
-
"noResolve",
|
|
203
|
-
/* JavaScript Support */
|
|
204
|
-
"allowJs",
|
|
205
|
-
"checkJs",
|
|
206
|
-
"maxNodeModuleJsDepth",
|
|
207
|
-
/* Emit */
|
|
208
|
-
"declaration",
|
|
209
|
-
"declarationMap",
|
|
210
|
-
"emitDeclarationOnly",
|
|
211
|
-
"sourceMap",
|
|
212
|
-
"inlineSourceMap",
|
|
213
|
-
"outFile",
|
|
214
|
-
"outDir",
|
|
215
|
-
"removeComments",
|
|
216
|
-
"noEmit",
|
|
217
|
-
"importHelpers",
|
|
218
|
-
"importsNotUsedAsValues",
|
|
219
|
-
"downlevelIteration",
|
|
220
|
-
"sourceRoot",
|
|
221
|
-
"mapRoot",
|
|
222
|
-
"inlineSources",
|
|
223
|
-
"emitBOM",
|
|
224
|
-
"newLine",
|
|
225
|
-
"stripInternal",
|
|
226
|
-
"noEmitHelpers",
|
|
227
|
-
"noEmitOnError",
|
|
228
|
-
"preserveConstEnums",
|
|
229
|
-
"declarationDir",
|
|
230
|
-
"preserveValueImports",
|
|
231
|
-
/* Interop Constraints */
|
|
232
|
-
"isolatedModules",
|
|
233
|
-
"verbatimModuleSyntax",
|
|
234
|
-
"allowSyntheticDefaultImports",
|
|
235
|
-
"esModuleInterop",
|
|
236
|
-
"preserveSymlinks",
|
|
237
|
-
"forceConsistentCasingInFileNames",
|
|
238
|
-
/* Type Checking */
|
|
239
|
-
"strict",
|
|
240
|
-
"strictBindCallApply",
|
|
241
|
-
"strictFunctionTypes",
|
|
242
|
-
"strictNullChecks",
|
|
243
|
-
"strictPropertyInitialization",
|
|
244
|
-
"allowUnreachableCode",
|
|
245
|
-
"allowUnusedLabels",
|
|
246
|
-
"alwaysStrict",
|
|
247
|
-
"exactOptionalPropertyTypes",
|
|
248
|
-
"noFallthroughCasesInSwitch",
|
|
249
|
-
"noImplicitAny",
|
|
250
|
-
"noImplicitOverride",
|
|
251
|
-
"noImplicitReturns",
|
|
252
|
-
"noImplicitThis",
|
|
253
|
-
"noPropertyAccessFromIndexSignature",
|
|
254
|
-
"noUncheckedIndexedAccess",
|
|
255
|
-
"noUnusedLocals",
|
|
256
|
-
"noUnusedParameters",
|
|
257
|
-
"useUnknownInCatchVariables",
|
|
258
|
-
/* Completeness */
|
|
259
|
-
"skipDefaultLibCheck",
|
|
260
|
-
"skipLibCheck",
|
|
261
|
-
],
|
|
262
|
-
},
|
|
263
|
-
],
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
files: ["*.d.ts"],
|
|
268
|
-
rules: {
|
|
269
|
-
"import/no-duplicates": "off",
|
|
270
|
-
"unused-imports/no-unused-vars": "off",
|
|
271
|
-
"eslint-comments/no-unlimited-disable": "off",
|
|
272
|
-
},
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
files: ["*.test.js", "*.spec.js"],
|
|
276
|
-
rules: {
|
|
277
|
-
"no-unused-expressions": "off",
|
|
278
|
-
"unicorn/no-null": "off",
|
|
279
|
-
"unicorn/no-useless-undefined": "off",
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
],
|
|
283
|
-
rules: {
|
|
284
|
-
"import/order": "error",
|
|
285
|
-
"import/no-mutable-exports": "error",
|
|
286
|
-
"import/no-unresolved": "off",
|
|
287
|
-
"import/newline-after-import": ["error", { count: 1, considerComments: true }],
|
|
288
|
-
|
|
289
|
-
"unused-imports/no-unused-imports": "error",
|
|
290
|
-
"no-unused-vars": "off",
|
|
291
|
-
"unused-imports/no-unused-vars": [
|
|
292
|
-
"warn",
|
|
293
|
-
{
|
|
294
|
-
vars: "all",
|
|
295
|
-
varsIgnorePattern: "^_",
|
|
296
|
-
args: "after-used",
|
|
297
|
-
argsIgnorePattern: "^_",
|
|
298
|
-
},
|
|
299
|
-
],
|
|
300
|
-
|
|
301
|
-
"no-restricted-syntax": ["error", "ForInStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"],
|
|
302
|
-
|
|
303
|
-
"prefer-arrow-callback": [
|
|
304
|
-
"error",
|
|
305
|
-
{
|
|
306
|
-
allowNamedFunctions: false,
|
|
307
|
-
allowUnboundThis: true,
|
|
308
|
-
},
|
|
309
|
-
],
|
|
310
|
-
|
|
311
|
-
"prefer-exponentiation-operator": "error",
|
|
312
|
-
"prefer-rest-params": "error",
|
|
313
|
-
"prefer-spread": "error",
|
|
314
|
-
"prefer-template": "error",
|
|
315
|
-
|
|
316
|
-
"object-shorthand": ["error", "always", { ignoreConstructors: false, avoidQuotes: true }],
|
|
317
|
-
"require-await": "error",
|
|
318
|
-
"block-scoped-var": "error",
|
|
319
|
-
"no-invalid-this": "error",
|
|
320
|
-
"vars-on-top": "error",
|
|
321
|
-
"no-void": ["error", { allowAsStatement: true }],
|
|
322
|
-
|
|
323
|
-
"n/prefer-global/buffer": ["error", "always"],
|
|
324
|
-
"n/prefer-global/console": ["error", "always"],
|
|
325
|
-
"n/prefer-global/process": ["error", "always"],
|
|
326
|
-
"n/prefer-global/text-decoder": ["error", "always"],
|
|
327
|
-
"n/prefer-global/text-encoder": ["error", "always"],
|
|
328
|
-
"n/prefer-global/url-search-params": ["error", "always"],
|
|
329
|
-
"n/prefer-global/url": ["error", "always"],
|
|
330
|
-
|
|
331
|
-
"n/no-extraneous-import": "off",
|
|
332
|
-
"n/no-missing-import": "off",
|
|
333
|
-
"eslint-comments/disable-enable-pair": "off",
|
|
334
|
-
"unicorn/filename-case": "off",
|
|
335
|
-
"unicorn/consistent-function-scoping": "off",
|
|
336
|
-
"unicorn/prevent-abbreviations": "off",
|
|
337
|
-
"unicorn/prefer-top-level-await": "off",
|
|
338
|
-
"unicorn/prefer-string-replace-all": "off",
|
|
339
|
-
|
|
340
|
-
"no-restricted-globals": [
|
|
341
|
-
"error",
|
|
342
|
-
{ name: "global", message: "Use `globalThis` instead." },
|
|
343
|
-
{ name: "self", message: "Use `globalThis` instead." },
|
|
344
|
-
],
|
|
345
|
-
|
|
346
|
-
"no-restricted-properties": [
|
|
347
|
-
"error",
|
|
348
|
-
{ property: "__proto__", message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead." },
|
|
349
|
-
{ property: "__defineGetter__", message: "Use `Object.defineProperty` instead." },
|
|
350
|
-
{ property: "__defineSetter__", message: "Use `Object.defineProperty` instead." },
|
|
351
|
-
{ property: "__lookupGetter__", message: "Use `Object.getOwnPropertyDescriptor` instead." },
|
|
352
|
-
{ property: "__lookupSetter__", message: "Use `Object.getOwnPropertyDescriptor` instead." },
|
|
353
|
-
],
|
|
354
|
-
|
|
355
|
-
"sort-imports": [
|
|
356
|
-
"error",
|
|
357
|
-
{
|
|
358
|
-
ignoreCase: false,
|
|
359
|
-
ignoreDeclarationSort: true,
|
|
360
|
-
ignoreMemberSort: false,
|
|
361
|
-
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
|
|
362
|
-
allowSeparatedGroups: false,
|
|
363
|
-
},
|
|
364
|
-
],
|
|
365
|
-
},
|
|
366
|
-
};
|