@whoj/eslint-config 7.5.1 → 9.2.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 +93 -4
- package/dist/cli.mjs +54 -71
- package/dist/index.d.mts +2632 -840
- package/dist/index.mjs +386 -473
- package/dist/{lib-B1Rme4qD.mjs → lib-BR_yghPw.mjs} +3301 -3040
- package/package.json +137 -126
- package/skills/whoj-eslint-config/SKILL.md +152 -0
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whoj/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
5
|
-
"packageManager": "pnpm@10.30.3",
|
|
4
|
+
"version": "9.2.0-beta.0",
|
|
6
5
|
"description": "ESLint config",
|
|
7
6
|
"license": "MIT",
|
|
8
7
|
"homepage": "https://github.com/who-jonson/eslint-config",
|
|
@@ -21,50 +20,32 @@
|
|
|
21
20
|
"./cli": "./dist/cli.mjs",
|
|
22
21
|
"./package.json": "./package.json"
|
|
23
22
|
},
|
|
24
|
-
"main": "./dist/index.mjs",
|
|
25
|
-
"module": "./dist/index.mjs",
|
|
26
23
|
"types": "./dist/index.d.mts",
|
|
27
|
-
"bin": "./bin/index.mjs",
|
|
28
24
|
"files": [
|
|
29
25
|
"bin",
|
|
30
|
-
"dist"
|
|
26
|
+
"dist",
|
|
27
|
+
"skills"
|
|
31
28
|
],
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "nr typegen && tsdown --clean --dts",
|
|
34
|
-
"stub": "tsdown",
|
|
35
|
-
"dev": "npx @eslint/config-inspector --config eslint.config.ts",
|
|
36
|
-
"build:inspector": "pnpm build && npx @eslint/config-inspector build",
|
|
37
|
-
"watch": "tsdown --watch",
|
|
38
|
-
"lint": "eslint .",
|
|
39
|
-
"lint:fix": "eslint . --fix",
|
|
40
|
-
"typegen": "tsx scripts/typegen.ts && tsx scripts/versiongen.ts",
|
|
41
|
-
"prepack": "nr build",
|
|
42
|
-
"release": "bumpp && pnpm publish",
|
|
43
|
-
"test": "vitest",
|
|
44
|
-
"typecheck": "tsc --noEmit",
|
|
45
|
-
"prepare": "simple-git-hooks"
|
|
46
|
-
},
|
|
47
29
|
"peerDependencies": {
|
|
48
|
-
"@angular-eslint/eslint-plugin": "
|
|
49
|
-
"@angular-eslint/eslint-plugin-template": "
|
|
50
|
-
"@angular-eslint/template-parser": "
|
|
51
|
-
"@eslint-react/eslint-plugin": "
|
|
52
|
-
"@next/eslint-plugin-next": "
|
|
53
|
-
"@prettier/plugin-xml": "
|
|
54
|
-
"@unocss/eslint-plugin": "
|
|
55
|
-
"astro-eslint-parser": "
|
|
56
|
-
"eslint": "
|
|
57
|
-
"eslint-plugin-astro": "
|
|
58
|
-
"eslint-plugin-format": "
|
|
59
|
-
"eslint-plugin-jsx-a11y": "
|
|
60
|
-
"eslint-plugin-react-
|
|
61
|
-
"eslint-plugin-
|
|
62
|
-
"eslint-plugin-
|
|
63
|
-
"eslint-plugin-
|
|
64
|
-
"
|
|
65
|
-
"prettier-plugin-
|
|
66
|
-
"
|
|
67
|
-
"svelte-eslint-parser": "catalog:peer"
|
|
30
|
+
"@angular-eslint/eslint-plugin": "^22.1.0",
|
|
31
|
+
"@angular-eslint/eslint-plugin-template": "^22.1.0",
|
|
32
|
+
"@angular-eslint/template-parser": "^22.1.0",
|
|
33
|
+
"@eslint-react/eslint-plugin": "^5.14.7",
|
|
34
|
+
"@next/eslint-plugin-next": "^16.2.10",
|
|
35
|
+
"@prettier/plugin-xml": "^3.4.2",
|
|
36
|
+
"@unocss/eslint-plugin": "^66.7.5",
|
|
37
|
+
"astro-eslint-parser": "^2.1 || ^3.0",
|
|
38
|
+
"eslint": "^9.0.0 || ^10.7.0",
|
|
39
|
+
"eslint-plugin-astro": "^2.1 || ^3.0",
|
|
40
|
+
"eslint-plugin-format": "^2.0.1",
|
|
41
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
42
|
+
"eslint-plugin-react-refresh": "^0.5.3",
|
|
43
|
+
"eslint-plugin-solid": "^0.14.5",
|
|
44
|
+
"eslint-plugin-svelte": "^3.20.0",
|
|
45
|
+
"eslint-plugin-vuejs-accessibility": "^2.5.0",
|
|
46
|
+
"prettier-plugin-astro": "^0.14.1",
|
|
47
|
+
"prettier-plugin-slidev": "^1.0.5",
|
|
48
|
+
"svelte-eslint-parser": "^1.8.0"
|
|
68
49
|
},
|
|
69
50
|
"peerDependenciesMeta": {
|
|
70
51
|
"@angular-eslint/eslint-plugin": {
|
|
@@ -100,9 +81,6 @@
|
|
|
100
81
|
"eslint-plugin-jsx-a11y": {
|
|
101
82
|
"optional": true
|
|
102
83
|
},
|
|
103
|
-
"eslint-plugin-react-hooks": {
|
|
104
|
-
"optional": true
|
|
105
|
-
},
|
|
106
84
|
"eslint-plugin-react-refresh": {
|
|
107
85
|
"optional": true
|
|
108
86
|
},
|
|
@@ -126,89 +104,91 @@
|
|
|
126
104
|
}
|
|
127
105
|
},
|
|
128
106
|
"dependencies": {
|
|
129
|
-
"@antfu/install-pkg": "
|
|
130
|
-
"@clack/prompts": "
|
|
131
|
-
"@
|
|
132
|
-
"@eslint/
|
|
133
|
-
"@
|
|
134
|
-
"@
|
|
135
|
-
"@typescript-eslint/
|
|
136
|
-
"@
|
|
137
|
-
"@
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"eslint-flat-
|
|
142
|
-
"eslint-
|
|
143
|
-
"eslint-
|
|
144
|
-
"eslint-plugin-
|
|
145
|
-
"eslint-plugin-
|
|
146
|
-
"eslint-plugin-
|
|
147
|
-
"eslint-plugin-
|
|
148
|
-
"eslint-plugin-
|
|
149
|
-
"eslint-plugin-
|
|
150
|
-
"eslint-plugin-
|
|
151
|
-
"eslint-plugin-
|
|
152
|
-
"eslint-plugin-
|
|
153
|
-
"eslint-plugin-
|
|
154
|
-
"eslint-plugin-
|
|
155
|
-
"eslint-plugin-
|
|
156
|
-
"eslint-plugin-
|
|
157
|
-
"eslint-plugin-
|
|
158
|
-
"eslint-
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
"local-pkg": "
|
|
163
|
-
"parse-gitignore": "
|
|
164
|
-
"toml-eslint-parser": "
|
|
165
|
-
"vue-eslint-parser": "
|
|
166
|
-
"yaml-eslint-parser": "
|
|
107
|
+
"@antfu/install-pkg": "^1.1.0",
|
|
108
|
+
"@clack/prompts": "^1.7.0",
|
|
109
|
+
"@e18e/eslint-plugin": "^0.5.1",
|
|
110
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
|
|
111
|
+
"@eslint/markdown": "^8.0.3",
|
|
112
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
113
|
+
"@typescript-eslint/eslint-plugin": "^8.63.0",
|
|
114
|
+
"@typescript-eslint/parser": "^8.63.0",
|
|
115
|
+
"@vitest/eslint-plugin": "^1.6.23",
|
|
116
|
+
"@whoj/utils-core": "^2.4.0",
|
|
117
|
+
"ansis": "^4.3.1",
|
|
118
|
+
"cac": "^7.0.0",
|
|
119
|
+
"eslint-config-flat-gitignore": "^2.3.0",
|
|
120
|
+
"eslint-flat-config-utils": "^3.2.0",
|
|
121
|
+
"eslint-merge-processors": "^2.0.0",
|
|
122
|
+
"eslint-plugin-antfu": "^3.2.3",
|
|
123
|
+
"eslint-plugin-command": "^3.5.2",
|
|
124
|
+
"eslint-plugin-import-lite": "^0.6.0",
|
|
125
|
+
"eslint-plugin-jsdoc": "^63.0.13",
|
|
126
|
+
"eslint-plugin-jsonc": "^3.3.0",
|
|
127
|
+
"eslint-plugin-n": "^18.2.2",
|
|
128
|
+
"eslint-plugin-no-only-tests": "^3.4.0",
|
|
129
|
+
"eslint-plugin-perfectionist": "^5.10.0",
|
|
130
|
+
"eslint-plugin-pnpm": "^1.6.1",
|
|
131
|
+
"eslint-plugin-regexp": "^3.1.1",
|
|
132
|
+
"eslint-plugin-toml": "^1.4.0",
|
|
133
|
+
"eslint-plugin-unicorn": "^71.1.0",
|
|
134
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
135
|
+
"eslint-plugin-vue": "^10.9.2",
|
|
136
|
+
"eslint-plugin-yml": "^3.6.0",
|
|
137
|
+
"eslint-processor-vue-blocks": "^2.0.0",
|
|
138
|
+
"fast-xml-parser": "^5.10.0",
|
|
139
|
+
"globals": "^17.7.0",
|
|
140
|
+
"local-pkg": "^1.2.1",
|
|
141
|
+
"parse-gitignore": "^2.0.0",
|
|
142
|
+
"toml-eslint-parser": "^1.0.3",
|
|
143
|
+
"vue-eslint-parser": "^10.4.1",
|
|
144
|
+
"yaml-eslint-parser": "^2.1.0"
|
|
167
145
|
},
|
|
168
146
|
"devDependencies": {
|
|
169
|
-
"@angular-eslint/eslint-plugin": "
|
|
170
|
-
"@angular-eslint/eslint-plugin-template": "
|
|
171
|
-
"@angular-eslint/template-parser": "
|
|
172
|
-
"@angular/core": "
|
|
173
|
-
"@antfu/ni": "
|
|
174
|
-
"@eslint-react/eslint-plugin": "
|
|
175
|
-
"@eslint/config-inspector": "
|
|
176
|
-
"@next/eslint-plugin-next": "
|
|
177
|
-
"@prettier/plugin-xml": "
|
|
178
|
-
"@types/eslint-plugin-jsx-a11y": "
|
|
179
|
-
"@types/node": "
|
|
180
|
-
"@unocss/eslint-plugin": "
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"eslint": "
|
|
186
|
-
"eslint-plugin-
|
|
187
|
-
"eslint-plugin-
|
|
188
|
-
"eslint-plugin-
|
|
189
|
-
"eslint-plugin-
|
|
190
|
-
"eslint-plugin-
|
|
191
|
-
"eslint-plugin-
|
|
192
|
-
"eslint-plugin-
|
|
193
|
-
"eslint-
|
|
194
|
-
"
|
|
195
|
-
"
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"
|
|
202
|
-
"
|
|
203
|
-
"
|
|
204
|
-
"svelte": "
|
|
205
|
-
"
|
|
206
|
-
"
|
|
207
|
-
"tsdown": "
|
|
208
|
-
"
|
|
209
|
-
"
|
|
210
|
-
"
|
|
211
|
-
"
|
|
147
|
+
"@angular-eslint/eslint-plugin": "^22.1.0",
|
|
148
|
+
"@angular-eslint/eslint-plugin-template": "^22.1.0",
|
|
149
|
+
"@angular-eslint/template-parser": "^22.1.0",
|
|
150
|
+
"@angular/core": "^22.0.6",
|
|
151
|
+
"@antfu/ni": "^30.2.0",
|
|
152
|
+
"@eslint-react/eslint-plugin": "^5.14.7",
|
|
153
|
+
"@eslint/config-inspector": "^3.0.4",
|
|
154
|
+
"@next/eslint-plugin-next": "^16.2.10",
|
|
155
|
+
"@prettier/plugin-xml": "^3.4.2",
|
|
156
|
+
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
157
|
+
"@types/node": "^26.1.1",
|
|
158
|
+
"@unocss/eslint-plugin": "^66.7.5",
|
|
159
|
+
"astro-eslint-parser": "^2.1 || ^3.0",
|
|
160
|
+
"baseline-browser-mapping": "^2.10.43",
|
|
161
|
+
"bumpp": "^11.1.0",
|
|
162
|
+
"eslint": "^9.0.0 || ^10.7.0",
|
|
163
|
+
"eslint-plugin-astro": "^2.1 || ^3.0",
|
|
164
|
+
"eslint-plugin-erasable-syntax-only": "^0.4.2",
|
|
165
|
+
"eslint-plugin-format": "^2.0.1",
|
|
166
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
167
|
+
"eslint-plugin-react-refresh": "^0.5.3",
|
|
168
|
+
"eslint-plugin-solid": "^0.14.5",
|
|
169
|
+
"eslint-plugin-svelte": "^3.20.0",
|
|
170
|
+
"eslint-plugin-vuejs-accessibility": "^2.5.0",
|
|
171
|
+
"eslint-typegen": "^2.3.1",
|
|
172
|
+
"execa": "^9.6.1",
|
|
173
|
+
"find-up-simple": "^1.0.1",
|
|
174
|
+
"jiti": "^2.7.0",
|
|
175
|
+
"lint-staged": "^17.0.8",
|
|
176
|
+
"pnpm-workspace-yaml": "^1.6.1",
|
|
177
|
+
"prettier-plugin-astro": "^0.14.1",
|
|
178
|
+
"prettier-plugin-slidev": "^1.0.5",
|
|
179
|
+
"simple-git-hooks": "^2.13.1",
|
|
180
|
+
"skills-npm": "^1.2.0",
|
|
181
|
+
"svelte": "^5.56.4",
|
|
182
|
+
"svelte-eslint-parser": "^1.8.0",
|
|
183
|
+
"tinyglobby": "^0.2.17",
|
|
184
|
+
"tsdown": "^0.22.7",
|
|
185
|
+
"tsdown-stale-guard": "^0.1.3",
|
|
186
|
+
"tsnapi": "^1.0.0",
|
|
187
|
+
"tsx": "^4.23.1",
|
|
188
|
+
"typescript": "^6.0.3",
|
|
189
|
+
"vitest": "^4.1.10",
|
|
190
|
+
"vue": "^3.5.39",
|
|
191
|
+
"@whoj/eslint-config": "9.2.0-beta.0"
|
|
212
192
|
},
|
|
213
193
|
"resolutions": {
|
|
214
194
|
"@eslint-community/eslint-utils": "catalog:peer",
|
|
@@ -216,6 +196,7 @@
|
|
|
216
196
|
"@typescript-eslint/utils": "catalog:peer",
|
|
217
197
|
"chokidar": "catalog:dev",
|
|
218
198
|
"eslint": "catalog:peer",
|
|
199
|
+
"js-yaml": "catalog:prod",
|
|
219
200
|
"semver": "catalog:dev",
|
|
220
201
|
"synckit": "catalog:dev",
|
|
221
202
|
"tsx": "catalog:dev"
|
|
@@ -225,5 +206,35 @@
|
|
|
225
206
|
},
|
|
226
207
|
"lint-staged": {
|
|
227
208
|
"*": "eslint --fix"
|
|
209
|
+
},
|
|
210
|
+
"inlinedDependencies": {
|
|
211
|
+
"@eslint-community/eslint-utils": "4.9.1",
|
|
212
|
+
"@typescript-eslint/scope-manager": "8.62.0",
|
|
213
|
+
"@typescript-eslint/types": "8.62.0",
|
|
214
|
+
"@typescript-eslint/utils": "8.62.0",
|
|
215
|
+
"@typescript-eslint/visitor-keys": "8.62.0",
|
|
216
|
+
"cached-factory": "0.3.0",
|
|
217
|
+
"eslint-plugin-erasable-syntax-only": "0.4.2",
|
|
218
|
+
"eslint-visitor-keys": [
|
|
219
|
+
"3.4.3",
|
|
220
|
+
"5.0.1"
|
|
221
|
+
],
|
|
222
|
+
"find-up-simple": "1.0.1"
|
|
223
|
+
},
|
|
224
|
+
"scripts": {
|
|
225
|
+
"build": "nr typegen && tsdown --clean --dts",
|
|
226
|
+
"stub": "tsdown",
|
|
227
|
+
"dev": "npx @eslint/config-inspector --config eslint.config.ts",
|
|
228
|
+
"build:inspector": "pnpm build && npx @eslint/config-inspector build --config eslint.config.ts --out-dir ./.eslint-config-inspector",
|
|
229
|
+
"watch": "tsdown --watch",
|
|
230
|
+
"lint": "eslint .",
|
|
231
|
+
"lint:fix": "eslint . --fix",
|
|
232
|
+
"typegen": "tsx scripts/typegen.ts && tsx scripts/versiongen.ts",
|
|
233
|
+
"release": "bumpp && pnpm publish",
|
|
234
|
+
"test": "vitest",
|
|
235
|
+
"typecheck": "tsc --noEmit"
|
|
236
|
+
},
|
|
237
|
+
"bin": {
|
|
238
|
+
"eslint-config": "./bin/index.mjs"
|
|
228
239
|
}
|
|
229
|
-
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: whoj-eslint-config
|
|
3
|
+
description: Configure ESLint flat config, customize rules, or fix lint errors in a repo that depends on @whoj/eslint-config; also covers scaffolding eslint.config with its CLI wizard.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @whoj/eslint-config
|
|
7
|
+
|
|
8
|
+
This skill applies when working in a repository that has `@whoj/eslint-config` listed as a
|
|
9
|
+
dependency (usually a `devDependency`) in `package.json`. It covers three things: configuring the
|
|
10
|
+
`whoj()` factory, fixing lint errors this config produces, and running the setup/migration CLI.
|
|
11
|
+
|
|
12
|
+
## 1. Configuring the `whoj()` factory
|
|
13
|
+
|
|
14
|
+
The package default-exports a factory function. The minimal setup is:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
// eslint.config.mjs
|
|
18
|
+
import whoj from '@whoj/eslint-config';
|
|
19
|
+
|
|
20
|
+
export default whoj();
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Key shape rules — verified against the package's own `src/factory.ts` and `src/types.ts`:
|
|
24
|
+
|
|
25
|
+
- **Boolean-or-options-object pattern**: most integration keys on the first argument (e.g. `vue`,
|
|
26
|
+
`react`, `typescript`, `stylistic`, `formatters`, and others) accept either
|
|
27
|
+
`true`/`false` or a config object for that integration. Passing `true` uses that integration's
|
|
28
|
+
defaults; passing an object lets you set sub-options (including that integration's own
|
|
29
|
+
`overrides`).
|
|
30
|
+
- Several integrations auto-detect and enable themselves based on installed dependencies or repo
|
|
31
|
+
files (e.g. `typescript` turns on if `typescript` is installed, `vue` if `vue`/`nuxt`/`vitepress`/
|
|
32
|
+
`@slidev/cli` is installed, `pnpm` if a `pnpm-workspace.yaml` is found). You only need to pass the
|
|
33
|
+
key explicitly to override the default/auto-detected value.
|
|
34
|
+
- **`overrides` pattern**: nearly every sub-config accepts an `overrides` field
|
|
35
|
+
(`OptionsOverrides`) — a plain ESLint `rules` object merged in last, so it always wins over the
|
|
36
|
+
config's own defaults. Prefer setting `overrides` on the specific integration rather than a
|
|
37
|
+
top-level blanket rule change. There is also a **deprecated** top-level `overrides` map on
|
|
38
|
+
`OptionsConfig`, covering the same integration keys, for the same purpose — prefer the
|
|
39
|
+
per-integration `overrides` field on new code.
|
|
40
|
+
- The factory returns a `FlatConfigComposer`, which supports chaining, e.g.
|
|
41
|
+
`whoj({ ... }).overrides({ 'whoj/some-name': { rules: { ... } } })` to target a specific named
|
|
42
|
+
config block by its `name` field, or `.append(...)` for extra flat config objects. `whoj()` also
|
|
43
|
+
accepts any number of extra plain flat-config-object arguments after the first, which are
|
|
44
|
+
appended as-is (no merging into `overrides`).
|
|
45
|
+
- The first argument must NOT contain a `files` property (the factory throws if it does) — pass
|
|
46
|
+
file-scoped rules as additional flat config arguments instead.
|
|
47
|
+
|
|
48
|
+
**Do not hardcode an exhaustive list of every option field here — it will go stale across
|
|
49
|
+
versions.** Before configuring anything non-trivial, read the actual shipped types and/or docs for
|
|
50
|
+
the installed version:
|
|
51
|
+
|
|
52
|
+
- `node_modules/@whoj/eslint-config/dist/index.d.mts` — authoritative, version-accurate type
|
|
53
|
+
definitions for `OptionsConfig` and every sub-options interface.
|
|
54
|
+
- The package's `README.md` (`Customization` section) if available, for narrative examples.
|
|
55
|
+
|
|
56
|
+
## 2. Fixing lint errors produced by this config
|
|
57
|
+
|
|
58
|
+
This config renames plugin prefixes in reported rule IDs via `composer.renamePlugins(...)` (see
|
|
59
|
+
`defaultPluginRenaming` in the package's `src/factory.ts`), so error output will show the renamed
|
|
60
|
+
prefix, not the upstream plugin's own prefix. The verified rename table is:
|
|
61
|
+
|
|
62
|
+
| Reported prefix | Underlying plugin |
|
|
63
|
+
| --------------- | ------------------------------- |
|
|
64
|
+
| `node/*` | `n` (eslint-plugin-n) |
|
|
65
|
+
| `yaml/*` | `yml` (eslint-plugin-yml) |
|
|
66
|
+
| `test/*` | `vitest` (eslint-plugin-vitest) |
|
|
67
|
+
| `next/*` | `@next/next` |
|
|
68
|
+
| `style/*` | `@stylistic` |
|
|
69
|
+
| `import/*` | `import-lite` |
|
|
70
|
+
| `react/*` | `@eslint-react` |
|
|
71
|
+
| `ts/*` | `@typescript-eslint` |
|
|
72
|
+
|
|
73
|
+
This table reflects `defaultPluginRenaming` in the installed version — if a prefix doesn't match,
|
|
74
|
+
check `node_modules/@whoj/eslint-config/dist/index.mjs` (or `dist/index.d.mts`) for the current
|
|
75
|
+
exported `defaultPluginRenaming`.
|
|
76
|
+
|
|
77
|
+
When you see a rule ID like `ts/no-unused-vars`, `style/quotes`, or `node/no-process-exit` in lint
|
|
78
|
+
output, that maps to the upstream plugin on the right — use that to find the rule's documentation
|
|
79
|
+
(the renamed prefix will not resolve on the plugin's own docs site).
|
|
80
|
+
|
|
81
|
+
Rules with no rename listed above (e.g. plain `unicorn/*`, `vue/*`, `jsdoc/*`, `perfectionist/*`,
|
|
82
|
+
`regexp/*`) are reported under their original plugin prefix.
|
|
83
|
+
|
|
84
|
+
**To suppress or adjust a specific rule that doesn't fit the codebase**: prefer adding it to the
|
|
85
|
+
`overrides` object of the relevant sub-config in `eslint.config.mjs`, not a blanket
|
|
86
|
+
`// eslint-disable` comment or file-wide disable. Example — silencing a TypeScript rule and a
|
|
87
|
+
stylistic rule:
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
// eslint.config.mjs
|
|
91
|
+
import whoj from '@whoj/eslint-config';
|
|
92
|
+
|
|
93
|
+
export default whoj({
|
|
94
|
+
stylistic: {
|
|
95
|
+
overrides: {
|
|
96
|
+
'style/quotes': ['error', 'double'],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
typescript: {
|
|
100
|
+
overrides: {
|
|
101
|
+
'ts/no-unused-vars': 'off',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Only fall back to inline `// eslint-disable-next-line <rule>` for a genuinely one-off exception in
|
|
108
|
+
a single location; use the `overrides` mechanism when the rule should not apply project-wide or
|
|
109
|
+
for a whole integration's file set.
|
|
110
|
+
|
|
111
|
+
## 3. CLI setup / migration wizard
|
|
112
|
+
|
|
113
|
+
The package ships a CLI (`bin/index.mjs`, wired to `src/cli/index.ts` → `src/cli/run.ts`) invoked
|
|
114
|
+
via:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pnpm dlx @whoj/eslint-config@latest
|
|
118
|
+
# or
|
|
119
|
+
npx @whoj/eslint-config@latest
|
|
120
|
+
# or
|
|
121
|
+
bunx @whoj/eslint-config@latest
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Verified behavior of the wizard (reading `src/cli/run.ts`, `src/cli/constants.ts`, and
|
|
125
|
+
`src/cli/stages/*.ts`) — this reflects the installed version; run the CLI with `--help` to confirm
|
|
126
|
+
current flags/behavior if something doesn't match:
|
|
127
|
+
|
|
128
|
+
- It refuses to run if `eslint.config.js` already exists in the current directory (exits with an
|
|
129
|
+
error) — it is an initial-setup/migration tool, not an incremental re-configurator.
|
|
130
|
+
- If the repo has uncommitted git changes, it prompts for confirmation before continuing (skip
|
|
131
|
+
this and all prompts with `--yes`/`-y`, or `SKIP_PROMPT=1` env var).
|
|
132
|
+
- It prompts (multiselect) for optional framework templates to enable: `vue`, `react`, `solid`,
|
|
133
|
+
`svelte`, `slidev`, `astro` — pass one or more non-interactively with `--template <name>`
|
|
134
|
+
(repeatable), e.g. `--template vue --template react`.
|
|
135
|
+
- It prompts (multiselect) for optional extras: `unocss` and `formatter` (external
|
|
136
|
+
Prettier/dprint formatting support) — pass non-interactively with `--extra <name>` (repeatable).
|
|
137
|
+
- It generates `eslint.config.js` (if the consumer's `package.json` has `"type": "module"`) or
|
|
138
|
+
`eslint.config.mjs` (otherwise), setting the corresponding `true` flags (e.g. `vue: true`,
|
|
139
|
+
`formatters: true`, `unocss: true`) in the generated `whoj({...})` call based on your selections.
|
|
140
|
+
- If a legacy `.eslintignore` file exists, it parses it and merges its patterns into the generated
|
|
141
|
+
config's top-level `ignores` array (negated `!pattern` entries are preserved for un-ignoring).
|
|
142
|
+
- It offers (confirm prompts, default yes) to also update `.idea/jsLinters/` config for
|
|
143
|
+
JetBrains IDEs (WebStorm/PhpStorm) and `.vscode/settings.json` for VS Code, wiring ESLint as the
|
|
144
|
+
formatter and silencing stylistic rules in-editor while keeping them auto-fixable on save.
|
|
145
|
+
- It does not delete legacy ESLint/Prettier config files automatically — it lists any it finds
|
|
146
|
+
(files matching `/eslint|prettier/` but not the new `eslint.config.*`) and tells you that you can
|
|
147
|
+
remove them manually.
|
|
148
|
+
- After running, it does not install dependencies or run ESLint itself — it prints a reminder to
|
|
149
|
+
run `pnpm install` and `eslint --fix` next.
|
|
150
|
+
|
|
151
|
+
Use `--yes` for non-interactive/CI scaffolding when the defaults (no frameworks, no extras,
|
|
152
|
+
JetBrains config on) are acceptable; otherwise omit flags and let the wizard prompt.
|