@shayanthenerd/eslint-config 0.14.0 → 0.16.0
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/LICENSE +1 -1
- package/README.md +209 -190
- package/dist/configs/astro.mjs +34 -0
- package/dist/configs/base.mjs +19 -10
- package/dist/configs/css.mjs +2 -2
- package/dist/configs/cypress.mjs +2 -2
- package/dist/configs/html.mjs +2 -3
- package/dist/configs/importX.mjs +8 -4
- package/dist/configs/oxlintOverrides.mjs +20 -14
- package/dist/configs/perfectionist.mjs +8 -4
- package/dist/configs/playwright.mjs +2 -2
- package/dist/configs/restrictedExports.mjs +1 -1
- package/dist/configs/storybook.mjs +2 -2
- package/dist/configs/stylistic.mjs +8 -4
- package/dist/configs/tailwind.mjs +14 -14
- package/dist/configs/typescript.mjs +8 -4
- package/dist/configs/vitest.mjs +2 -2
- package/dist/configs/vue.mjs +2 -2
- package/dist/configs/vueComponentNames.mjs +1 -1
- package/dist/configs/vueServerComponents.mjs +1 -1
- package/dist/configs/zod.mjs +8 -4
- package/dist/{utils → helpers}/globs.mjs +2 -1
- package/dist/{utils → helpers}/ignores/defaultIgnorePatterns.mjs +3 -1
- package/dist/{utils → helpers}/ignores/getIgnorePatterns.mjs +1 -1
- package/dist/{utils → helpers}/ignores/resolveGitignorePatterns.mjs +1 -1
- package/dist/{utils → helpers}/isPackageDetected.mjs +1 -1
- package/dist/{utils → helpers}/options/defaultOptions.mjs +15 -7
- package/dist/{utils → helpers}/options/enableDetectedConfigs.mjs +2 -3
- package/dist/{utils → helpers}/options/mergeWithDefaults.mjs +4 -5
- package/dist/{utils → helpers}/vue/getRestrictedVueElements.mjs +1 -1
- package/dist/{utils → helpers}/vue/getRestrictedVueInputs.mjs +1 -1
- package/dist/index.mjs +6 -4
- package/dist/oxlint.config.jsonc +120 -206
- package/dist/prettier.config.mjs +1 -1
- package/dist/rules/astro.mjs +61 -0
- package/dist/rules/css.mjs +1 -1
- package/dist/rules/html.mjs +3 -3
- package/dist/rules/importX.mjs +1 -1
- package/dist/rules/javascript.mjs +1 -2
- package/dist/rules/perfectionist.mjs +2 -2
- package/dist/rules/stylistic.mjs +10 -7
- package/dist/rules/tailwind.mjs +4 -4
- package/dist/rules/typescript.mjs +2 -2
- package/dist/rules/vue.mjs +6 -6
- package/dist/rules/vueAccessibility.mjs +1 -1
- package/dist/types/configOptions/base.d.mts +8 -8
- package/dist/types/configOptions/nuxt.d.mts +3 -3
- package/dist/types/configOptions/stylistic.d.mts +0 -15
- package/dist/types/configOptions/test.d.mts +4 -4
- package/dist/types/configOptions/vue.d.mts +1 -1
- package/dist/types/eslint-schema.d.mts +1031 -237
- package/dist/types/index.d.mts +46 -20
- package/package.json +142 -124
package/dist/types/index.d.mts
CHANGED
|
@@ -81,12 +81,15 @@ interface Options {
|
|
|
81
81
|
* Specify the runtime environment to correctly resolve its built-in modules
|
|
82
82
|
*
|
|
83
83
|
* This is used by
|
|
84
|
-
*
|
|
85
|
-
*
|
|
84
|
+
*
|
|
85
|
+
* - [ESLint: Specifying Globals](https://eslint.org/docs/latest/use/configure/language-options#using-configuration-files)
|
|
86
|
+
* - [perfectionist/sort-imports: `env` option](https://perfectionist.dev/rules/sort-imports#environment)
|
|
87
|
+
*
|
|
88
|
+
* to recognize the environment’s built-in modules.
|
|
86
89
|
*
|
|
87
90
|
* @default 'node'
|
|
88
91
|
*/
|
|
89
|
-
env?: 'bun' | 'node';
|
|
92
|
+
env?: 'bun' | 'deno' | 'node' | 'browser';
|
|
90
93
|
|
|
91
94
|
/**
|
|
92
95
|
* The path and the name of the root TypeScript config file.
|
|
@@ -97,16 +100,16 @@ interface Options {
|
|
|
97
100
|
* - [better-tailwindcss: `tsconfig` option](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#tsconfig)
|
|
98
101
|
* - [perfectionist/sort-imports: `tsconfig` option](https://perfectionist.dev/rules/sort-imports#tsconfig)
|
|
99
102
|
*
|
|
100
|
-
* @default undefined // `{ rootDir: '.', filename: 'tsconfig.json' }` if "typescript" is detected in the
|
|
103
|
+
* @default undefined // `{ rootDir: '.', filename: 'tsconfig.json' }` if "typescript" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
101
104
|
*/
|
|
102
105
|
tsConfig?: false | {
|
|
103
106
|
/**
|
|
104
107
|
* The directory of the root TypeScript config file.
|
|
105
108
|
*
|
|
106
|
-
|
|
109
|
+
* If you don't use TypeScript, provide the directory of the root JavaScript config file.
|
|
107
110
|
*
|
|
108
111
|
* It will fall back to the default value if set to an empty string (`''`).
|
|
109
|
-
|
|
112
|
+
*
|
|
110
113
|
* @default '.'
|
|
111
114
|
*/
|
|
112
115
|
rootDir: string;
|
|
@@ -180,24 +183,40 @@ interface Options {
|
|
|
180
183
|
*
|
|
181
184
|
* @default
|
|
182
185
|
* {
|
|
183
|
-
* node: true,
|
|
184
|
-
* commonjs: false,
|
|
185
|
-
* browser: true,
|
|
186
186
|
* worker: true,
|
|
187
|
-
*
|
|
188
|
-
*
|
|
187
|
+
* commonjs: false,
|
|
188
|
+
* bun: false, // `true` if `env` is set to `bun`
|
|
189
|
+
* deno: false, // `true` if `env` is set to `deno`
|
|
190
|
+
* node: true,
|
|
191
|
+
* nodeBuiltin: false, // `true` if `env` is set to `node`
|
|
192
|
+
* browser: true, // `true` if `env` is set to `browser`
|
|
193
|
+
* serviceworker: false, // `true` if `env` is set to `browser`
|
|
194
|
+
* sharedWorker: false, // `true` if `env` is set to `browser`
|
|
195
|
+
* webextension: false, // `true` if `env` is set to `browser`
|
|
196
|
+
* audioWorklet: false, // `true` if `env` is set to `browser`
|
|
197
|
+
* vitest: false,
|
|
198
|
+
* vue: false, // `true` if `configs.vue` is enabled
|
|
199
|
+
* astro: false, // `true` if `configs.astro` is enabled
|
|
189
200
|
* custom: {},
|
|
190
201
|
* }
|
|
191
202
|
*
|
|
192
|
-
* @see [Language Options: Specifying Globals
|
|
203
|
+
* @see [Language Options: Specifying Globals](https://eslint.org/docs/latest/use/configure/language-options#using-configuration-files)
|
|
193
204
|
*/
|
|
194
205
|
globals?: {
|
|
195
|
-
|
|
206
|
+
worker?: boolean;
|
|
196
207
|
commonjs?: boolean;
|
|
208
|
+
bun?: boolean;
|
|
209
|
+
deno?: boolean;
|
|
210
|
+
node?: boolean;
|
|
211
|
+
nodeBuiltin?: boolean;
|
|
197
212
|
browser?: boolean;
|
|
198
|
-
worker?: boolean;
|
|
199
213
|
serviceworker?: boolean;
|
|
214
|
+
sharedWorker?: boolean;
|
|
200
215
|
webextension?: boolean;
|
|
216
|
+
audioWorklet?: boolean;
|
|
217
|
+
vitest?: boolean;
|
|
218
|
+
vue?: boolean;
|
|
219
|
+
astro?: boolean;
|
|
201
220
|
custom?: Linter.LanguageOptions['globals'];
|
|
202
221
|
};
|
|
203
222
|
|
|
@@ -262,11 +281,11 @@ interface Options {
|
|
|
262
281
|
*
|
|
263
282
|
* Provide the path to your OXLint configuration file (relative to the current working directory) or set to `false` to disable it.
|
|
264
283
|
*
|
|
265
|
-
* Enabling
|
|
284
|
+
* Enabling OXLint improves performance and feedback loops.
|
|
266
285
|
*
|
|
267
286
|
* It will fall back to the default value if set to an empty string (`''`).
|
|
268
287
|
*
|
|
269
|
-
* @default
|
|
288
|
+
* @default '.oxlintrc.json'
|
|
270
289
|
*/
|
|
271
290
|
oxlint?: false | string;
|
|
272
291
|
|
|
@@ -314,7 +333,7 @@ interface Options {
|
|
|
314
333
|
* - [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x) to better understand imports from TypeScript files such as ".ts", ".tsx", etc.
|
|
315
334
|
* - [eslint-plugin-vue](https://eslint.vuejs.org) to enforce TypeScript-specific rules in the `<script setup lang="ts">` of Vue SFCs.
|
|
316
335
|
*
|
|
317
|
-
* @default false // `true` if "typescript" is detected in the
|
|
336
|
+
* @default false // `true` if "typescript" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
318
337
|
*/
|
|
319
338
|
typescript?: boolean | TypeScriptOptions;
|
|
320
339
|
|
|
@@ -335,14 +354,14 @@ interface Options {
|
|
|
335
354
|
/**
|
|
336
355
|
* Use [eslint-plugin-zod-x](https://github.com/marcalexiei/eslint-plugin-zod-x) to enforce Zod best practices.
|
|
337
356
|
*
|
|
338
|
-
* @default false // `true` if "zod" is detected in the
|
|
357
|
+
* @default false // `true` if "zod" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
339
358
|
*/
|
|
340
359
|
zod?: boolean | ConfigWithOverrides;
|
|
341
360
|
|
|
342
361
|
/**
|
|
343
362
|
* Use [eslint-plugin-vue](https://eslint.vuejs.org) to enforce Vue best practices, accessibility guidelines, stylistic rules, and identify mistakes.
|
|
344
363
|
*
|
|
345
|
-
* @default false // `true` if "vue" is detected in the
|
|
364
|
+
* @default false // `true` if "vue" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
346
365
|
*/
|
|
347
366
|
vue?: boolean | VueOptions;
|
|
348
367
|
|
|
@@ -353,10 +372,17 @@ interface Options {
|
|
|
353
372
|
*
|
|
354
373
|
* **This configuration requires `configs.vue` to be enabled.**
|
|
355
374
|
*
|
|
356
|
-
* @default false // `true` if "nuxt" is detected in the
|
|
375
|
+
* @default false // `true` if "nuxt" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
357
376
|
*/
|
|
358
377
|
nuxt?: boolean | NuxtOptions;
|
|
359
378
|
|
|
379
|
+
/**
|
|
380
|
+
* Use [eslint-plugin-astro](https://ota-meshi.github.io/eslint-plugin-astro) to enforce Astro best practices and accessibility guidelines.
|
|
381
|
+
*
|
|
382
|
+
* @default false // `true` if "astro" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
383
|
+
*/
|
|
384
|
+
astro?: boolean | ConfigWithOverrides;
|
|
385
|
+
|
|
360
386
|
/**
|
|
361
387
|
* Configuration options for the testing tools.
|
|
362
388
|
*/
|
package/package.json
CHANGED
|
@@ -1,126 +1,144 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
2
|
+
"name": "@shayanthenerd/eslint-config",
|
|
3
|
+
"version": "0.16.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"eslint",
|
|
8
|
+
"eslint-config",
|
|
9
|
+
"eslint-flat-config",
|
|
10
|
+
"eslint-config-vue",
|
|
11
|
+
"eslint-config-typescript",
|
|
12
|
+
"oxlint",
|
|
13
|
+
"oxlint-config"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://eslint-config.shayan-zamani.me",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/ShayanTheNerd/eslint-config.git"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/ShayanTheNerd/eslint-config/issues/new?template=bug_report.md"
|
|
22
|
+
},
|
|
23
|
+
"author": {
|
|
24
|
+
"name": "Shayan Zamani",
|
|
25
|
+
"email": "dev.shayan.zamani@gmail.com",
|
|
26
|
+
"url": "https://github.com/ShayanTheNerd"
|
|
27
|
+
},
|
|
28
|
+
"funding": "https://buymeacoffee.com/shayanthenerd",
|
|
29
|
+
"files": [
|
|
30
|
+
"./dist"
|
|
31
|
+
],
|
|
32
|
+
"main": "./dist/index.mjs",
|
|
33
|
+
"module": "./dist/index.mjs",
|
|
34
|
+
"types": "./dist/index.d.mts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": "./dist/index.mjs",
|
|
37
|
+
"./package.json": "./package.json",
|
|
38
|
+
"./types/*": "./dist/types/*",
|
|
39
|
+
"./oxlint": "./dist/oxlint.config.jsonc",
|
|
40
|
+
"./prettier": "./dist/prettier.config.mjs"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"imports": {
|
|
46
|
+
"#configs/*": "./src/configs/*",
|
|
47
|
+
"#helpers/*": "./src/helpers/*",
|
|
48
|
+
"#rules/*": "./src/rules/*",
|
|
49
|
+
"#types/*": "./src/types/*",
|
|
50
|
+
"#utils/*": "./src/utils/*"
|
|
51
|
+
},
|
|
52
|
+
"type": "module",
|
|
53
|
+
"engines": {
|
|
54
|
+
"name": "node",
|
|
55
|
+
"version": "^22.18.0",
|
|
56
|
+
"onfail": "download"
|
|
57
|
+
},
|
|
58
|
+
"packageManager": "pnpm@10.27.0",
|
|
59
|
+
"scripts": {
|
|
60
|
+
"prepare": "pnpm git:gitmessage && simple-git-hooks && pnpm generate:types",
|
|
61
|
+
"prepublishOnly": "pnpm build:package",
|
|
62
|
+
"git:gitmessage": "git config --local commit.template \".gitmessage\"",
|
|
63
|
+
"inspect": "eslint-config-inspector",
|
|
64
|
+
"build:package": "tsdown --no-report",
|
|
65
|
+
"build:inspector": "eslint-config-inspector build --config=./scripts/defaultESLintConfigReference.ts",
|
|
66
|
+
"preview:inspector": "serve .eslint-config-inspector",
|
|
67
|
+
"generate:types": "node ./scripts/generateESLintTypes.ts",
|
|
68
|
+
"update:actions": "actions-up --yes",
|
|
69
|
+
"format": "prettier --write '**/*.{json,jsonc,yaml,yml,lock}' --cache",
|
|
70
|
+
"lint:oxlint": "oxlint --fix",
|
|
71
|
+
"lint:eslint": "eslint --fix --cache --cache-location=./node_modules/.cache/.eslintcache",
|
|
72
|
+
"lint": "pnpm lint:oxlint && pnpm lint:eslint",
|
|
73
|
+
"check:types": "tsc",
|
|
74
|
+
"check:exports": "attw --pack --profile=esm-only --exclude-entrypoints=./oxlint",
|
|
75
|
+
"check:spell": "pnpx cspell . --gitignore --exclude='pnpm-lock.yaml' --cache --cache-location='./node_modules/.cache/.cspellcache'",
|
|
76
|
+
"ci:validate": "pnpm generate:types && pnpm format && pnpm lint && pnpm check:types && pnpm build:inspector && pnpm build:package && pnpm check:exports"
|
|
77
|
+
},
|
|
78
|
+
"simple-git-hooks": {
|
|
79
|
+
"pre-commit": "./node_modules/.bin/nano-staged"
|
|
80
|
+
},
|
|
81
|
+
"nano-staged": {
|
|
82
|
+
"eslint.config.ts": "pnpm lint",
|
|
83
|
+
"prettier.config.ts": "pnpm format",
|
|
84
|
+
"**/*.{js,ts}": "pnpm lint",
|
|
85
|
+
"**/*.{json,jsonc,yaml,yml,lock}": "pnpm format"
|
|
86
|
+
},
|
|
87
|
+
"dependencies": {
|
|
88
|
+
"@eslint/compat": "2.0.0",
|
|
89
|
+
"@eslint/css": "0.14.1",
|
|
90
|
+
"@html-eslint/eslint-plugin": "0.52.1",
|
|
91
|
+
"@stylistic/eslint-plugin": "5.6.1",
|
|
92
|
+
"@vitest/eslint-plugin": "1.6.5",
|
|
93
|
+
"astro-eslint-parser": "1.2.2",
|
|
94
|
+
"defu": "6.1.4",
|
|
95
|
+
"eslint": "9.39.2",
|
|
96
|
+
"eslint-flat-config-utils": "2.1.4",
|
|
97
|
+
"eslint-import-resolver-typescript": "4.4.4",
|
|
98
|
+
"eslint-plugin-astro": "1.5.0",
|
|
99
|
+
"eslint-plugin-better-tailwindcss": "3.8.0",
|
|
100
|
+
"eslint-plugin-cypress": "5.2.1",
|
|
101
|
+
"eslint-plugin-import-x": "4.16.1",
|
|
102
|
+
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
103
|
+
"eslint-plugin-oxlint": "1.38.0",
|
|
104
|
+
"eslint-plugin-perfectionist": "5.3.0",
|
|
105
|
+
"eslint-plugin-playwright": "2.4.0",
|
|
106
|
+
"eslint-plugin-storybook": "10.1.11",
|
|
107
|
+
"eslint-plugin-unused-imports": "4.3.0",
|
|
108
|
+
"eslint-plugin-vue": "10.6.2",
|
|
109
|
+
"eslint-plugin-vuejs-accessibility": "2.4.1",
|
|
110
|
+
"eslint-plugin-zod-x": "2.0.0",
|
|
111
|
+
"globals": "17.0.0",
|
|
112
|
+
"local-pkg": "1.1.2",
|
|
113
|
+
"oxlint": "1.38.0",
|
|
114
|
+
"tailwind-csstree": "0.1.4",
|
|
115
|
+
"typescript-eslint": "8.52.0"
|
|
116
|
+
},
|
|
117
|
+
"devDependencies": {
|
|
118
|
+
"@arethetypeswrong/cli": "0.18.2",
|
|
119
|
+
"@eslint/config-inspector": "1.4.2",
|
|
120
|
+
"@types/node": "25.0.3",
|
|
121
|
+
"actions-up": "1.8.0",
|
|
122
|
+
"eslint-typegen": "2.3.0",
|
|
123
|
+
"nano-staged": "0.9.0",
|
|
124
|
+
"prettier": "3.7.4",
|
|
125
|
+
"publint": "0.3.16",
|
|
126
|
+
"serve": "14.2.5",
|
|
127
|
+
"simple-git-hooks": "2.13.1",
|
|
128
|
+
"tsdown": "0.18.3",
|
|
129
|
+
"typescript": "5.9.3",
|
|
130
|
+
"unplugin-unused": "0.5.6"
|
|
131
|
+
},
|
|
132
|
+
"peerDependencies": {
|
|
133
|
+
"eslint": "^9.28.0",
|
|
134
|
+
"oxlint": "^1.37.0"
|
|
135
|
+
},
|
|
136
|
+
"peerDependenciesMeta": {
|
|
137
|
+
"eslint": {
|
|
138
|
+
"optional": true
|
|
139
|
+
},
|
|
140
|
+
"oxlint": {
|
|
141
|
+
"optional": true
|
|
142
|
+
}
|
|
143
|
+
}
|
|
126
144
|
}
|