@kirklin/eslint-config 2.5.0 → 2.6.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 +127 -15
- package/README.zh-cn.md +129 -19
- package/dist/cli.cjs +64 -61
- package/dist/cli.js +64 -61
- package/dist/index.cjs +115 -34
- package/dist/index.d.cts +839 -1223
- package/dist/index.d.ts +839 -1223
- package/dist/index.js +107 -34
- package/package.json +54 -51
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
We provided a CLI tool to help you set up your project, or migrate from the legacy config to the new flat config with one command.
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
|
|
54
|
+
pnpm dlx @kirklin/eslint-config@latest
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
### Manual Install
|
|
@@ -119,7 +119,12 @@ For example:
|
|
|
119
119
|
}
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
##
|
|
122
|
+
## IDE Support (auto fix on save)
|
|
123
|
+
|
|
124
|
+
<details>
|
|
125
|
+
<summary>🟦 VS Code support</summary>
|
|
126
|
+
|
|
127
|
+
<br>
|
|
123
128
|
|
|
124
129
|
Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
|
125
130
|
|
|
@@ -139,16 +144,16 @@ Add the following settings to your `.vscode/settings.json`:
|
|
|
139
144
|
|
|
140
145
|
// Silent the stylistic rules in you IDE, but still auto fix them
|
|
141
146
|
"eslint.rules.customizations": [
|
|
142
|
-
{ "rule": "style/*", "severity": "off" },
|
|
143
|
-
{ "rule": "format/*", "severity": "off" },
|
|
144
|
-
{ "rule": "*-indent", "severity": "off" },
|
|
145
|
-
{ "rule": "*-spacing", "severity": "off" },
|
|
146
|
-
{ "rule": "*-spaces", "severity": "off" },
|
|
147
|
-
{ "rule": "*-order", "severity": "off" },
|
|
148
|
-
{ "rule": "*-dangle", "severity": "off" },
|
|
149
|
-
{ "rule": "*-newline", "severity": "off" },
|
|
150
|
-
{ "rule": "*quotes", "severity": "off" },
|
|
151
|
-
{ "rule": "*semi", "severity": "off" }
|
|
147
|
+
{ "rule": "style/*", "severity": "off", "fixable": true },
|
|
148
|
+
{ "rule": "format/*", "severity": "off", "fixable": true },
|
|
149
|
+
{ "rule": "*-indent", "severity": "off", "fixable": true },
|
|
150
|
+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
|
|
151
|
+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
|
|
152
|
+
{ "rule": "*-order", "severity": "off", "fixable": true },
|
|
153
|
+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
|
|
154
|
+
{ "rule": "*-newline", "severity": "off", "fixable": true },
|
|
155
|
+
{ "rule": "*quotes", "severity": "off", "fixable": true },
|
|
156
|
+
{ "rule": "*semi", "severity": "off", "fixable": true }
|
|
152
157
|
],
|
|
153
158
|
|
|
154
159
|
// Enable eslint for all supported languages
|
|
@@ -168,6 +173,7 @@ Add the following settings to your `.vscode/settings.json`:
|
|
|
168
173
|
"gql",
|
|
169
174
|
"graphql",
|
|
170
175
|
"astro",
|
|
176
|
+
"svelte",
|
|
171
177
|
"css",
|
|
172
178
|
"less",
|
|
173
179
|
"scss",
|
|
@@ -177,6 +183,90 @@ Add the following settings to your `.vscode/settings.json`:
|
|
|
177
183
|
}
|
|
178
184
|
```
|
|
179
185
|
|
|
186
|
+
</details>
|
|
187
|
+
|
|
188
|
+
<details>
|
|
189
|
+
<summary>🟩 Neovim Support</summary>
|
|
190
|
+
|
|
191
|
+
<br>
|
|
192
|
+
|
|
193
|
+
Update your configuration to use the following:
|
|
194
|
+
|
|
195
|
+
```lua
|
|
196
|
+
local customizations = {
|
|
197
|
+
{ rule = 'style/*', severity = 'off', fixable = true },
|
|
198
|
+
{ rule = 'format/*', severity = 'off', fixable = true },
|
|
199
|
+
{ rule = '*-indent', severity = 'off', fixable = true },
|
|
200
|
+
{ rule = '*-spacing', severity = 'off', fixable = true },
|
|
201
|
+
{ rule = '*-spaces', severity = 'off', fixable = true },
|
|
202
|
+
{ rule = '*-order', severity = 'off', fixable = true },
|
|
203
|
+
{ rule = '*-dangle', severity = 'off', fixable = true },
|
|
204
|
+
{ rule = '*-newline', severity = 'off', fixable = true },
|
|
205
|
+
{ rule = '*quotes', severity = 'off', fixable = true },
|
|
206
|
+
{ rule = '*semi', severity = 'off', fixable = true },
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
local lspconfig = require('lspconfig')
|
|
210
|
+
-- Enable eslint for all supported languages
|
|
211
|
+
lspconfig.eslint.setup(
|
|
212
|
+
{
|
|
213
|
+
filetypes = {
|
|
214
|
+
"javascript",
|
|
215
|
+
"javascriptreact",
|
|
216
|
+
"javascript.jsx",
|
|
217
|
+
"typescript",
|
|
218
|
+
"typescriptreact",
|
|
219
|
+
"typescript.tsx",
|
|
220
|
+
"vue",
|
|
221
|
+
"html",
|
|
222
|
+
"markdown",
|
|
223
|
+
"json",
|
|
224
|
+
"jsonc",
|
|
225
|
+
"yaml",
|
|
226
|
+
"toml",
|
|
227
|
+
"xml",
|
|
228
|
+
"gql",
|
|
229
|
+
"graphql",
|
|
230
|
+
"astro",
|
|
231
|
+
"svelte",
|
|
232
|
+
"css",
|
|
233
|
+
"less",
|
|
234
|
+
"scss",
|
|
235
|
+
"pcss",
|
|
236
|
+
"postcss"
|
|
237
|
+
},
|
|
238
|
+
settings = {
|
|
239
|
+
-- Silent the stylistic rules in you IDE, but still auto fix them
|
|
240
|
+
rulesCustomizations = customizations,
|
|
241
|
+
},
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Neovim format on save
|
|
247
|
+
|
|
248
|
+
There's few ways you can achieve format on save in neovim:
|
|
249
|
+
|
|
250
|
+
- `nvim-lspconfig` has a `EslintFixAll` command predefined, you can create a autocmd to call this command after saving file.
|
|
251
|
+
|
|
252
|
+
```lua
|
|
253
|
+
lspconfig.eslint.setup({
|
|
254
|
+
--- ...
|
|
255
|
+
on_attach = function(client, bufnr)
|
|
256
|
+
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
257
|
+
buffer = bufnr,
|
|
258
|
+
command = "EslintFixAll",
|
|
259
|
+
})
|
|
260
|
+
end,
|
|
261
|
+
})
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
- Use [conform.nvim](https://github.com/stevearc/conform.nvim).
|
|
265
|
+
- Use [none-ls](https://github.com/nvimtools/none-ls.nvim)
|
|
266
|
+
- Use [nvim-lint](https://github.com/mfussenegger/nvim-lint)
|
|
267
|
+
|
|
268
|
+
</details>
|
|
269
|
+
|
|
180
270
|
## Customization
|
|
181
271
|
|
|
182
272
|
Since v1.0, we migrated to [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new). It provides much better organization and composition.
|
|
@@ -197,6 +287,9 @@ And that's it! Or you can configure each integration individually, for example:
|
|
|
197
287
|
import kirklin from "@kirklin/eslint-config";
|
|
198
288
|
|
|
199
289
|
export default kirklin({
|
|
290
|
+
// Type of the project. 'lib' for libraries, the default is 'app'
|
|
291
|
+
type: "lib",
|
|
292
|
+
|
|
200
293
|
// Enable stylistic formatting rules
|
|
201
294
|
// stylistic: true,
|
|
202
295
|
|
|
@@ -206,7 +299,7 @@ export default kirklin({
|
|
|
206
299
|
quotes: "double", // or 'single'
|
|
207
300
|
},
|
|
208
301
|
|
|
209
|
-
// TypeScript and Vue are
|
|
302
|
+
// TypeScript and Vue are autodetected, you can also explicitly enable them:
|
|
210
303
|
typescript: true,
|
|
211
304
|
vue: true,
|
|
212
305
|
|
|
@@ -309,7 +402,7 @@ Since flat config requires us to explicitly provide the plugin names (instead of
|
|
|
309
402
|
| `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
|
|
310
403
|
| `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
|
|
311
404
|
| `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
|
|
312
|
-
| `test/*` | `vitest/*` | [eslint-plugin
|
|
405
|
+
| `test/*` | `vitest/*` | [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest) |
|
|
313
406
|
| `test/*` | `no-only-tests/*` | [eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests) |
|
|
314
407
|
|
|
315
408
|
When you want to override rules, or disable them inline, you need to update to the new prefix:
|
|
@@ -329,7 +422,26 @@ type foo = { bar: 2 }
|
|
|
329
422
|
>
|
|
330
423
|
> Feel free to open issues if you want to combine this config with some other config presets but faced naming collisions. I am happy to figure out a way to make them work. But at this moment I have no plan to revert the renaming.
|
|
331
424
|
|
|
332
|
-
Since v2.
|
|
425
|
+
Since v2.3.0, this preset will automatically rename the plugins also for your custom configs. You can use the original prefix to override the rules directly.
|
|
426
|
+
|
|
427
|
+
<details>
|
|
428
|
+
<summary>Change back to original prefix</summary>
|
|
429
|
+
|
|
430
|
+
If you really want to use the original prefix, you can revert the plugin renaming by:
|
|
431
|
+
|
|
432
|
+
```ts
|
|
433
|
+
import kirklin from "@kirklin/eslint-config";
|
|
434
|
+
|
|
435
|
+
export default kirklin()
|
|
436
|
+
.renamePlugins({
|
|
437
|
+
ts: "@typescript-eslint",
|
|
438
|
+
yaml: "yml",
|
|
439
|
+
node: "n"
|
|
440
|
+
// ...
|
|
441
|
+
});
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
</details>
|
|
333
445
|
|
|
334
446
|
### Rules Overrides
|
|
335
447
|
|
package/README.zh-cn.md
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
我们提供了一个命令行工具,帮助您快速设置项目,或者通过一个命令从旧的配置迁移到新的平面配置。
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
|
|
53
|
+
pnpm dlx @kirklin/eslint-config@latest
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
### 手动安装
|
|
@@ -118,17 +118,20 @@ For example:
|
|
|
118
118
|
}
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
##
|
|
121
|
+
## IDE 支持(保存时自动修复)
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
<details>
|
|
124
|
+
<summary>🟦 VS Code 支持</summary>
|
|
125
|
+
|
|
126
|
+
<br>
|
|
124
127
|
|
|
125
|
-
|
|
128
|
+
安装 [VS Code ESLint 插件](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
|
126
129
|
|
|
127
|
-
|
|
130
|
+
在 `.vscode/settings.json` 中添加以下设置:
|
|
128
131
|
|
|
129
132
|
```jsonc
|
|
130
133
|
{
|
|
131
|
-
//
|
|
134
|
+
// 禁用默认格式化器,使用 eslint 代替
|
|
132
135
|
"prettier.enable": false,
|
|
133
136
|
"editor.formatOnSave": false,
|
|
134
137
|
|
|
@@ -138,21 +141,21 @@ For example:
|
|
|
138
141
|
"source.organizeImports": "never"
|
|
139
142
|
},
|
|
140
143
|
|
|
141
|
-
// 在IDE
|
|
144
|
+
// 在IDE中静默样式规则,但仍然自动修复
|
|
142
145
|
"eslint.rules.customizations": [
|
|
143
|
-
{ "rule": "style/*", "severity": "off" },
|
|
144
|
-
{ "rule": "format/*", "severity": "off" },
|
|
145
|
-
{ "rule": "*-indent", "severity": "off" },
|
|
146
|
-
{ "rule": "*-spacing", "severity": "off" },
|
|
147
|
-
{ "rule": "*-spaces", "severity": "off" },
|
|
148
|
-
{ "rule": "*-order", "severity": "off" },
|
|
149
|
-
{ "rule": "*-dangle", "severity": "off" },
|
|
150
|
-
{ "rule": "*-newline", "severity": "off" },
|
|
151
|
-
{ "rule": "*quotes", "severity": "off" },
|
|
152
|
-
{ "rule": "*semi", "severity": "off" }
|
|
146
|
+
{ "rule": "style/*", "severity": "off", "fixable": true },
|
|
147
|
+
{ "rule": "format/*", "severity": "off", "fixable": true },
|
|
148
|
+
{ "rule": "*-indent", "severity": "off", "fixable": true },
|
|
149
|
+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
|
|
150
|
+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
|
|
151
|
+
{ "rule": "*-order", "severity": "off", "fixable": true },
|
|
152
|
+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
|
|
153
|
+
{ "rule": "*-newline", "severity": "off", "fixable": true },
|
|
154
|
+
{ "rule": "*quotes", "severity": "off", "fixable": true },
|
|
155
|
+
{ "rule": "*semi", "severity": "off", "fixable": true }
|
|
153
156
|
],
|
|
154
157
|
|
|
155
|
-
// 为所有支持的语言启用
|
|
158
|
+
// 为所有支持的语言启用 eslint
|
|
156
159
|
"eslint.validate": [
|
|
157
160
|
"javascript",
|
|
158
161
|
"javascriptreact",
|
|
@@ -169,6 +172,7 @@ For example:
|
|
|
169
172
|
"gql",
|
|
170
173
|
"graphql",
|
|
171
174
|
"astro",
|
|
175
|
+
"svelte",
|
|
172
176
|
"css",
|
|
173
177
|
"less",
|
|
174
178
|
"scss",
|
|
@@ -178,6 +182,90 @@ For example:
|
|
|
178
182
|
}
|
|
179
183
|
```
|
|
180
184
|
|
|
185
|
+
</details>
|
|
186
|
+
|
|
187
|
+
<details>
|
|
188
|
+
<summary>🟩 Neovim 支持</summary>
|
|
189
|
+
|
|
190
|
+
<br>
|
|
191
|
+
|
|
192
|
+
更新你的配置,使用以下内容:
|
|
193
|
+
|
|
194
|
+
```lua
|
|
195
|
+
local customizations = {
|
|
196
|
+
{ rule = 'style/*', severity = 'off', fixable = true },
|
|
197
|
+
{ rule = 'format/*', severity = 'off', fixable = true },
|
|
198
|
+
{ rule = '*-indent', severity = 'off', fixable = true },
|
|
199
|
+
{ rule = '*-spacing', severity = 'off', fixable = true },
|
|
200
|
+
{ rule = '*-spaces', severity = 'off', fixable = true },
|
|
201
|
+
{ rule = '*-order', severity = 'off', fixable = true },
|
|
202
|
+
{ rule = '*-dangle', severity = 'off', fixable = true },
|
|
203
|
+
{ rule = '*-newline', severity = 'off', fixable = true },
|
|
204
|
+
{ rule = '*quotes', severity = 'off', fixable = true },
|
|
205
|
+
{ rule = '*semi', severity = 'off', fixable = true },
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
local lspconfig = require('lspconfig')
|
|
209
|
+
-- 为所有支持的语言启用 eslint
|
|
210
|
+
lspconfig.eslint.setup(
|
|
211
|
+
{
|
|
212
|
+
filetypes = {
|
|
213
|
+
"javascript",
|
|
214
|
+
"javascriptreact",
|
|
215
|
+
"javascript.jsx",
|
|
216
|
+
"typescript",
|
|
217
|
+
"typescriptreact",
|
|
218
|
+
"typescript.tsx",
|
|
219
|
+
"vue",
|
|
220
|
+
"html",
|
|
221
|
+
"markdown",
|
|
222
|
+
"json",
|
|
223
|
+
"jsonc",
|
|
224
|
+
"yaml",
|
|
225
|
+
"toml",
|
|
226
|
+
"xml",
|
|
227
|
+
"gql",
|
|
228
|
+
"graphql",
|
|
229
|
+
"astro",
|
|
230
|
+
"svelte",
|
|
231
|
+
"css",
|
|
232
|
+
"less",
|
|
233
|
+
"scss",
|
|
234
|
+
"pcss",
|
|
235
|
+
"postcss"
|
|
236
|
+
},
|
|
237
|
+
settings = {
|
|
238
|
+
-- 在IDE中静默样式规则,但仍然自动修复
|
|
239
|
+
rulesCustomizations = customizations,
|
|
240
|
+
},
|
|
241
|
+
}
|
|
242
|
+
)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Neovim 保存时格式化
|
|
246
|
+
|
|
247
|
+
在 Neovim 中实现保存时格式化有几种方法:
|
|
248
|
+
|
|
249
|
+
- `nvim-lspconfig` 预定义了 `EslintFixAll` 命令,你可以创建一个 autocmd,在保存文件后调用该命令。
|
|
250
|
+
|
|
251
|
+
```lua
|
|
252
|
+
lspconfig.eslint.setup({
|
|
253
|
+
--- ...
|
|
254
|
+
on_attach = function(client, bufnr)
|
|
255
|
+
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
256
|
+
buffer = bufnr,
|
|
257
|
+
command = "EslintFixAll",
|
|
258
|
+
})
|
|
259
|
+
end,
|
|
260
|
+
})
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
- 使用 [conform.nvim](https://github.com/stevearc/conform.nvim)。
|
|
264
|
+
- 使用 [none-ls](https://github.com/nvimtools/none-ls.nvim)。
|
|
265
|
+
- 使用 [nvim-lint](https://github.com/mfussenegger/nvim-lint)。
|
|
266
|
+
|
|
267
|
+
</details>
|
|
268
|
+
|
|
181
269
|
## 自定义
|
|
182
270
|
|
|
183
271
|
从v1.0开始,我们迁移到了[ESLint Flat 配置](https://eslint.org/docs/latest/use/configure/configuration-files-new)。它提供了更好的组织和组合。
|
|
@@ -198,6 +286,9 @@ export default kirklin();
|
|
|
198
286
|
import kirklin from "@kirklin/eslint-config";
|
|
199
287
|
|
|
200
288
|
export default kirklin({
|
|
289
|
+
// 项目类型。'lib' 表示库,默认是 'app'
|
|
290
|
+
type: "lib",
|
|
291
|
+
|
|
201
292
|
// 启用风格格式规则
|
|
202
293
|
// stylistic: true,
|
|
203
294
|
|
|
@@ -310,7 +401,7 @@ export default combine(
|
|
|
310
401
|
| `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
|
|
311
402
|
| `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
|
|
312
403
|
| `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
|
|
313
|
-
| `test/*` | `vitest/*` | [eslint-plugin
|
|
404
|
+
| `test/*` | `vitest/*` | [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest) |
|
|
314
405
|
| `test/*` | `no-only-tests/*` | [eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests) |
|
|
315
406
|
|
|
316
407
|
当您想要覆盖规则或在内联中禁用它们时,您需要更新新前缀:
|
|
@@ -332,6 +423,25 @@ type foo = { bar: 2 }
|
|
|
332
423
|
|
|
333
424
|
从 v2.3.0 版本开始,这个预设将自动重命名插件,也适用于您的自定义配置。您可以使用原始前缀直接覆盖规则。
|
|
334
425
|
|
|
426
|
+
<details>
|
|
427
|
+
<summary>恢复原始前缀</summary>
|
|
428
|
+
|
|
429
|
+
如果你确实想使用原始前缀,可以通过以下方式还原插件重命名:
|
|
430
|
+
|
|
431
|
+
```ts
|
|
432
|
+
import kirklin from "@kirklin/eslint-config";
|
|
433
|
+
|
|
434
|
+
export default kirklin()
|
|
435
|
+
.renamePlugins({
|
|
436
|
+
ts: "@typescript-eslint",
|
|
437
|
+
yaml: "yml",
|
|
438
|
+
node: "n"
|
|
439
|
+
// ...
|
|
440
|
+
});
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
</details>
|
|
444
|
+
|
|
335
445
|
### 规则覆盖
|
|
336
446
|
|
|
337
447
|
某些规则仅在特定文件中启用,例如, `ts/*` 规则仅在 `.ts` 文件中启用, `vue/*` 规则仅在 `.vue` 文件中启用。如果要覆盖规则,需要指定文件扩展名:
|
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.
|
|
51
|
+
version: "2.6.0",
|
|
52
52
|
packageManager: "pnpm@9.4.0",
|
|
53
53
|
description: "Kirk Lin's ESLint config",
|
|
54
54
|
author: "Kirk Lin (https://github.com/kirklin/)",
|
|
@@ -77,8 +77,8 @@ var package_default = {
|
|
|
77
77
|
dev: "npx @eslint/config-inspector --config eslint.config.ts",
|
|
78
78
|
"build:inspector": "pnpm build && npx @eslint/config-inspector build",
|
|
79
79
|
watch: "tsup --format esm,cjs --watch",
|
|
80
|
-
lint: "eslint .",
|
|
81
|
-
"lint:fix": "eslint . --fix",
|
|
80
|
+
lint: "eslint --flag unstable_ts_config .",
|
|
81
|
+
"lint:fix": "eslint --flag unstable_ts_config . --fix",
|
|
82
82
|
typegen: "esno scripts/typegen.ts",
|
|
83
83
|
prepack: "nr build",
|
|
84
84
|
release: "bumpp && pnpm publish",
|
|
@@ -144,33 +144,33 @@ var package_default = {
|
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
dependencies: {
|
|
147
|
-
"@antfu/install-pkg": "^0.
|
|
147
|
+
"@antfu/install-pkg": "^0.4.1",
|
|
148
148
|
"@clack/prompts": "^0.7.0",
|
|
149
|
-
"@
|
|
150
|
-
"@
|
|
151
|
-
"@typescript-eslint/
|
|
152
|
-
"eslint
|
|
153
|
-
"eslint-
|
|
149
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
150
|
+
"@stylistic/eslint-plugin": "^2.6.4",
|
|
151
|
+
"@typescript-eslint/eslint-plugin": "^8.3.0",
|
|
152
|
+
"@typescript-eslint/parser": "^8.3.0",
|
|
153
|
+
"@vitest/eslint-plugin": "^1.0.5",
|
|
154
|
+
"eslint-config-flat-gitignore": "^0.1.8",
|
|
155
|
+
"eslint-flat-config-utils": "^0.3.1",
|
|
154
156
|
"eslint-merge-processors": "^0.1.0",
|
|
155
157
|
"eslint-plugin-command": "^0.2.3",
|
|
156
|
-
"eslint-plugin-
|
|
157
|
-
"eslint-plugin-
|
|
158
|
-
"eslint-plugin-jsdoc": "^48.5.0",
|
|
158
|
+
"eslint-plugin-import-x": "^4.0.0",
|
|
159
|
+
"eslint-plugin-jsdoc": "^50.2.2",
|
|
159
160
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
160
161
|
"eslint-plugin-kirklin": "^1.3.0",
|
|
161
|
-
"eslint-plugin-markdown": "^5.
|
|
162
|
-
"eslint-plugin-n": "^17.
|
|
163
|
-
"eslint-plugin-no-only-tests": "^3.
|
|
164
|
-
"eslint-plugin-perfectionist": "^2.
|
|
162
|
+
"eslint-plugin-markdown": "^5.1.0",
|
|
163
|
+
"eslint-plugin-n": "^17.10.2",
|
|
164
|
+
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
165
|
+
"eslint-plugin-perfectionist": "^3.2.0",
|
|
165
166
|
"eslint-plugin-regexp": "^2.6.0",
|
|
166
167
|
"eslint-plugin-toml": "^0.11.1",
|
|
167
|
-
"eslint-plugin-unicorn": "^
|
|
168
|
-
"eslint-plugin-unused-imports": "^4.
|
|
169
|
-
"eslint-plugin-
|
|
170
|
-
"eslint-plugin-vue": "^9.26.0",
|
|
168
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
169
|
+
"eslint-plugin-unused-imports": "^4.1.3",
|
|
170
|
+
"eslint-plugin-vue": "^9.27.0",
|
|
171
171
|
"eslint-plugin-yml": "^1.14.0",
|
|
172
172
|
"eslint-processor-vue-blocks": "^0.1.2",
|
|
173
|
-
globals: "^15.
|
|
173
|
+
globals: "^15.9.0",
|
|
174
174
|
"jsonc-eslint-parser": "^2.4.0",
|
|
175
175
|
"local-pkg": "^0.5.0",
|
|
176
176
|
"parse-gitignore": "^2.0.0",
|
|
@@ -181,54 +181,57 @@ var package_default = {
|
|
|
181
181
|
yargs: "^17.7.2"
|
|
182
182
|
},
|
|
183
183
|
devDependencies: {
|
|
184
|
-
"@antfu/ni": "^0.
|
|
185
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
186
|
-
"@eslint/config-inspector": "^0.5.
|
|
184
|
+
"@antfu/ni": "^0.22.4",
|
|
185
|
+
"@eslint-react/eslint-plugin": "^1.12.1",
|
|
186
|
+
"@eslint/config-inspector": "^0.5.4",
|
|
187
187
|
"@kirklin/eslint-config": "workspace:*",
|
|
188
188
|
"@prettier/plugin-xml": "^3.4.1",
|
|
189
|
-
"@stylistic/eslint-plugin-migrate": "^2.
|
|
190
|
-
"@types/eslint": "^
|
|
189
|
+
"@stylistic/eslint-plugin-migrate": "^2.6.4",
|
|
190
|
+
"@types/eslint": "^9.6.1",
|
|
191
191
|
"@types/fs-extra": "^11.0.4",
|
|
192
|
-
"@types/node": "^
|
|
192
|
+
"@types/node": "^22.5.0",
|
|
193
193
|
"@types/prompts": "^2.4.9",
|
|
194
|
-
"@types/yargs": "^17.0.
|
|
195
|
-
"@unocss/eslint-plugin": "^0.
|
|
194
|
+
"@types/yargs": "^17.0.33",
|
|
195
|
+
"@unocss/eslint-plugin": "^0.62.3",
|
|
196
196
|
"astro-eslint-parser": "^1.0.2",
|
|
197
|
-
bumpp: "^9.
|
|
198
|
-
eslint: "
|
|
199
|
-
"eslint-plugin-astro": "^1.2.
|
|
197
|
+
bumpp: "^9.5.2",
|
|
198
|
+
eslint: "^9.9.1",
|
|
199
|
+
"eslint-plugin-astro": "^1.2.3",
|
|
200
200
|
"eslint-plugin-format": "^0.1.2",
|
|
201
201
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
202
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
203
|
-
"eslint-plugin-solid": "^0.14.
|
|
204
|
-
"eslint-plugin-svelte": "^2.
|
|
205
|
-
"eslint-
|
|
206
|
-
"eslint-typegen": "^0.2.4",
|
|
202
|
+
"eslint-plugin-react-refresh": "^0.4.11",
|
|
203
|
+
"eslint-plugin-solid": "^0.14.2",
|
|
204
|
+
"eslint-plugin-svelte": "^2.43.0",
|
|
205
|
+
"eslint-typegen": "^0.3.1",
|
|
207
206
|
esno: "^4.7.0",
|
|
208
|
-
execa: "^9.3.
|
|
207
|
+
execa: "^9.3.1",
|
|
209
208
|
"fast-glob": "^3.3.2",
|
|
210
209
|
"fs-extra": "^11.2.0",
|
|
211
|
-
|
|
212
|
-
"
|
|
210
|
+
jiti: "^1.21.6",
|
|
211
|
+
"lint-staged": "^15.2.9",
|
|
212
|
+
"prettier-plugin-astro": "^0.14.1",
|
|
213
213
|
"prettier-plugin-slidev": "^1.0.5",
|
|
214
|
-
rimraf: "^
|
|
214
|
+
rimraf: "^6.0.1",
|
|
215
215
|
"simple-git-hooks": "^2.11.1",
|
|
216
|
-
svelte: "^4.2.
|
|
217
|
-
"svelte-eslint-parser": "^0.
|
|
218
|
-
tsup: "^8.
|
|
219
|
-
tsx: "^4.
|
|
220
|
-
typescript: "^5.5.
|
|
221
|
-
vitest: "^
|
|
222
|
-
vue: "^3.4.
|
|
216
|
+
svelte: "^4.2.19",
|
|
217
|
+
"svelte-eslint-parser": "^0.41.0",
|
|
218
|
+
tsup: "^8.2.4",
|
|
219
|
+
tsx: "^4.18.0",
|
|
220
|
+
typescript: "^5.5.4",
|
|
221
|
+
vitest: "^2.0.5",
|
|
222
|
+
vue: "^3.4.38"
|
|
223
223
|
},
|
|
224
224
|
resolutions: {
|
|
225
|
-
|
|
225
|
+
"@eslint-community/eslint-utils": "^4.4.0",
|
|
226
|
+
"@typescript-eslint/utils": "^8.3.0",
|
|
227
|
+
eslint: "^9.9.1",
|
|
228
|
+
tsx: "^4.18.0"
|
|
226
229
|
},
|
|
227
230
|
"simple-git-hooks": {
|
|
228
231
|
"pre-commit": "npx lint-staged"
|
|
229
232
|
},
|
|
230
233
|
"lint-staged": {
|
|
231
|
-
"*": "eslint --fix"
|
|
234
|
+
"*": "eslint --flag unstable_ts_config --fix"
|
|
232
235
|
}
|
|
233
236
|
};
|
|
234
237
|
|
|
@@ -246,16 +249,16 @@ var vscodeSettingsString = `
|
|
|
246
249
|
|
|
247
250
|
// Silent the stylistic rules in you IDE, but still auto fix them
|
|
248
251
|
"eslint.rules.customizations": [
|
|
249
|
-
{ "rule": "style/*", "severity": "off" },
|
|
250
|
-
{ "rule": "format/*", "severity": "off" },
|
|
251
|
-
{ "rule": "*-indent", "severity": "off" },
|
|
252
|
-
{ "rule": "*-spacing", "severity": "off" },
|
|
253
|
-
{ "rule": "*-spaces", "severity": "off" },
|
|
254
|
-
{ "rule": "*-order", "severity": "off" },
|
|
255
|
-
{ "rule": "*-dangle", "severity": "off" },
|
|
256
|
-
{ "rule": "*-newline", "severity": "off" },
|
|
257
|
-
{ "rule": "*quotes", "severity": "off" },
|
|
258
|
-
{ "rule": "*semi", "severity": "off" }
|
|
252
|
+
{ "rule": "style/*", "severity": "off", "fixable": true },
|
|
253
|
+
{ "rule": "format/*", "severity": "off", "fixable": true },
|
|
254
|
+
{ "rule": "*-indent", "severity": "off", "fixable": true },
|
|
255
|
+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
|
|
256
|
+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
|
|
257
|
+
{ "rule": "*-order", "severity": "off", "fixable": true },
|
|
258
|
+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
|
|
259
|
+
{ "rule": "*-newline", "severity": "off", "fixable": true },
|
|
260
|
+
{ "rule": "*quotes", "severity": "off", "fixable": true },
|
|
261
|
+
{ "rule": "*semi", "severity": "off", "fixable": true }
|
|
259
262
|
],
|
|
260
263
|
|
|
261
264
|
// Enable eslint for all supported languages
|
|
@@ -350,7 +353,7 @@ function isGitClean() {
|
|
|
350
353
|
try {
|
|
351
354
|
(0, import_node_child_process.execSync)("git diff-index --quiet HEAD --");
|
|
352
355
|
return true;
|
|
353
|
-
} catch
|
|
356
|
+
} catch {
|
|
354
357
|
return false;
|
|
355
358
|
}
|
|
356
359
|
}
|