@eslint-sets/eslint-config 5.14.0 → 6.0.0-beta.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/README.md +660 -30
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +257 -0
- package/dist/cli/index.mjs +234 -0
- package/dist/index.d.mts +22671 -0
- package/dist/index.d.ts +22670 -3
- package/dist/index.js +3195 -15
- package/dist/index.mjs +3067 -13
- package/package.json +150 -86
package/README.md
CHANGED
|
@@ -1,61 +1,691 @@
|
|
|
1
|
-
<div style="text-align: center;" align="center">
|
|
2
|
-
|
|
3
1
|
# @eslint-sets/eslint-config
|
|
4
2
|
|
|
5
|
-
Eslint config sets
|
|
6
|
-
|
|
7
3
|
[![NPM version][npm-image]][npm-url]
|
|
8
|
-
[![Codacy Badge][codacy-image]][codacy-url]
|
|
9
|
-
[![Test coverage][codecov-image]][codecov-url]
|
|
10
|
-
[![npm download][download-image]][download-url]
|
|
11
4
|
[![License][license-image]][license-url]
|
|
12
5
|
|
|
13
|
-
[
|
|
6
|
+
English | [简体中文](./README_CN.md)
|
|
7
|
+
|
|
8
|
+
Modern ESLint config with flat config support for Vue, React, Svelte, TypeScript, Next.js, Nuxt, Astro, Angular, UnoCSS and more.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
- 🚀 **ESLint v9 Flat Config** - Uses the modern flat config format
|
|
13
|
+
- 🎨 **@stylistic Integration** - Default formatting with `@stylistic/eslint-plugin` (no Prettier needed)
|
|
14
|
+
- 📝 **TypeScript TypeGen** - Auto-generated types for all rules with full IntelliSense support
|
|
15
|
+
- ✨ **Prettier Support** - Optional Prettier integration for those who prefer it
|
|
16
|
+
- 📦 **Auto-detection** - Automatically detects installed frameworks
|
|
17
|
+
- 🔧 **Highly Configurable** - Fine-grained control over enabled features
|
|
18
|
+
- 🙈 **Git Ignore Support** - Automatically read `.gitignore` patterns (default: on)
|
|
19
|
+
- 🛠️ **Disables Support** - Automatically disable strict rules in config files
|
|
20
|
+
- 🖥️ **Command Support** - Relaxed rules for command-line scripts
|
|
21
|
+
- 🏷️ **Project Types** - Support for `app` and `lib` project types
|
|
22
|
+
- ♿ **Accessibility** - Optional a11y rules for Vue and React
|
|
23
|
+
- 📝 **Auto-sort** - Automatically sort package.json and tsconfig.json
|
|
24
|
+
- 🔍 **Editor Detection** - Automatically detect editor environment
|
|
25
|
+
- 🔎 **Config Inspector** - Visual tool for inspecting your ESLint config
|
|
26
|
+
- 📊 **Perfectionist Sorting** - Import/export sorting with natural ordering
|
|
16
27
|
|
|
17
|
-
##
|
|
28
|
+
## Supported Frameworks
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
| Framework | Auto-detect | Notes |
|
|
31
|
+
| ---------- | :---------: | ----------------------------------------------- |
|
|
32
|
+
| TypeScript | ✅ | Default enabled |
|
|
33
|
+
| Vue | ✅ | Vue 2 & 3 support, with a11y option |
|
|
34
|
+
| React | ✅ | With hooks, refresh, and React Compiler support |
|
|
35
|
+
| Svelte | ✅ | |
|
|
36
|
+
| Solid | ✅ | |
|
|
37
|
+
| Next.js | ✅ | Requires `@next/eslint-plugin-next` |
|
|
38
|
+
| Nuxt | ✅ | |
|
|
39
|
+
| Astro | ✅ | Requires `eslint-plugin-astro` |
|
|
40
|
+
| Angular | ✅ | Requires `@angular-eslint/eslint-plugin` |
|
|
41
|
+
| UnoCSS | ✅ | Requires `@unocss/eslint-plugin` |
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
```shell
|
|
20
46
|
# use pnpm
|
|
21
|
-
|
|
47
|
+
pnpm install -D @eslint-sets/eslint-config eslint
|
|
22
48
|
|
|
23
49
|
# use npm
|
|
24
|
-
|
|
50
|
+
npm install -D @eslint-sets/eslint-config eslint
|
|
25
51
|
|
|
26
|
-
# use
|
|
27
|
-
|
|
52
|
+
# use bun
|
|
53
|
+
bun add -D @eslint-sets/eslint-config eslint
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
### Using CLI (Recommended)
|
|
59
|
+
|
|
60
|
+
Run the interactive CLI to set up your project:
|
|
61
|
+
|
|
62
|
+
```shell
|
|
63
|
+
# use pnpm
|
|
64
|
+
pnpm dlx @eslint-sets/eslint-config
|
|
65
|
+
|
|
66
|
+
# use npm
|
|
67
|
+
npx @eslint-sets/eslint-config
|
|
68
|
+
|
|
69
|
+
# use bun
|
|
70
|
+
bunx @eslint-sets/eslint-config
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The CLI will guide you through:
|
|
74
|
+
|
|
75
|
+
- Project type selection (Application/Library)
|
|
76
|
+
- TypeScript support
|
|
77
|
+
- Framework selection (Vue, React, Svelte, Solid, Next.js, Nuxt, Astro, Angular, UnoCSS)
|
|
78
|
+
- Accessibility options
|
|
79
|
+
- Formatter choice (Prettier/Stylistic)
|
|
80
|
+
- Additional options (.gitignore, auto-sort, etc.)
|
|
81
|
+
|
|
82
|
+
### Manual Setup
|
|
83
|
+
|
|
84
|
+
Create an `eslint.config.ts` file in your project root:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// eslint.config.ts
|
|
88
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
89
|
+
|
|
90
|
+
export default eslintConfig()
|
|
28
91
|
```
|
|
29
92
|
|
|
30
93
|
## Usage
|
|
31
94
|
|
|
32
|
-
|
|
95
|
+
### With Options
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// eslint.config.ts
|
|
99
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
100
|
+
|
|
101
|
+
export default eslintConfig({
|
|
102
|
+
// Angular support (default: 'auto' - auto-detect)
|
|
103
|
+
angular: true,
|
|
104
|
+
|
|
105
|
+
// Astro support (default: 'auto' - auto-detect)
|
|
106
|
+
astro: true,
|
|
107
|
+
|
|
108
|
+
// Relax rules for scripts (default: true)
|
|
109
|
+
command: true,
|
|
110
|
+
// Disable rules in config files (default: true)
|
|
111
|
+
disables: true,
|
|
112
|
+
|
|
113
|
+
// e18e modernization rules (default: false)
|
|
114
|
+
e18e: true,
|
|
115
|
+
// ESLint comments rules (default: true)
|
|
116
|
+
eslintComments: true,
|
|
117
|
+
|
|
118
|
+
// External formatters (default: false)
|
|
119
|
+
formatters: {
|
|
120
|
+
css: 'prettier',
|
|
121
|
+
graphql: 'prettier',
|
|
122
|
+
html: 'prettier',
|
|
123
|
+
markdown: 'prettier',
|
|
124
|
+
svg: 'prettier',
|
|
125
|
+
xml: 'prettier',
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
// Auto-read .gitignore (default: true)
|
|
129
|
+
gitignore: true,
|
|
130
|
+
|
|
131
|
+
// Files to ignore
|
|
132
|
+
ignores: ['**/dist/**', '**/node_modules/**'],
|
|
133
|
+
|
|
134
|
+
// Or modify defaults:
|
|
135
|
+
ignores: (defaults) => [...defaults, '**/custom/**'],
|
|
136
|
+
|
|
137
|
+
// Import rules (default: true)
|
|
138
|
+
imports: true,
|
|
139
|
+
|
|
140
|
+
// JSON/JSONC support (default: true)
|
|
141
|
+
jsonc: true,
|
|
142
|
+
|
|
143
|
+
// JSX Accessibility rules (default: false)
|
|
144
|
+
jsxA11y: true,
|
|
145
|
+
|
|
146
|
+
// Markdown support (default: true)
|
|
147
|
+
markdown: true,
|
|
148
|
+
|
|
149
|
+
// Next.js support (default: 'auto' - auto-detect)
|
|
150
|
+
nextjs: true,
|
|
151
|
+
// Node.js rules (default: true)
|
|
152
|
+
node: true,
|
|
153
|
+
|
|
154
|
+
// Nuxt support (default: 'auto' - auto-detect)
|
|
155
|
+
nuxt: true,
|
|
156
|
+
|
|
157
|
+
// Perfectionist sorting (default: true)
|
|
158
|
+
perfectionist: true,
|
|
159
|
+
|
|
160
|
+
// pnpm workspace support (default: false)
|
|
161
|
+
pnpm: true,
|
|
162
|
+
|
|
163
|
+
// Prettier integration (default: false)
|
|
164
|
+
// Note: Must set stylistic: false to use prettier
|
|
165
|
+
prettier: false,
|
|
166
|
+
|
|
167
|
+
// React support (default: 'auto' - auto-detect)
|
|
168
|
+
react: true,
|
|
169
|
+
|
|
170
|
+
// Or with options:
|
|
171
|
+
react: {
|
|
172
|
+
a11y: true, // Enable JSX accessibility rules
|
|
173
|
+
reactCompiler: true, // React Compiler support
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
// Regexp rules (default: true)
|
|
177
|
+
regexp: true,
|
|
178
|
+
|
|
179
|
+
// Custom rule overrides
|
|
180
|
+
rules: {
|
|
181
|
+
'no-console': 'off',
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
// Solid support (default: 'auto' - auto-detect)
|
|
185
|
+
solid: true,
|
|
186
|
+
|
|
187
|
+
// Auto-sort package.json (default: true)
|
|
188
|
+
sortPackageJson: true,
|
|
189
|
+
|
|
190
|
+
// Auto-sort tsconfig.json (default: true)
|
|
191
|
+
sortTsconfig: true,
|
|
192
|
+
|
|
193
|
+
// Stylistic formatting (default: true)
|
|
194
|
+
// Uses @stylistic/eslint-plugin for code formatting
|
|
195
|
+
stylistic: true,
|
|
196
|
+
|
|
197
|
+
// Or with custom options:
|
|
198
|
+
stylistic: {
|
|
199
|
+
arrowParens: 'always', // 'always' | 'avoid'
|
|
200
|
+
bracketSpacing: true, // boolean
|
|
201
|
+
indent: 2, // 'tab' | number
|
|
202
|
+
jsxQuotes: 'prefer-double', // 'prefer-double' | 'prefer-single'
|
|
203
|
+
quotes: 'single', // 'single' | 'double'
|
|
204
|
+
semi: false, // boolean
|
|
205
|
+
trailingComma: 'always-multiline', // 'none' | 'es5' | 'always-multiline' | 'all'
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
// Svelte support (default: 'auto' - auto-detect)
|
|
209
|
+
svelte: true,
|
|
210
|
+
|
|
211
|
+
// Test file support (default: true)
|
|
212
|
+
test: true,
|
|
213
|
+
|
|
214
|
+
// Project type: 'app' (default) or 'lib'
|
|
215
|
+
type: 'lib',
|
|
216
|
+
|
|
217
|
+
// TypeScript support (default: true)
|
|
218
|
+
typescript: true,
|
|
219
|
+
|
|
220
|
+
// Unicorn rules (default: true)
|
|
221
|
+
unicorn: true,
|
|
222
|
+
|
|
223
|
+
// UnoCSS support (default: 'auto' - auto-detect)
|
|
224
|
+
unocss: true,
|
|
225
|
+
|
|
226
|
+
// Vue support (default: 'auto' - auto-detect)
|
|
227
|
+
vue: true,
|
|
228
|
+
// Or with options:
|
|
229
|
+
vue: {
|
|
230
|
+
a11y: true, // Enable accessibility rules
|
|
231
|
+
vueVersion: 3,
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
// YAML support (default: true)
|
|
235
|
+
yaml: true,
|
|
236
|
+
})
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Project Types
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
// Application project (default)
|
|
243
|
+
export default eslintConfig({
|
|
244
|
+
type: 'app',
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
// Library project - stricter rules
|
|
248
|
+
export default eslintConfig({
|
|
249
|
+
type: 'lib',
|
|
250
|
+
})
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Stylistic vs Prettier
|
|
254
|
+
|
|
255
|
+
This config supports two formatting approaches:
|
|
256
|
+
|
|
257
|
+
1. **Stylistic** (default): Uses `@stylistic/eslint-plugin` for pure ESLint-based formatting - no additional tool needed.
|
|
258
|
+
2. **Prettier**: Uses `eslint-plugin-prettier` to integrate Prettier with ESLint.
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
// Use Stylistic (default)
|
|
262
|
+
export default eslintConfig({
|
|
263
|
+
stylistic: true, // or just use defaults
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
// Use Stylistic with custom options
|
|
267
|
+
export default eslintConfig({
|
|
268
|
+
stylistic: {
|
|
269
|
+
arrowParens: 'always', // 'always' | 'avoid'
|
|
270
|
+
bracketSpacing: true, // boolean
|
|
271
|
+
indent: 2, // 'tab' | number
|
|
272
|
+
jsxQuotes: 'prefer-double', // 'prefer-double' | 'prefer-single'
|
|
273
|
+
quotes: 'single', // 'single' | 'double'
|
|
274
|
+
semi: false, // boolean
|
|
275
|
+
trailingComma: 'always-multiline', // 'none' | 'es5' | 'always-multiline' | 'all'
|
|
276
|
+
},
|
|
277
|
+
})
|
|
278
|
+
|
|
279
|
+
// Use Prettier instead (must disable stylistic)
|
|
280
|
+
export default eslintConfig({
|
|
281
|
+
prettier: true,
|
|
282
|
+
stylistic: false,
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
// Use Prettier with custom options
|
|
286
|
+
export default eslintConfig({
|
|
287
|
+
prettier: {
|
|
288
|
+
printWidth: 120,
|
|
289
|
+
semi: false,
|
|
290
|
+
singleQuote: true,
|
|
291
|
+
tabWidth: 2,
|
|
292
|
+
trailingComma: 'all',
|
|
293
|
+
useTabs: false,
|
|
294
|
+
},
|
|
295
|
+
stylistic: false,
|
|
296
|
+
})
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
**Note**: Stylistic and Prettier are mutually exclusive. When `stylistic` is enabled (default), Prettier is automatically disabled.
|
|
300
|
+
|
|
301
|
+
### Accessibility Rules
|
|
302
|
+
|
|
303
|
+
```typescript
|
|
304
|
+
// Vue accessibility
|
|
305
|
+
export default eslintConfig({
|
|
306
|
+
vue: {
|
|
307
|
+
a11y: true,
|
|
308
|
+
},
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
// React/JSX accessibility
|
|
312
|
+
export default eslintConfig({
|
|
313
|
+
react: {
|
|
314
|
+
a11y: true,
|
|
315
|
+
},
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
// Or standalone JSX a11y
|
|
319
|
+
export default eslintConfig({
|
|
320
|
+
jsxA11y: true,
|
|
321
|
+
})
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Auto-Detection
|
|
325
|
+
|
|
326
|
+
By default, the config auto-detects installed frameworks and enables the appropriate rules:
|
|
327
|
+
|
|
328
|
+
```typescript
|
|
329
|
+
// eslint.config.ts
|
|
330
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
331
|
+
|
|
332
|
+
export default eslintConfig({
|
|
333
|
+
autoDetect: true, // Enable auto-detection (default: true)
|
|
334
|
+
})
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Framework-Specific Configurations
|
|
338
|
+
|
|
339
|
+
#### Vue Project
|
|
340
|
+
|
|
341
|
+
```typescript
|
|
342
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
343
|
+
|
|
344
|
+
export default eslintConfig({
|
|
345
|
+
type: 'lib',
|
|
346
|
+
typescript: true,
|
|
347
|
+
vue: {
|
|
348
|
+
a11y: true,
|
|
349
|
+
vueVersion: 3,
|
|
350
|
+
},
|
|
351
|
+
})
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
#### React Project
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
358
|
+
|
|
359
|
+
export default eslintConfig({
|
|
360
|
+
react: {
|
|
361
|
+
a11y: true,
|
|
362
|
+
reactCompiler: true,
|
|
363
|
+
},
|
|
364
|
+
typescript: true,
|
|
365
|
+
})
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
#### Next.js Project
|
|
369
|
+
|
|
370
|
+
```typescript
|
|
371
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
372
|
+
|
|
373
|
+
export default eslintConfig({
|
|
374
|
+
nextjs: true,
|
|
375
|
+
react: true,
|
|
376
|
+
typescript: true,
|
|
377
|
+
})
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
#### Nuxt Project
|
|
381
|
+
|
|
382
|
+
```typescript
|
|
383
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
384
|
+
|
|
385
|
+
export default eslintConfig({
|
|
386
|
+
nuxt: true,
|
|
387
|
+
typescript: true,
|
|
388
|
+
vue: true,
|
|
389
|
+
})
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
#### Angular Project
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
396
|
+
|
|
397
|
+
export default eslintConfig({
|
|
398
|
+
angular: true,
|
|
399
|
+
typescript: true,
|
|
400
|
+
})
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
#### Svelte Project
|
|
404
|
+
|
|
405
|
+
```typescript
|
|
406
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
407
|
+
|
|
408
|
+
export default eslintConfig({
|
|
409
|
+
svelte: true,
|
|
410
|
+
typescript: true,
|
|
411
|
+
})
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
#### Astro Project
|
|
415
|
+
|
|
416
|
+
```typescript
|
|
417
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
418
|
+
|
|
419
|
+
export default eslintConfig({
|
|
420
|
+
astro: true,
|
|
421
|
+
typescript: true,
|
|
422
|
+
})
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
#### UnoCSS Project
|
|
426
|
+
|
|
427
|
+
```typescript
|
|
428
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
429
|
+
|
|
430
|
+
export default eslintConfig({
|
|
431
|
+
unocss: true,
|
|
432
|
+
})
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Extending the Config
|
|
436
|
+
|
|
437
|
+
```typescript
|
|
438
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
439
|
+
|
|
440
|
+
export default eslintConfig({
|
|
441
|
+
extends: [
|
|
442
|
+
// Additional flat configs
|
|
443
|
+
],
|
|
444
|
+
rules: {
|
|
445
|
+
// Override rules
|
|
446
|
+
},
|
|
447
|
+
})
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
## TypeScript Support
|
|
451
|
+
|
|
452
|
+
This package provides full TypeScript support with auto-generated types:
|
|
453
|
+
|
|
454
|
+
```typescript
|
|
455
|
+
import type { TypedFlatConfigItem, Rules, RuleOptions, ConfigNames } from '@eslint-sets/eslint-config'
|
|
456
|
+
|
|
457
|
+
// TypedFlatConfigItem - Full type checking for config objects
|
|
458
|
+
const myConfig: TypedFlatConfigItem = {
|
|
459
|
+
name: 'my-config',
|
|
460
|
+
rules: {
|
|
461
|
+
'no-console': 'off',
|
|
462
|
+
'@stylistic/semi': ['error', 'always'], // IDE shows available options
|
|
463
|
+
},
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// Rules - All available rule names with type checking
|
|
467
|
+
const myRules: Rules = {
|
|
468
|
+
'no-console': 'off',
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// ConfigNames - All available config names
|
|
472
|
+
type MyConfigs = ConfigNames // 'eslint-sets/javascript' | 'eslint-sets/vue' | ...
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
### Regenerating Types
|
|
476
|
+
|
|
477
|
+
If you're contributing to this package, regenerate types after adding new plugins:
|
|
478
|
+
|
|
479
|
+
```shell
|
|
480
|
+
pnpm run gen
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
This generates `src/typegen.d.ts` with all rule types.
|
|
484
|
+
|
|
485
|
+
## Config Inspector
|
|
486
|
+
|
|
487
|
+
Visualize and debug your ESLint configuration using the built-in Config Inspector:
|
|
488
|
+
|
|
489
|
+
```shell
|
|
490
|
+
# Run the inspector
|
|
491
|
+
npx @eslint/config-inspector
|
|
492
|
+
|
|
493
|
+
# Or using pnpm
|
|
494
|
+
pnpm inspector
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
Visit http://localhost:7777/ to view and interact with your ESLint config. The inspector shows:
|
|
498
|
+
|
|
499
|
+
- All configured rules and their sources
|
|
500
|
+
- File patterns and their matching configs
|
|
501
|
+
- Plugin information
|
|
502
|
+
- Rule configurations
|
|
503
|
+
|
|
504
|
+
You can also build a static version for sharing:
|
|
505
|
+
|
|
506
|
+
```shell
|
|
507
|
+
npx @eslint/config-inspector build
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
## Individual Configs
|
|
511
|
+
|
|
512
|
+
You can also import individual configurations:
|
|
513
|
+
|
|
514
|
+
```typescript
|
|
515
|
+
import {
|
|
516
|
+
javascript,
|
|
517
|
+
typescript,
|
|
518
|
+
vue,
|
|
519
|
+
react,
|
|
520
|
+
svelte,
|
|
521
|
+
solid,
|
|
522
|
+
jsonc,
|
|
523
|
+
yaml,
|
|
524
|
+
markdown,
|
|
525
|
+
toml,
|
|
526
|
+
imports,
|
|
527
|
+
unicorn,
|
|
528
|
+
perfectionist,
|
|
529
|
+
regexp,
|
|
530
|
+
test,
|
|
531
|
+
node,
|
|
532
|
+
prettier,
|
|
533
|
+
stylistic,
|
|
534
|
+
disables,
|
|
535
|
+
command,
|
|
536
|
+
nextjs,
|
|
537
|
+
nuxt,
|
|
538
|
+
astro,
|
|
539
|
+
angular,
|
|
540
|
+
unocss,
|
|
541
|
+
e18e,
|
|
542
|
+
pnpm,
|
|
543
|
+
formatters,
|
|
544
|
+
eslintComments,
|
|
545
|
+
jsxA11y,
|
|
546
|
+
vueA11y,
|
|
547
|
+
noOnlyTests,
|
|
548
|
+
sortPackageJson,
|
|
549
|
+
sortTsconfig,
|
|
550
|
+
} from '@eslint-sets/eslint-config'
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
## Peer Dependencies
|
|
554
|
+
|
|
555
|
+
| Package | Version |
|
|
556
|
+
| ---------- | ------------------------------------------- |
|
|
557
|
+
| eslint | ^9.10.0 or ^9.22.0 |
|
|
558
|
+
| prettier | ^3.5.3 (optional, for Prettier integration) |
|
|
559
|
+
| typescript | >=5.0.0 (optional, for TypeScript support) |
|
|
560
|
+
|
|
561
|
+
## Optional Dependencies
|
|
562
|
+
|
|
563
|
+
The following packages are optional and will be used if installed:
|
|
564
|
+
|
|
565
|
+
### React
|
|
566
|
+
|
|
567
|
+
- `eslint-plugin-react` - React support
|
|
568
|
+
- `eslint-plugin-react-hooks` - React Hooks support
|
|
569
|
+
- `eslint-plugin-react-refresh` - React Refresh support
|
|
570
|
+
|
|
571
|
+
### Vue
|
|
572
|
+
|
|
573
|
+
- `eslint-plugin-vuejs-accessibility` - Vue accessibility rules
|
|
574
|
+
|
|
575
|
+
### Svelte
|
|
576
|
+
|
|
577
|
+
- `eslint-plugin-svelte` - Svelte support
|
|
578
|
+
- `svelte` - Svelte parser
|
|
579
|
+
- `svelte-eslint-parser` - Svelte ESLint parser
|
|
580
|
+
|
|
581
|
+
### Next.js
|
|
582
|
+
|
|
583
|
+
- `@next/eslint-plugin-next` - Next.js specific rules
|
|
584
|
+
|
|
585
|
+
### Astro
|
|
586
|
+
|
|
587
|
+
- `eslint-plugin-astro` - Astro support
|
|
588
|
+
- `astro-eslint-parser` - Astro ESLint parser
|
|
589
|
+
|
|
590
|
+
### Angular
|
|
591
|
+
|
|
592
|
+
- `@angular-eslint/eslint-plugin` - Angular support
|
|
593
|
+
- `@angular-eslint/eslint-plugin-template` - Angular template rules
|
|
594
|
+
- `@angular-eslint/template-parser` - Angular template parser
|
|
595
|
+
|
|
596
|
+
### UnoCSS
|
|
597
|
+
|
|
598
|
+
- `@unocss/eslint-plugin` - UnoCSS rules
|
|
599
|
+
|
|
600
|
+
### Accessibility
|
|
601
|
+
|
|
602
|
+
- `eslint-plugin-jsx-a11y` - JSX accessibility rules
|
|
603
|
+
|
|
604
|
+
### Modernization
|
|
605
|
+
|
|
606
|
+
- `@e18e/eslint-plugin` - Code modernization rules
|
|
607
|
+
|
|
608
|
+
### Workspace
|
|
609
|
+
|
|
610
|
+
- `eslint-plugin-pnpm` - pnpm workspace rules
|
|
611
|
+
|
|
612
|
+
### Formatters
|
|
613
|
+
|
|
614
|
+
- `eslint-plugin-format` - External formatters for CSS, HTML, etc.
|
|
615
|
+
|
|
616
|
+
### Markdown
|
|
617
|
+
|
|
618
|
+
- `@eslint/markdown` - Markdown linting
|
|
619
|
+
|
|
620
|
+
## Migration from v5
|
|
621
|
+
|
|
622
|
+
If you're migrating from the old `@eslint-sets/eslint-config-*` packages:
|
|
623
|
+
|
|
624
|
+
### Before (v5)
|
|
625
|
+
|
|
626
|
+
```javascript
|
|
33
627
|
// .eslintrc.js
|
|
34
628
|
module.exports = {
|
|
35
|
-
|
|
36
|
-
rules: {
|
|
37
|
-
// custom rules
|
|
38
|
-
}
|
|
629
|
+
extends: '@eslint-sets/eslint-config-vue',
|
|
39
630
|
}
|
|
40
631
|
```
|
|
41
632
|
|
|
42
|
-
|
|
633
|
+
### After (v6)
|
|
43
634
|
|
|
44
|
-
|
|
635
|
+
```typescript
|
|
636
|
+
// eslint.config.ts
|
|
637
|
+
import eslintConfig from '@eslint-sets/eslint-config'
|
|
638
|
+
|
|
639
|
+
export default eslintConfig({
|
|
640
|
+
vue: true,
|
|
641
|
+
})
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
## VS Code Integration
|
|
645
|
+
|
|
646
|
+
Add to your `.vscode/settings.json`:
|
|
647
|
+
|
|
648
|
+
```json
|
|
649
|
+
{
|
|
650
|
+
"editor.codeActionsOnSave": {
|
|
651
|
+
"source.fixAll.eslint": "explicit"
|
|
652
|
+
},
|
|
653
|
+
"eslint.experimental.useFlatConfig": true,
|
|
654
|
+
"eslint.validate": [
|
|
655
|
+
"javascript",
|
|
656
|
+
"javascriptreact",
|
|
657
|
+
"typescript",
|
|
658
|
+
"typescriptreact",
|
|
659
|
+
"vue",
|
|
660
|
+
"html",
|
|
661
|
+
"markdown",
|
|
662
|
+
"json",
|
|
663
|
+
"jsonc",
|
|
664
|
+
"yaml",
|
|
665
|
+
"toml",
|
|
666
|
+
"astro",
|
|
667
|
+
"svelte"
|
|
668
|
+
]
|
|
669
|
+
}
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
## Comparison with @antfu/eslint-config
|
|
673
|
+
|
|
674
|
+
See [COMPARISON.md](./COMPARISON.md) for a detailed comparison with `@antfu/eslint-config`.
|
|
675
|
+
|
|
676
|
+
## Changelog
|
|
677
|
+
|
|
678
|
+
See [CHANGELOG.md](./CHANGELOG.md) for release history.
|
|
45
679
|
|
|
46
680
|
## License
|
|
47
681
|
|
|
48
682
|
[MIT](LICENSE)
|
|
49
683
|
|
|
684
|
+
## Issues & Support
|
|
685
|
+
|
|
686
|
+
Please open an issue [here](https://github.com/saqqdy/eslint-sets/issues).
|
|
687
|
+
|
|
50
688
|
[npm-image]: https://img.shields.io/npm/v/@eslint-sets/eslint-config.svg?style=flat-square
|
|
51
689
|
[npm-url]: https://npmjs.org/package/@eslint-sets/eslint-config
|
|
52
|
-
[codacy-image]: https://app.codacy.com/project/badge/Grade/f70d4880e4ad4f40aa970eb9ee9d0696
|
|
53
|
-
[codacy-url]: https://www.codacy.com/gh/saqqdy/@eslint-sets/eslint-config/dashboard?utm_source=github.com&utm_medium=referral&utm_content=saqqdy/@eslint-sets/eslint-config&utm_campaign=Badge_Grade
|
|
54
|
-
[codecov-image]: https://img.shields.io/codecov/c/github/saqqdy/@eslint-sets/eslint-config.svg?style=flat-square
|
|
55
|
-
[codecov-url]: https://codecov.io/github/saqqdy/@eslint-sets/eslint-config?branch=master
|
|
56
|
-
[download-image]: https://img.shields.io/npm/dm/@eslint-sets/eslint-config.svg?style=flat-square
|
|
57
|
-
[download-url]: https://npmjs.org/package/@eslint-sets/eslint-config
|
|
58
690
|
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
|
|
59
691
|
[license-url]: LICENSE
|
|
60
|
-
[sonar-image]: https://sonarcloud.io/api/project_badges/quality_gate?project=saqqdy_eslint-sets
|
|
61
|
-
[sonar-url]: https://sonarcloud.io/dashboard?id=saqqdy_eslint-sets
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|