@whoj/eslint-config 2.2.1 → 2.2.2
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 +21 -21
- package/dist/cli.js +45 -56
- package/dist/index.d.ts +290 -283
- package/dist/index.js +709 -757
- package/package.json +6 -3
- package/dist/chunk-3P3JBQLJ.js +0 -5191
- package/dist/chunk-5NT2OOQW.js +0 -29719
- package/dist/chunk-7F5ASJF4.js +0 -1962
- package/dist/chunk-DLJMV7EV.js +0 -626
- package/dist/chunk-G5WGJHBR.js +0 -149
- package/dist/chunk-IDB36RF3.js +0 -353
- package/dist/chunk-IKAXXATW.js +0 -6400
- package/dist/chunk-MKKAXXPL.js +0 -5769
- package/dist/chunk-MKNYKNDN.js +0 -65
- package/dist/chunk-PVCENCBM.js +0 -1053
- package/dist/chunk-QT5XME2Q.js +0 -209134
- package/dist/chunk-THBKBMVU.js +0 -8352
- package/dist/chunk-VSLGWZT6.js +0 -115
- package/dist/chunk-XZGWRL6X.js +0 -1520
- package/dist/dist-MYXPM6TG.js +0 -4953
- package/dist/dist-ZJ2E2ITJ.js +0 -26233
- package/dist/eslint-plugin-react-hooks-BV2CYKDG.js +0 -2559
- package/dist/eslint-plugin-react-refresh-N5P3A37Z.js +0 -272
- package/dist/lib-C6BFP32Q.js +0 -24437
- package/dist/lib-FENTQ4WJ.js +0 -10106
- package/dist/lib-WKUBBNE4.js +0 -26
- package/dist/lib-XQB7MXK6.js +0 -9
- package/dist/sass.node-L3JPZGSW.js +0 -125580
- package/dist/typescript-LG2A6BNW.js +0 -5
package/README.md
CHANGED
|
@@ -45,16 +45,16 @@ const compat = new FlatCompat();
|
|
|
45
45
|
|
|
46
46
|
export default whoj(
|
|
47
47
|
{
|
|
48
|
-
ignores: []
|
|
48
|
+
ignores: [],
|
|
49
49
|
},
|
|
50
50
|
|
|
51
51
|
// Legacy config
|
|
52
52
|
...compat.config({
|
|
53
53
|
extends: [
|
|
54
|
-
'eslint:recommended'
|
|
54
|
+
'eslint:recommended',
|
|
55
55
|
// Other extends...
|
|
56
|
-
]
|
|
57
|
-
})
|
|
56
|
+
],
|
|
57
|
+
}),
|
|
58
58
|
|
|
59
59
|
// Other flat configs...
|
|
60
60
|
);
|
|
@@ -152,31 +152,31 @@ You can configure each integration individually, for example:
|
|
|
152
152
|
import whoj from '@whoj/eslint-config';
|
|
153
153
|
|
|
154
154
|
export default whoj({
|
|
155
|
-
|
|
156
|
-
type: 'lib',
|
|
155
|
+
vue: true,
|
|
157
156
|
|
|
158
157
|
// Enable stylistic formatting rules
|
|
159
158
|
// stylistic: true,
|
|
160
159
|
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
indent: 2, // 4, or 'tab'
|
|
164
|
-
quotes: 'single' // or 'double'
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
// TypeScript and Vue are autodetected, you can also explicitly enable them:
|
|
168
|
-
typescript: true,
|
|
169
|
-
vue: true,
|
|
160
|
+
// Type of the project. 'lib' for libraries, the default is 'app'
|
|
161
|
+
type: 'lib',
|
|
170
162
|
|
|
163
|
+
yaml: false,
|
|
171
164
|
// Disable jsonc and yaml support
|
|
172
165
|
jsonc: false,
|
|
173
|
-
yaml: false,
|
|
174
166
|
|
|
167
|
+
// TypeScript and Vue are autodetected, you can also explicitly enable them:
|
|
168
|
+
typescript: true,
|
|
175
169
|
// `.eslintignore` is no longer supported in Flat config, use `ignores` instead
|
|
176
170
|
ignores: [
|
|
177
|
-
'**/fixtures'
|
|
171
|
+
'**/fixtures',
|
|
178
172
|
// ...globs
|
|
179
|
-
]
|
|
173
|
+
],
|
|
174
|
+
|
|
175
|
+
// Or customize the stylistic rules
|
|
176
|
+
stylistic: {
|
|
177
|
+
indent: 2, // 4, or 'tab'
|
|
178
|
+
quotes: 'single', // or 'double'
|
|
179
|
+
},
|
|
180
180
|
});
|
|
181
181
|
```
|
|
182
182
|
|
|
@@ -194,12 +194,12 @@ export default whoj(
|
|
|
194
194
|
// From the second arguments they are ESLint Flat Configs
|
|
195
195
|
// you can have multiple configs
|
|
196
196
|
{
|
|
197
|
+
rules: {},
|
|
197
198
|
files: ['**/*.ts'],
|
|
198
|
-
rules: {}
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
|
-
rules: {}
|
|
202
|
-
}
|
|
201
|
+
rules: {},
|
|
202
|
+
},
|
|
203
203
|
);
|
|
204
204
|
```
|
|
205
205
|
|
package/dist/cli.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_esm_shims
|
|
3
|
-
} from "./chunk-MKNYKNDN.js";
|
|
4
|
-
|
|
5
|
-
// src/cli.ts
|
|
6
|
-
init_esm_shims();
|
|
7
|
-
|
|
8
1
|
// src/cli/index.ts
|
|
9
|
-
init_esm_shims();
|
|
10
2
|
import yargs from "yargs";
|
|
11
3
|
import c6 from "picocolors";
|
|
12
4
|
import process5 from "node:process";
|
|
@@ -14,7 +6,6 @@ import * as p5 from "@clack/prompts";
|
|
|
14
6
|
import { hideBin } from "yargs/helpers";
|
|
15
7
|
|
|
16
8
|
// src/cli/run.ts
|
|
17
|
-
init_esm_shims();
|
|
18
9
|
import fs3 from "node:fs";
|
|
19
10
|
import c5 from "picocolors";
|
|
20
11
|
import path4 from "node:path";
|
|
@@ -22,7 +13,6 @@ import process4 from "node:process";
|
|
|
22
13
|
import * as p4 from "@clack/prompts";
|
|
23
14
|
|
|
24
15
|
// src/cli/utils.ts
|
|
25
|
-
init_esm_shims();
|
|
26
16
|
import { execSync } from "node:child_process";
|
|
27
17
|
function isGitClean() {
|
|
28
18
|
try {
|
|
@@ -45,7 +35,6 @@ ${config}
|
|
|
45
35
|
}
|
|
46
36
|
|
|
47
37
|
// src/cli/stages/update-eslint-files.ts
|
|
48
|
-
init_esm_shims();
|
|
49
38
|
import fs from "node:fs";
|
|
50
39
|
import c from "picocolors";
|
|
51
40
|
import path from "node:path";
|
|
@@ -99,7 +88,6 @@ async function updateEslintFiles(result) {
|
|
|
99
88
|
}
|
|
100
89
|
|
|
101
90
|
// src/cli/stages/update-package-json.ts
|
|
102
|
-
init_esm_shims();
|
|
103
91
|
import c3 from "picocolors";
|
|
104
92
|
import path2 from "node:path";
|
|
105
93
|
import fsp2 from "node:fs/promises";
|
|
@@ -107,14 +95,13 @@ import process2 from "node:process";
|
|
|
107
95
|
import * as p2 from "@clack/prompts";
|
|
108
96
|
|
|
109
97
|
// src/cli/constants.ts
|
|
110
|
-
init_esm_shims();
|
|
111
98
|
import c2 from "picocolors";
|
|
112
99
|
|
|
113
100
|
// package.json
|
|
114
101
|
var package_default = {
|
|
115
102
|
name: "@whoj/eslint-config",
|
|
116
103
|
type: "module",
|
|
117
|
-
version: "2.2.
|
|
104
|
+
version: "2.2.2",
|
|
118
105
|
packageManager: "pnpm@10.2.1",
|
|
119
106
|
description: "ESLint config",
|
|
120
107
|
license: "MIT",
|
|
@@ -148,12 +135,16 @@ var package_default = {
|
|
|
148
135
|
prepare: "simple-git-hooks"
|
|
149
136
|
},
|
|
150
137
|
peerDependencies: {
|
|
138
|
+
"@nuxt/eslint-config": "^1.0.1",
|
|
151
139
|
"@prettier/plugin-xml": "^3.4.1",
|
|
152
140
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
153
141
|
eslint: "^9.19.0",
|
|
154
142
|
"eslint-plugin-format": ">=0.1.0"
|
|
155
143
|
},
|
|
156
144
|
peerDependenciesMeta: {
|
|
145
|
+
"@nuxt/eslint-config": {
|
|
146
|
+
optional: true
|
|
147
|
+
},
|
|
157
148
|
"@prettier/plugin-xml": {
|
|
158
149
|
optional: true
|
|
159
150
|
},
|
|
@@ -235,7 +226,6 @@ var package_default = {
|
|
|
235
226
|
"prettier-plugin-astro": "^0.14.1",
|
|
236
227
|
"prettier-plugin-slidev": "^1.0.5",
|
|
237
228
|
rimraf: "^6.0.1",
|
|
238
|
-
sass: "^1.84.0",
|
|
239
229
|
"simple-git-hooks": "^2.11.1",
|
|
240
230
|
svelte: "^5.19.9",
|
|
241
231
|
"svelte-eslint-parser": "^0.43.0",
|
|
@@ -319,64 +309,64 @@ var vscodeSettingsString = `
|
|
|
319
309
|
`;
|
|
320
310
|
var frameworkOptions = [
|
|
321
311
|
{
|
|
322
|
-
|
|
323
|
-
|
|
312
|
+
value: "vue",
|
|
313
|
+
label: c2.green("Vue")
|
|
324
314
|
},
|
|
325
315
|
{
|
|
326
|
-
|
|
327
|
-
|
|
316
|
+
value: "react",
|
|
317
|
+
label: c2.cyan("React")
|
|
328
318
|
},
|
|
329
319
|
{
|
|
330
|
-
|
|
331
|
-
|
|
320
|
+
value: "svelte",
|
|
321
|
+
label: c2.red("Svelte")
|
|
332
322
|
},
|
|
333
323
|
{
|
|
334
|
-
|
|
335
|
-
|
|
324
|
+
value: "astro",
|
|
325
|
+
label: c2.magenta("Astro")
|
|
336
326
|
},
|
|
337
327
|
{
|
|
338
|
-
|
|
339
|
-
|
|
328
|
+
value: "solid",
|
|
329
|
+
label: c2.cyan("Solid")
|
|
340
330
|
},
|
|
341
331
|
{
|
|
342
|
-
|
|
343
|
-
|
|
332
|
+
value: "slidev",
|
|
333
|
+
label: c2.blue("Slidev")
|
|
344
334
|
}
|
|
345
335
|
];
|
|
346
336
|
var frameworks = frameworkOptions.map(({ value }) => value);
|
|
347
337
|
var extraOptions = [
|
|
348
338
|
{
|
|
349
|
-
|
|
339
|
+
value: "formatter",
|
|
350
340
|
label: c2.red("Formatter"),
|
|
351
|
-
|
|
341
|
+
hint: "Use external formatters (Prettier and/or dprint) to format files that ESLint cannot handle yet (.css, .html, etc)"
|
|
352
342
|
},
|
|
353
343
|
{
|
|
354
|
-
|
|
355
|
-
|
|
344
|
+
value: "unocss",
|
|
345
|
+
label: c2.cyan("UnoCSS")
|
|
356
346
|
}
|
|
357
347
|
];
|
|
358
348
|
var extra = extraOptions.map(({ value }) => value);
|
|
359
349
|
var dependenciesMap = {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
"
|
|
363
|
-
],
|
|
364
|
-
react: [
|
|
365
|
-
"@eslint-react/eslint-plugin",
|
|
366
|
-
"eslint-plugin-react-hooks",
|
|
367
|
-
"eslint-plugin-react-refresh"
|
|
350
|
+
vue: [],
|
|
351
|
+
solid: [
|
|
352
|
+
"eslint-plugin-solid"
|
|
368
353
|
],
|
|
369
354
|
slidev: [
|
|
370
355
|
"prettier-plugin-slidev"
|
|
371
356
|
],
|
|
372
|
-
|
|
373
|
-
"eslint-plugin-
|
|
357
|
+
astro: [
|
|
358
|
+
"eslint-plugin-astro",
|
|
359
|
+
"astro-eslint-parser"
|
|
374
360
|
],
|
|
375
361
|
svelte: [
|
|
376
362
|
"eslint-plugin-svelte",
|
|
377
363
|
"svelte-eslint-parser"
|
|
378
364
|
],
|
|
379
|
-
|
|
365
|
+
react: [
|
|
366
|
+
"@eslint-react/eslint-plugin",
|
|
367
|
+
"eslint-plugin-react-hooks",
|
|
368
|
+
"eslint-plugin-react-refresh"
|
|
369
|
+
]
|
|
380
370
|
};
|
|
381
371
|
|
|
382
372
|
// src/cli/stages/update-package-json.ts
|
|
@@ -393,21 +383,21 @@ async function updatePackageJson(result) {
|
|
|
393
383
|
if (result.extra.length) {
|
|
394
384
|
result.extra.forEach((item) => {
|
|
395
385
|
switch (item) {
|
|
396
|
-
case "
|
|
386
|
+
case "unocss":
|
|
397
387
|
[
|
|
398
|
-
"eslint-plugin
|
|
399
|
-
result.frameworks.includes("astro") ? "prettier-plugin-astro" : null
|
|
388
|
+
"@unocss/eslint-plugin"
|
|
400
389
|
].forEach((f) => {
|
|
401
|
-
if (!f)
|
|
402
|
-
return;
|
|
403
390
|
pkg.devDependencies[f] = package_default.devDependencies[f];
|
|
404
391
|
addedPackages.push(f);
|
|
405
392
|
});
|
|
406
393
|
break;
|
|
407
|
-
case "
|
|
394
|
+
case "formatter":
|
|
408
395
|
[
|
|
409
|
-
"
|
|
396
|
+
"eslint-plugin-format",
|
|
397
|
+
result.frameworks.includes("astro") ? "prettier-plugin-astro" : null
|
|
410
398
|
].forEach((f) => {
|
|
399
|
+
if (!f)
|
|
400
|
+
return;
|
|
411
401
|
pkg.devDependencies[f] = package_default.devDependencies[f];
|
|
412
402
|
addedPackages.push(f);
|
|
413
403
|
});
|
|
@@ -431,7 +421,6 @@ async function updatePackageJson(result) {
|
|
|
431
421
|
}
|
|
432
422
|
|
|
433
423
|
// src/cli/stages/update-vscode-settings.ts
|
|
434
|
-
init_esm_shims();
|
|
435
424
|
import fs2 from "node:fs";
|
|
436
425
|
import c4 from "picocolors";
|
|
437
426
|
import path3 from "node:path";
|
|
@@ -543,17 +532,17 @@ var instance = yargs(hideBin(process5.argv)).scriptName("@whoj/eslint-config").u
|
|
|
543
532
|
"Run the initialization or migration",
|
|
544
533
|
(args) => args.option("yes", {
|
|
545
534
|
alias: "y",
|
|
546
|
-
|
|
547
|
-
|
|
535
|
+
type: "boolean",
|
|
536
|
+
description: "Skip prompts and use default values"
|
|
548
537
|
}).option("template", {
|
|
549
538
|
alias: "t",
|
|
550
|
-
|
|
551
|
-
|
|
539
|
+
type: "string",
|
|
540
|
+
description: "Use the framework template for optimal customization: vue / react / svelte / astro"
|
|
552
541
|
}).option("extra", {
|
|
553
542
|
alias: "e",
|
|
554
543
|
array: true,
|
|
555
|
-
|
|
556
|
-
|
|
544
|
+
type: "string",
|
|
545
|
+
description: "Use the extra utils: formatter / perfectionist / unocss"
|
|
557
546
|
}).help(),
|
|
558
547
|
async (args) => {
|
|
559
548
|
header();
|