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