@kirklin/eslint-config 2.2.0 → 2.3.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.zh-cn.md CHANGED
@@ -36,54 +36,55 @@
36
36
  - [ESLint Flat配置](https://eslint.org/docs/latest/use/configure/configuration-files-new),轻松组合!
37
37
  - 使用[ESLint Stylistic](https://github.com/eslint-stylistic/eslint-stylistic)
38
38
  - 默认情况下遵守`.gitignore`
39
- - 可选的[React](#react)[Svelte](#svelte)[UnoCSS](#unocss)支持
39
+ - 可选的[React](#react), [Svelte](#svelte), [UnoCSS](#unocss), [Astro](#astro), [Solid](#solid)支持
40
40
  - 可选的[格式化程序](#formatters)支持CSS,HTML等。
41
41
  - **样式原则**:最小化阅读,稳定的差异性,保持一致性
42
42
 
43
43
  > [!IMPORTANT]
44
44
  > 从v1.0.0开始,该配置已重写为新的 [ESLint Flat配置](https://eslint.org/docs/latest/use/configure/configuration-files-new), 请查看[发布说明](https://github.com/kirklin/eslint-config/releases/tag/v1.0.0)以获取更多详细信息。
45
45
 
46
- ## 使用
46
+ ## 使用方法
47
47
 
48
- ### 安装
48
+ ### 起始向导
49
+
50
+ 我们提供了一个命令行工具,帮助您快速设置项目,或者通过一个命令从旧的配置迁移到新的平面配置。
49
51
 
50
52
  ```bash
51
- pnpm i -D eslint @kirklin/eslint-config
53
+ npx @kirklin/eslint-config@latest
52
54
  ```
53
55
 
54
- ### 创建配置文件
55
-
56
- 使用 `package.json` 中的 [`"type": "module"`](https://nodejs.org/api/packages.html#type) (推荐):
56
+ ### 手动安装
57
57
 
58
- ```js
59
- // eslint.config.js
60
- import kirklin from "@kirklin/eslint-config";
58
+ 如果您更喜欢手动设置:
61
59
 
62
- export default kirklin();
60
+ ```bash
61
+ pnpm i -D eslint @kirklin/eslint-config
63
62
  ```
64
63
 
65
- 使用 CJS:
64
+ 然后在您的项目根目录下创建 `eslint.config.mjs` 文件:
66
65
 
67
66
  ```js
68
- // eslint.config.js
69
- const kirklin = require("@kirklin/eslint-config").default;
67
+ // eslint.config.mjs
68
+ import kirklin from "@kirklin/eslint-config";
70
69
 
71
- module.exports = kirklin();
70
+ export default kirklin();
72
71
  ```
73
72
 
74
- > [!TIP]
75
- > ESLint只检测`eslint.config.js`作为扁平配置的入口,这意味着您需要在`package.json`中放置`type: module`,或者您必须在`eslint.config.js`中使用CJS。如果您想要明确的扩展名,如`.mjs`或`.cjs`,甚至是`eslint.config.ts`,您可以安装[`eslint-ts-patch`](https://github.com/antfu/eslint-ts-patch)来修复此问题。
73
+ <details>
74
+ <summary>
75
+ 结合旧版配置:
76
+ </summary>
76
77
 
77
- 结合旧有的配置:
78
+ 如果您仍然使用旧版`eslintrc`的一些配置,您可以使用[`@eslint/eslintrc`](https://www.npmjs.com/package/@eslint/eslintrc)将它们转换为flat config
78
79
 
79
80
  ```js
80
- // eslint.config.js
81
- const kirklin = require("@kirklin/eslint-config").default;
82
- const { FlatCompat } = require("@eslint/eslintrc");
81
+ // eslint.config.mjs
82
+ import kirklin from "@kirklin/eslint-config";
83
+ import { FlatCompat } from "@eslint/eslintrc";
83
84
 
84
85
  const compat = new FlatCompat();
85
86
 
86
- module.exports = kirklin(
87
+ export default kirklin(
87
88
  {
88
89
  ignores: [],
89
90
  },
@@ -100,11 +101,13 @@ module.exports = kirklin(
100
101
  );
101
102
  ```
102
103
 
103
- > 请注意,在Flat配置中不再支持 `.eslintignore`,请查看[自定义](#customization)以获取更多详细信息。
104
+ > 请注意,在Flat配置中不再支持 `.eslintignore`,请查看[自定义](#自定义)以获取更多详细信息。
104
105
 
105
- ### 为 package.json添加script
106
+ </details>
107
+
108
+ ### 在 package.json 中添加脚本
106
109
 
107
- 例如:
110
+ For example:
108
111
 
109
112
  ```json
110
113
  {
@@ -115,28 +118,20 @@ module.exports = kirklin(
115
118
  }
116
119
  ```
117
120
 
118
- ### 迁移
119
-
120
- 我们提供了一个实验性的CLI工具,可以帮助您从传统配置迁移到新的扁平配置。
121
-
122
- ```bash
123
- npx @kirklin/eslint-config@latest
124
- ```
125
-
126
- 在运行迁移之前,请确保先提交您未保存的更改。
127
-
128
121
  ## VS Code支持(自动修复)
129
122
 
130
- 安装 [VS Code ESLint扩展](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
123
+ 为了在Visual Studio Code中实现保存时自动修复代码的功能,您需要安装ESLint扩展并配置相应的设置。以下是详细的步骤和说明:
131
124
 
132
- 将以下设置添加到您的 `.vscode/settings.json`:
125
+ 1. 安装 [VS Code ESLint扩展](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
126
+
127
+ 2. 在您的项目根目录下,创建或编辑`.vscode`文件夹中的`settings.json`文件,添加以下配置:
133
128
 
134
129
  ```jsonc
135
130
  {
136
- // 启用ESlint Flat配置支持
131
+ // 启用ESLint flat config支持
137
132
  "eslint.experimental.useFlatConfig": true,
138
133
 
139
- // 禁用默认格式化程序,使用eslint代替
134
+ // 禁用默认的格式化程序,改用ESLint进行格式化
140
135
  "prettier.enable": false,
141
136
  "editor.formatOnSave": false,
142
137
 
@@ -146,7 +141,7 @@ npx @kirklin/eslint-config@latest
146
141
  "source.organizeImports": "never"
147
142
  },
148
143
 
149
- // 在IDE中静默风格规则,但仍自动修复它们
144
+ // 在IDE中隐藏样式规则的提示,但仍然自动修复它们
150
145
  "eslint.rules.customizations": [
151
146
  { "rule": "style/*", "severity": "off" },
152
147
  { "rule": "format/*", "severity": "off" },
@@ -160,7 +155,7 @@ npx @kirklin/eslint-config@latest
160
155
  { "rule": "*semi", "severity": "off" }
161
156
  ],
162
157
 
163
- // 为所有支持的语言启用eslint
158
+ // 为所有支持的语言启用ESLint
164
159
  "eslint.validate": [
165
160
  "javascript",
166
161
  "javascriptreact",
@@ -172,7 +167,9 @@ npx @kirklin/eslint-config@latest
172
167
  "json",
173
168
  "jsonc",
174
169
  "yaml",
175
- "toml"
170
+ "toml",
171
+ "gql",
172
+ "graphql"
176
173
  ]
177
174
  }
178
175
  ```
@@ -304,7 +301,7 @@ export default combine(
304
301
 
305
302
  | New Prefix | Original Prefix | Source Plugin |
306
303
  | ---------- | ---------------------- | ------------------------------------------------------------------------------------------ |
307
- | `import/*` | `i/*` | [eslint-plugin-i](https://github.com/un-es/eslint-plugin-i) |
304
+ | `import/*` | `import-x/*` | [eslint-plugin-import-x](https://github.com/un-es/eslint-plugin-import-x) |
308
305
  | `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) |
309
306
  | `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
310
307
  | `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
@@ -320,6 +317,17 @@ export default combine(
320
317
  type foo = { bar: 2 }
321
318
  ```
322
319
 
320
+ > [!NOTE]
321
+ > 关于插件重命名 - 实际上这是一个相当危险的举动,可能会导致潜在的命名冲突,如[这里](https://github.com/eslint/eslint/discussions/17766) 和 [这里](https://github.com/prettier/eslint-config-prettier#eslintconfigjs-flat-config-plugin-caveat) 所指出的。由于这个配置非常**个人化**和**主观化**,我雄心勃勃地将这个配置定位为每个项目唯一的**"顶层"**配置,这可能会改变规则命名的偏好。
322
+ >
323
+ > 这个配置更关心面向用户的体验,试图简化实现细节。例如,用户可以继续使用语义化的 `import/order`,而无需知道底层插件已经迁移到 `eslint-plugin-i` 然后再到 `eslint-plugin-import-x`。用户也不被迫在中途迁移到隐式的 `i/order`,仅仅因为我们将实现换成了一个分支。
324
+ >
325
+ > 话虽如此,这可能仍然不是一个好主意。如果你正在维护自己的 eslint 配置,你可能不想这样做。
326
+ >
327
+ > 如果你想将这个配置与其他配置预设组合使用,但遇到了命名冲突,请随时提出问题。我很乐意找出一种方法让它们协同工作。但目前我没有计划撤销重命名。
328
+
329
+ 从 v2.3.0 版本开始,这个预设将自动重命名插件,也适用于您的自定义配置。您可以使用原始前缀直接覆盖规则。
330
+
323
331
  ### 规则覆盖
324
332
 
325
333
  某些规则仅在特定文件中启用,例如, `ts/*` 规则仅在 `.ts` 文件中启用, `vue/*` 规则仅在 `.vue` 文件中启用。如果要覆盖规则,需要指定文件扩展名:
@@ -374,16 +382,74 @@ export default kirklin({
374
382
  });
375
383
  ```
376
384
 
385
+ ### 配置组合器
386
+
387
+ 从 v2.3.0 版本开始,工厂函数 `kirklin()` 返回了一个来自 `eslint-flat-config-utils` 的 [`FlatConfigComposer` 对象](https://github.com/antfu/eslint-flat-config-utils#composer)。您可以链式调用方法,以更加灵活地组合配置。
388
+
389
+ ```js
390
+ // eslint.config.js
391
+ import kirklin from "@kirklin/eslint-config";
392
+
393
+ export default kirklin()
394
+ .prepend(
395
+ // 主配置之前的一些配置
396
+ )
397
+ // 覆盖任何命名配置
398
+ .override(
399
+ "kirklin/imports",
400
+ {
401
+ rules: {
402
+ "import/order": ["error", { "newlines-between": "always" }],
403
+ }
404
+ }
405
+ )
406
+ // 重命名插件前缀
407
+ .renamePlugins({
408
+ "old-prefix": "new-prefix",
409
+ // ...
410
+ });
411
+ // ...
412
+ ```
413
+
414
+ 这段代码展示了如何使用 `FlatConfigComposer` 来更加精细地控制您的 ESLint 配置。通过 `prepend` 方法,您可以在主配置之前添加一些配置。`override` 方法允许您覆盖任何命名配置的规则。最后,`renamePlugins` 方法可以用于重命名插件前缀,这在处理潜在的命名冲突时非常有用。
415
+
416
+ ### Vue
417
+
418
+ 对于Vue框架的支持,是通过检查项目中是否安装了`vue`来自动检测的。您也可以明确地启用或禁用它:
419
+
420
+ ```js
421
+ // eslint.config.js
422
+ import kirklin from "@kirklin/eslint-config";
423
+
424
+ export default kirklin({
425
+ vue: true
426
+ });
427
+ ```
428
+
429
+ #### Vue 2
430
+
431
+ 对于Vue 2的有限支持(因为它已经达到了[生命周期结束](https://v2.vuejs.org/eol/)),如果您仍在使用Vue 2,可以通过设置`vueVersion`为`2`来手动配置它:
432
+
433
+ ```js
434
+ // eslint.config.js
435
+ import kirklin from "@kirklin/eslint-config";
436
+
437
+ export default kirklin({
438
+ vue: {
439
+ vueVersion: 2
440
+ },
441
+ });
442
+ ```
443
+
444
+ 由于Vue 2目前已经进入维护模式,我们只接受针对Vue 2的错误修复。当`eslint-plugin-vue`停止支持Vue 2时,我们可能会在未来移除对Vue 2的支持。如果可能的话,我们推荐您升级到Vue 3。
445
+
377
446
  ### 可选配置
378
447
 
379
- 我们提供了一些针对特定用例的可选配置,这些配置在默认情况下不包括它们的依赖项。
448
+ 我们为特定的使用场景提供了一些可选的配置,默认情况下不包含它们的依赖。这些可选配置允许您根据项目的具体需求来选择性地引入和使用,从而避免不必要的依赖引入和性能开销。您可以根据项目需要,选择启用或禁用这些可选配置。如果您想了解更多关于如何使用这些可选配置的信息,可以查阅相关文档或在社区中寻求帮助。
380
449
 
381
450
  #### 格式化器
382
451
 
383
- > [!WARNING]
384
- > 实验性功能,更改可能不遵循语义版本规范。
385
-
386
- 使用外部格式化器格式化ESLint无法处理的文件(`.css`,`.html`等)。由[`eslint-plugin-format`](https://github.com/kirklin/eslint-plugin-format)提供支持。
452
+ 使用外部格式化器格式化ESLint无法处理的文件(`.css`,`.html`等)。由[`eslint-plugin-format`](https://github.com/antfu/eslint-plugin-format)提供支持。
387
453
 
388
454
  ```js
389
455
  // eslint.config.js
@@ -411,7 +477,7 @@ export default kirklin({
411
477
  });
412
478
  ```
413
479
 
414
- 运行 `npx eslint` 应该会提示您安装所需的依赖项,否则,您可以手动安装它们:
480
+ 运行`npx eslint`时,它应该会提示您安装所需的依赖项,如果没有,您可以手动安装它们:
415
481
 
416
482
  ```bash
417
483
  npm i -D eslint-plugin-format
@@ -419,7 +485,7 @@ npm i -D eslint-plugin-format
419
485
 
420
486
  #### React
421
487
 
422
- 要启用React支持,您需要明确地将其打开:
488
+ 要启用React框架的支持,您需要明确地将其打开:
423
489
 
424
490
  ```js
425
491
  // eslint.config.js
@@ -430,7 +496,7 @@ export default kirklin({
430
496
  });
431
497
  ```
432
498
 
433
- 运行 npx eslint 应该会提示您安装所需的依赖项,否则,您可以手动安装它们:
499
+ 运行`npx eslint`时,它应该会提示您安装所需的依赖项,如果没有,您可以手动安装它们:
434
500
 
435
501
  ```bash
436
502
  npm i -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refresh
@@ -438,7 +504,7 @@ npm i -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refre
438
504
 
439
505
  #### Svelte
440
506
 
441
- 要启用Svelte支持,您需要明确地将其打开:
507
+ 要启用Svelte框架的支持,您需要明确地将其打开:
442
508
 
443
509
  ```js
444
510
  // eslint.config.js
@@ -449,15 +515,53 @@ export default kirklin({
449
515
  });
450
516
  ```
451
517
 
452
- 运行 `npx eslint` 应该会提示您安装所需的依赖项,否则,您可以手动安装它们:
518
+ 运行`npx eslint`时,它应该会提示您安装所需的依赖项,如果没有,您可以手动安装它们:
453
519
 
454
520
  ```bash
455
521
  npm i -D eslint-plugin-svelte
456
522
  ```
457
523
 
524
+ #### Astro
525
+
526
+ 要启用Astro框架的支持,您需要明确地在配置中启用它:
527
+
528
+ ```js
529
+ // eslint.config.js
530
+ import kirklin from "@kirklin/eslint-config";
531
+
532
+ export default kirklin({
533
+ astro: true,
534
+ });
535
+ ```
536
+
537
+ 运行`npx eslint`时,它应该会提示您安装所需的依赖项,如果没有,您可以手动安装它们:
538
+
539
+ ```bash
540
+ npm i -D eslint-plugin-astro
541
+ ```
542
+
543
+ #### Solid
544
+
545
+ 要启用Solid框架的支持,您需要明确地在配置中启用它:
546
+
547
+ ```js
548
+ // eslint.config.js
549
+ import kirklin from "@kirklin/eslint-config";
550
+
551
+ export default kirklin({
552
+ solid: true,
553
+ });
554
+ ```
555
+
556
+ 运行`npx eslint`时,它应该会提示您安装所需的依赖项,如果没有,您可以手动安装它们:
557
+
558
+ ```bash
559
+ npm i -D eslint-plugin-solid
560
+ ```
561
+
458
562
  #### UnoCSS
459
563
 
460
- 要启用UnoCSS支持,您需要明确地将其打开:
564
+ 要启用UnoCSS框架的支持,您需要明确地在配置中启用它:
461
565
 
462
566
  ```js
463
567
  // eslint.config.js
@@ -468,7 +572,7 @@ export default kirklin({
468
572
  });
469
573
  ```
470
574
 
471
- 运行 `npx eslint` 应该会提示您安装所需的依赖项,否则,您可以手动安装它们:
575
+ 运行`npx eslint`时,它应该会提示您安装所需的依赖项,如果没有,您可以手动安装它们:
472
576
 
473
577
  ```bash
474
578
  npm i -D @unocss/eslint-plugin
@@ -493,7 +597,6 @@ const objectWantedToSort = {
493
597
  b: 1,
494
598
  c: 3,
495
599
  };
496
- /* eslint perfectionist/sort-objects: "off" */
497
600
  ```
498
601
 
499
602
  ### 类型感知规则
@@ -511,6 +614,21 @@ export default kirklin({
511
614
  });
512
615
  ```
513
616
 
617
+ ### 编辑器特定禁用
618
+
619
+ 有些规则在ESLint IDE集成中被禁用,具体来说是 [`unused-imports/no-unused-imports`](https://www.npmjs.com/package/eslint-plugin-unused-imports) 和 [`test/no-only-tests`](https://github.com/levibuzolic/eslint-plugin-no-only-tests)。
620
+
621
+ 这样做是为了防止在重构过程中IDE自动移除未使用的导入,以提供更好的开发体验。当您在终端或使用 [Lint Staged](#lint-staged) 运行ESLint时,这些规则将会被应用。如果您不希望有这样的行为,可以通过以下方式禁用它们:
622
+
623
+ ```js
624
+ // eslint.config.js
625
+ import kirklin from "@kirklin/eslint-config";
626
+
627
+ export default kirklin({
628
+ isInEditor: false
629
+ });
630
+ ```
631
+
514
632
  ### Lint Staged
515
633
 
516
634
  如果您想在每次提交之前应用lint和自动修复,可以将以下内容添加到您的 `package.json` 中:
@@ -537,7 +655,7 @@ npx simple-git-hooks
537
655
 
538
656
  ## 查看启用的规则
539
657
 
540
- 我创建了一个可视化工具,帮助您查看项目中启用了哪些规则,并将它们应用于哪些文件,[eslint-flat-config-viewer](https://github.com/kirklin/eslint-flat-config-viewer)
658
+ 我创建了一个可视化工具,帮助您查看项目中启用了哪些规则,并将它们应用于哪些文件,[@eslint/config-inspector](https://github.com/eslint/config-inspector)
541
659
 
542
660
  前往包含 `eslint.config.js` 的项目根目录,并运行:
543
661
 
package/dist/cli.cjs CHANGED
@@ -48,7 +48,7 @@ var import_picocolors = __toESM(require("picocolors"), 1);
48
48
  var package_default = {
49
49
  name: "@kirklin/eslint-config",
50
50
  type: "module",
51
- version: "2.2.0",
51
+ version: "2.3.1",
52
52
  packageManager: "pnpm@8.15.5",
53
53
  description: "Kirk Lin's ESLint config",
54
54
  author: "Kirk Lin (https://github.com/kirklin/)",
@@ -72,12 +72,14 @@ var package_default = {
72
72
  "dist"
73
73
  ],
74
74
  scripts: {
75
- build: "tsup --format esm,cjs --clean --dts",
75
+ build: "nr typegen && tsup --format esm,cjs --clean --dts",
76
76
  stub: "tsup --format esm",
77
- dev: "tsup --format esm,cjs --watch & eslint-flat-config-viewer",
77
+ dev: "npx @eslint/config-inspector --config eslint.config.ts",
78
+ "build:inspector": "pnpm build && npx @eslint/config-inspector build",
78
79
  watch: "tsup --format esm,cjs --watch",
79
80
  lint: "eslint .",
80
81
  "lint:fix": "eslint . --fix",
82
+ typegen: "esno scripts/typegen.ts",
81
83
  prepack: "nr build",
82
84
  release: "bumpp && pnpm publish",
83
85
  test: "vitest",
@@ -93,7 +95,8 @@ var package_default = {
93
95
  "eslint-plugin-react": "^7.33.2",
94
96
  "eslint-plugin-react-hooks": "^4.6.0",
95
97
  "eslint-plugin-react-refresh": "^0.4.4",
96
- "eslint-plugin-svelte": "^2.34.1",
98
+ "eslint-plugin-solid": "^0.13.2",
99
+ "eslint-plugin-svelte": ">=2.35.1",
97
100
  "prettier-plugin-astro": "^0.13.0",
98
101
  "prettier-plugin-slidev": "^1.0.5",
99
102
  "svelte-eslint-parser": "^0.33.1"
@@ -120,6 +123,9 @@ var package_default = {
120
123
  "eslint-plugin-react-refresh": {
121
124
  optional: true
122
125
  },
126
+ "eslint-plugin-solid": {
127
+ optional: true
128
+ },
123
129
  "eslint-plugin-svelte": {
124
130
  optional: true
125
131
  },
@@ -134,34 +140,31 @@ var package_default = {
134
140
  }
135
141
  },
136
142
  dependencies: {
137
- "@antfu/eslint-define-config": "1.23.0-2",
138
- "@antfu/install-pkg": "^0.3.1",
143
+ "@antfu/install-pkg": "^0.3.2",
139
144
  "@clack/prompts": "^0.7.0",
140
- "@eslint-types/jsdoc": "48.2.1",
141
- "@eslint-types/typescript-eslint": "^7.2.0",
142
- "@eslint-types/unicorn": "^51.0.1",
143
145
  "@stylistic/eslint-plugin": "^1.7.0",
144
- "@typescript-eslint/eslint-plugin": "^7.3.1",
145
- "@typescript-eslint/parser": "^7.3.1",
146
- "eslint-config-flat-gitignore": "^0.1.3",
146
+ "@typescript-eslint/eslint-plugin": "^7.6.0",
147
+ "@typescript-eslint/parser": "^7.6.0",
148
+ "eslint-config-flat-gitignore": "^0.1.5",
149
+ "eslint-flat-config-utils": "^0.2.3",
147
150
  "eslint-merge-processors": "^0.1.0",
148
151
  "eslint-plugin-eslint-comments": "^3.2.0",
149
- "eslint-plugin-i": "^2.29.1",
150
- "eslint-plugin-jsdoc": "^48.2.1",
151
- "eslint-plugin-jsonc": "^2.14.1",
152
- "eslint-plugin-kirklin": "^1.1.0",
152
+ "eslint-plugin-import-x": "^0.5.0",
153
+ "eslint-plugin-jsdoc": "^48.2.3",
154
+ "eslint-plugin-jsonc": "^2.15.1",
155
+ "eslint-plugin-kirklin": "^1.2.0",
153
156
  "eslint-plugin-markdown": "^4.0.1",
154
- "eslint-plugin-n": "^16.6.2",
157
+ "eslint-plugin-n": "^17.2.1",
155
158
  "eslint-plugin-no-only-tests": "^3.1.0",
156
- "eslint-plugin-perfectionist": "^2.7.0",
157
- "eslint-plugin-toml": "^0.10.0",
158
- "eslint-plugin-unicorn": "^51.0.1",
159
+ "eslint-plugin-perfectionist": "^2.9.0",
160
+ "eslint-plugin-toml": "^0.11.0",
161
+ "eslint-plugin-unicorn": "^52.0.0",
159
162
  "eslint-plugin-unused-imports": "^3.1.0",
160
- "eslint-plugin-vitest": "^0.3.26",
161
- "eslint-plugin-vue": "^9.23.0",
162
- "eslint-plugin-yml": "^1.13.1",
163
+ "eslint-plugin-vitest": "^0.5.3",
164
+ "eslint-plugin-vue": "^9.25.0",
165
+ "eslint-plugin-yml": "^1.14.0",
163
166
  "eslint-processor-vue-blocks": "^0.1.1",
164
- globals: "^14.0.0",
167
+ globals: "^15.0.0",
165
168
  "jsonc-eslint-parser": "^2.4.0",
166
169
  "local-pkg": "^0.5.0",
167
170
  "parse-gitignore": "^2.0.0",
@@ -172,27 +175,29 @@ var package_default = {
172
175
  yargs: "^17.7.2"
173
176
  },
174
177
  devDependencies: {
175
- "@antfu/eslint-plugin-prettier": "5.0.1-1",
178
+ "@antfu/eslint-plugin-prettier": "^5.0.1-1",
176
179
  "@antfu/ni": "^0.21.12",
180
+ "@eslint/config-inspector": "^0.4.6",
177
181
  "@kirklin/eslint-config": "workspace:*",
178
182
  "@stylistic/eslint-plugin-migrate": "^1.7.0",
179
- "@types/eslint": "^8.56.6",
183
+ "@types/eslint": "^8.56.9",
180
184
  "@types/fs-extra": "^11.0.4",
181
- "@types/node": "^20.11.30",
185
+ "@types/node": "^20.12.7",
182
186
  "@types/prompts": "^2.4.9",
183
187
  "@types/yargs": "^17.0.32",
184
- "@unocss/eslint-plugin": "^0.58.6",
185
- "astro-eslint-parser": "^0.16.3",
188
+ "@unocss/eslint-plugin": "^0.59.2",
189
+ "astro-eslint-parser": "^0.17.0",
186
190
  bumpp: "^9.4.0",
187
- eslint: "npm:eslint-ts-patch@8.57.0-0",
188
- "eslint-flat-config-viewer": "^0.1.11",
189
- "eslint-plugin-astro": "^0.32.0",
191
+ "bundle-require": "^4.0.2",
192
+ eslint: "^9.0.0",
193
+ "eslint-plugin-astro": "^0.34.0",
190
194
  "eslint-plugin-format": "^0.1.0",
191
195
  "eslint-plugin-react": "^7.34.1",
192
196
  "eslint-plugin-react-hooks": "^4.6.0",
193
197
  "eslint-plugin-react-refresh": "^0.4.6",
194
- "eslint-plugin-svelte": "^2.35.1",
195
- "eslint-ts-patch": "8.57.0-0",
198
+ "eslint-plugin-solid": "^0.13.2",
199
+ "eslint-plugin-svelte": "2.36.0-next.13",
200
+ "eslint-typegen": "^0.2.3",
196
201
  esno: "^4.7.0",
197
202
  execa: "^8.0.1",
198
203
  "fast-glob": "^3.3.2",
@@ -201,12 +206,12 @@ var package_default = {
201
206
  "prettier-plugin-astro": "^0.13.0",
202
207
  "prettier-plugin-slidev": "^1.0.5",
203
208
  rimraf: "^5.0.5",
204
- "simple-git-hooks": "^2.11.0",
205
- svelte: "^4.2.12",
206
- "svelte-eslint-parser": "^0.33.1",
209
+ "simple-git-hooks": "^2.11.1",
210
+ svelte: "^4.2.14",
211
+ "svelte-eslint-parser": "^0.34.1",
207
212
  tsup: "^8.0.2",
208
- typescript: "^5.4.2",
209
- vitest: "^1.4.0",
213
+ typescript: "^5.4.5",
214
+ vitest: "^1.5.0",
210
215
  vue: "^3.4.21"
211
216
  },
212
217
  "simple-git-hooks": {
@@ -279,6 +284,10 @@ var frameworkOptions = [
279
284
  label: import_picocolors.default.magenta("Astro"),
280
285
  value: "astro"
281
286
  },
287
+ {
288
+ label: import_picocolors.default.cyan("Solid"),
289
+ value: "solid"
290
+ },
282
291
  {
283
292
  label: import_picocolors.default.blue("Slidev"),
284
293
  value: "slidev"
@@ -310,6 +319,9 @@ var dependenciesMap = {
310
319
  slidev: [
311
320
  "prettier-plugin-slidev"
312
321
  ],
322
+ solid: [
323
+ "eslint-plugin-solid"
324
+ ],
313
325
  svelte: [
314
326
  "eslint-plugin-svelte",
315
327
  "svelte-eslint-parser"
@@ -346,15 +358,14 @@ var import_node_process = __toESM(require("process"), 1);
346
358
  var import_picocolors2 = __toESM(require("picocolors"), 1);
347
359
  var p = __toESM(require("@clack/prompts"), 1);
348
360
  async function updatePackageJson(result) {
349
- var _a;
350
361
  const cwd = import_node_process.default.cwd();
351
362
  const pathPackageJSON = import_node_path.default.join(cwd, "package.json");
352
363
  p.log.step(import_picocolors2.default.cyan(`Bumping @kirklin/eslint-config to v${package_default.version}`));
353
364
  const pkgContent = await import_promises.default.readFile(pathPackageJSON, "utf-8");
354
365
  const pkg = JSON.parse(pkgContent);
355
- pkg.devDependencies ?? (pkg.devDependencies = {});
366
+ pkg.devDependencies ??= {};
356
367
  pkg.devDependencies["@kirklin/eslint-config"] = `^${package_default.version}`;
357
- (_a = pkg.devDependencies).eslint ?? (_a.eslint = package_default.devDependencies.eslint.replace("npm:eslint-ts-patch@", "").replace(/-\d+$/, ""));
368
+ pkg.devDependencies.eslint ??= package_default.devDependencies.eslint.replace("npm:eslint-ts-patch@", "").replace(/-\d+$/, "");
358
369
  const addedPackages = [];
359
370
  if (result.extra.length) {
360
371
  result.extra.forEach((item) => {
@@ -509,7 +520,7 @@ async function run(options = {}) {
509
520
  result = await p4.group({
510
521
  uncommittedConfirmed: () => {
511
522
  if (argSkipPrompt || isGitClean()) {
512
- return;
523
+ return Promise.resolve(true);
513
524
  }
514
525
  return p4.confirm({
515
526
  initialValue: false,
@@ -524,7 +535,8 @@ async function run(options = {}) {
524
535
  const message = !isArgTemplateValid && argTemplate ? `"${argTemplate}" isn't a valid template. Please choose from below: ` : "Select a framework:";
525
536
  return p4.multiselect({
526
537
  message: import_picocolors5.default.reset(message),
527
- options: frameworkOptions
538
+ options: frameworkOptions,
539
+ required: false
528
540
  });
529
541
  },
530
542
  extra: ({ results }) => {