@ivanmaxlogiudice/eslint-config 1.0.31 → 2.0.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 +33 -3
- package/dist/{chunk-AWNEBLNN.js → chunk-GJINZYDK.js} +2 -2
- package/dist/cli.cjs +29 -28
- package/dist/cli.js +30 -29
- package/dist/index.cjs +32 -37
- package/dist/index.d.cts +297 -340
- package/dist/index.d.ts +297 -340
- package/dist/index.js +32 -37
- package/dist/{prompts-O7YTATYJ.js → prompts-X5AQPJQZ.js} +1 -1
- package/package.json +27 -27
package/README.md
CHANGED
|
@@ -118,7 +118,7 @@ Add the following settings to your `settings.json`:
|
|
|
118
118
|
```jsonc
|
|
119
119
|
{
|
|
120
120
|
// Enable the flat config support
|
|
121
|
-
"eslint.
|
|
121
|
+
"eslint.useFlatConfig": true,
|
|
122
122
|
|
|
123
123
|
// Disable the default formatter
|
|
124
124
|
"prettier.enable": false,
|
|
@@ -308,6 +308,8 @@ When you want to override rules, or disable them inline, you need to update to t
|
|
|
308
308
|
type foo = { bar: 2 }
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
+
Since v2.0.0, this preset will automatically rename the plugins also for your custom configs. You can use the original prefix to override the rules directly.
|
|
312
|
+
|
|
311
313
|
### Rules Overrides
|
|
312
314
|
|
|
313
315
|
Certain rules would only be enabled in specific files, for example, `ts/*` rules would only be enabled in `.ts` files and `vue/*` rules would only be enabled in `.vue` files. If you want to override the rules, you need to specify the file extension:
|
|
@@ -337,7 +339,7 @@ export default config(
|
|
|
337
339
|
)
|
|
338
340
|
```
|
|
339
341
|
|
|
340
|
-
We also provided
|
|
342
|
+
We also provided the `overrides` options in each integration to make it easier:
|
|
341
343
|
|
|
342
344
|
```js
|
|
343
345
|
// eslint.config.js
|
|
@@ -362,6 +364,35 @@ export default config({
|
|
|
362
364
|
})
|
|
363
365
|
```
|
|
364
366
|
|
|
367
|
+
### Config Composer
|
|
368
|
+
|
|
369
|
+
Since v2.0.0, the factory function `config()` returns a [`FlatConfigComposer` object from `eslint-flat-config-utils`](https://github.com/antfu/eslint-flat-config-utils#composer) where you can chain the methods to compose the config even more flexibly.
|
|
370
|
+
|
|
371
|
+
```js
|
|
372
|
+
// eslint.config.js
|
|
373
|
+
import config from '@ivanmaxlogiudice/eslint-config'
|
|
374
|
+
|
|
375
|
+
export default config()
|
|
376
|
+
.prepend(
|
|
377
|
+
// some configs before the main config
|
|
378
|
+
)
|
|
379
|
+
// overrides any named configs
|
|
380
|
+
.override(
|
|
381
|
+
'antfu/imports',
|
|
382
|
+
{
|
|
383
|
+
rules: {
|
|
384
|
+
'import/order': ['error', { 'newlines-between': 'always' }],
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
)
|
|
388
|
+
// rename plugin prefixes
|
|
389
|
+
.renamePlugins({
|
|
390
|
+
'old-prefix': 'new-prefix',
|
|
391
|
+
// ...
|
|
392
|
+
})
|
|
393
|
+
// ...
|
|
394
|
+
```
|
|
395
|
+
|
|
365
396
|
### Optional Configs
|
|
366
397
|
|
|
367
398
|
We provide some optional configs for specific use cases, that we don't include their dependencies by default.
|
|
@@ -448,7 +479,6 @@ const objectWantedToSort = {
|
|
|
448
479
|
b: 1,
|
|
449
480
|
c: 3,
|
|
450
481
|
}
|
|
451
|
-
/* eslint perfectionist/sort-objects: "off" */
|
|
452
482
|
```
|
|
453
483
|
|
|
454
484
|
### Type Aware Rules
|
|
@@ -13,9 +13,9 @@ var __commonJS = (cb, mod) => function __require2() {
|
|
|
13
13
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/tsup@8.0.
|
|
16
|
+
// node_modules/.pnpm/tsup@8.0.2_postcss@8.4.38_typescript@5.4.5/node_modules/tsup/assets/esm_shims.js
|
|
17
17
|
var init_esm_shims = __esm({
|
|
18
|
-
"node_modules/.pnpm/tsup@8.0.
|
|
18
|
+
"node_modules/.pnpm/tsup@8.0.2_postcss@8.4.38_typescript@5.4.5/node_modules/tsup/assets/esm_shims.js"() {
|
|
19
19
|
"use strict";
|
|
20
20
|
}
|
|
21
21
|
});
|
package/dist/cli.cjs
CHANGED
|
@@ -40,8 +40,8 @@ var import_picocolors = __toESM(require("picocolors"), 1);
|
|
|
40
40
|
// package.json
|
|
41
41
|
var package_default = {
|
|
42
42
|
name: "@ivanmaxlogiudice/eslint-config",
|
|
43
|
-
version: "
|
|
44
|
-
packageManager: "pnpm@
|
|
43
|
+
version: "2.0.0",
|
|
44
|
+
packageManager: "pnpm@9.0.4",
|
|
45
45
|
description: "Personal ESLint config",
|
|
46
46
|
type: "module",
|
|
47
47
|
keywords: [
|
|
@@ -74,10 +74,10 @@ var package_default = {
|
|
|
74
74
|
},
|
|
75
75
|
scripts: {
|
|
76
76
|
stub: "tsup --format esm",
|
|
77
|
-
dev: "
|
|
77
|
+
dev: "pnpx @eslint/config-inspector --config eslint.config.ts",
|
|
78
78
|
build: "pnpm run typegen && tsup --format esm,cjs --clean --dts",
|
|
79
79
|
"build:inspector": "pnpm build && pnpx @eslint/config-inspector build",
|
|
80
|
-
lint: "pnpm run stub && eslint .",
|
|
80
|
+
lint: "pnpm run stub && eslint . --fix",
|
|
81
81
|
typegen: "esno scripts/typegen.ts",
|
|
82
82
|
prepack: "pnpm run build",
|
|
83
83
|
release: "bumpp && pnpm publish",
|
|
@@ -101,29 +101,29 @@ var package_default = {
|
|
|
101
101
|
dependencies: {
|
|
102
102
|
"@antfu/install-pkg": "^0.3.2",
|
|
103
103
|
"@clack/prompts": "^0.7.0",
|
|
104
|
-
"@stylistic/eslint-plugin": "^1.7.
|
|
105
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
106
|
-
"@typescript-eslint/parser": "^7.
|
|
104
|
+
"@stylistic/eslint-plugin": "^1.7.2",
|
|
105
|
+
"@typescript-eslint/eslint-plugin": "^7.7.0",
|
|
106
|
+
"@typescript-eslint/parser": "^7.7.0",
|
|
107
107
|
"detect-indent": "^7.0.1",
|
|
108
108
|
"eslint-config-flat-gitignore": "^0.1.5",
|
|
109
|
+
"eslint-flat-config-utils": "^0.2.3",
|
|
109
110
|
"eslint-merge-processors": "^0.1.0",
|
|
110
111
|
"eslint-plugin-antfu": "^2.1.2",
|
|
111
112
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
112
113
|
"eslint-plugin-import-x": "^0.5.0",
|
|
113
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
114
|
-
"eslint-plugin-jsonc": "^2.15.
|
|
114
|
+
"eslint-plugin-jsdoc": "^48.2.3",
|
|
115
|
+
"eslint-plugin-jsonc": "^2.15.1",
|
|
115
116
|
"eslint-plugin-markdown": "^4.0.1",
|
|
116
|
-
"eslint-plugin-n": "^
|
|
117
|
+
"eslint-plugin-n": "^17.2.1",
|
|
117
118
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
118
|
-
"eslint-plugin-perfectionist": "^2.
|
|
119
|
-
"eslint-plugin-
|
|
120
|
-
"eslint-plugin-unicorn": "^51.0.1",
|
|
119
|
+
"eslint-plugin-perfectionist": "^2.9.0",
|
|
120
|
+
"eslint-plugin-unicorn": "^52.0.0",
|
|
121
121
|
"eslint-plugin-unused-imports": "^3.1.0",
|
|
122
|
-
"eslint-plugin-vitest": "^0.
|
|
123
|
-
"eslint-plugin-vue": "^9.
|
|
122
|
+
"eslint-plugin-vitest": "^0.5.3",
|
|
123
|
+
"eslint-plugin-vue": "^9.25.0",
|
|
124
124
|
"eslint-plugin-yml": "^1.14.0",
|
|
125
|
-
"eslint-processor-vue-blocks": "^0.1.
|
|
126
|
-
"eslint-typegen": "^0.2.
|
|
125
|
+
"eslint-processor-vue-blocks": "^0.1.2",
|
|
126
|
+
"eslint-typegen": "^0.2.3",
|
|
127
127
|
globals: "^15.0.0",
|
|
128
128
|
"jsonc-eslint-parser": "^2.4.0",
|
|
129
129
|
"local-pkg": "^0.5.0",
|
|
@@ -134,17 +134,18 @@ var package_default = {
|
|
|
134
134
|
yargs: "^17.7.2"
|
|
135
135
|
},
|
|
136
136
|
devDependencies: {
|
|
137
|
-
"@eslint/config-inspector": "^0.
|
|
138
|
-
"@stylistic/eslint-plugin-migrate": "^1.7.
|
|
139
|
-
"@types/eslint": "^8.56.
|
|
137
|
+
"@eslint/config-inspector": "^0.4.6",
|
|
138
|
+
"@stylistic/eslint-plugin-migrate": "^1.7.2",
|
|
139
|
+
"@types/eslint": "^8.56.10",
|
|
140
140
|
"@types/fs-extra": "^11.0.4",
|
|
141
|
-
"@types/node": "^20.12.
|
|
141
|
+
"@types/node": "^20.12.7",
|
|
142
142
|
"@types/prompts": "^2.4.9",
|
|
143
143
|
"@types/yargs": "^17.0.32",
|
|
144
|
-
"@unocss/eslint-plugin": "^0.
|
|
144
|
+
"@unocss/eslint-plugin": "^0.59.4",
|
|
145
145
|
bumpp: "^9.4.0",
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
"bundle-require": "^4.0.2",
|
|
147
|
+
eslint: "^9.1.0",
|
|
148
|
+
"eslint-plugin-format": "^0.1.1",
|
|
148
149
|
esno: "^4.7.0",
|
|
149
150
|
execa: "^8.0.1",
|
|
150
151
|
"fast-glob": "^3.3.2",
|
|
@@ -152,9 +153,9 @@ var package_default = {
|
|
|
152
153
|
"lint-staged": "^15.2.2",
|
|
153
154
|
"simple-git-hooks": "^2.11.1",
|
|
154
155
|
tsup: "^8.0.2",
|
|
155
|
-
typescript: "^5.4.
|
|
156
|
-
vitest: "^1.
|
|
157
|
-
vue: "^3.4.
|
|
156
|
+
typescript: "^5.4.5",
|
|
157
|
+
vitest: "^1.5.0",
|
|
158
|
+
vue: "^3.4.23"
|
|
158
159
|
},
|
|
159
160
|
engines: {
|
|
160
161
|
node: ">=18.12.0"
|
|
@@ -174,7 +175,7 @@ var CROSS = import_picocolors.default.red("\u2718");
|
|
|
174
175
|
var WARN = import_picocolors.default.yellow("\u2139");
|
|
175
176
|
var vscodeSettingsString = `
|
|
176
177
|
// Enable the ESlint flat config support
|
|
177
|
-
"eslint.
|
|
178
|
+
"eslint.useFlatConfig": true,
|
|
178
179
|
|
|
179
180
|
// Disable the default formatter, use eslint instead
|
|
180
181
|
"prettier.enable": false,
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_esm_shims
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GJINZYDK.js";
|
|
4
4
|
|
|
5
5
|
// src/cli.ts
|
|
6
6
|
init_esm_shims();
|
|
@@ -20,8 +20,8 @@ import c from "picocolors";
|
|
|
20
20
|
// package.json
|
|
21
21
|
var package_default = {
|
|
22
22
|
name: "@ivanmaxlogiudice/eslint-config",
|
|
23
|
-
version: "
|
|
24
|
-
packageManager: "pnpm@
|
|
23
|
+
version: "2.0.0",
|
|
24
|
+
packageManager: "pnpm@9.0.4",
|
|
25
25
|
description: "Personal ESLint config",
|
|
26
26
|
type: "module",
|
|
27
27
|
keywords: [
|
|
@@ -54,10 +54,10 @@ var package_default = {
|
|
|
54
54
|
},
|
|
55
55
|
scripts: {
|
|
56
56
|
stub: "tsup --format esm",
|
|
57
|
-
dev: "
|
|
57
|
+
dev: "pnpx @eslint/config-inspector --config eslint.config.ts",
|
|
58
58
|
build: "pnpm run typegen && tsup --format esm,cjs --clean --dts",
|
|
59
59
|
"build:inspector": "pnpm build && pnpx @eslint/config-inspector build",
|
|
60
|
-
lint: "pnpm run stub && eslint .",
|
|
60
|
+
lint: "pnpm run stub && eslint . --fix",
|
|
61
61
|
typegen: "esno scripts/typegen.ts",
|
|
62
62
|
prepack: "pnpm run build",
|
|
63
63
|
release: "bumpp && pnpm publish",
|
|
@@ -81,29 +81,29 @@ var package_default = {
|
|
|
81
81
|
dependencies: {
|
|
82
82
|
"@antfu/install-pkg": "^0.3.2",
|
|
83
83
|
"@clack/prompts": "^0.7.0",
|
|
84
|
-
"@stylistic/eslint-plugin": "^1.7.
|
|
85
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
86
|
-
"@typescript-eslint/parser": "^7.
|
|
84
|
+
"@stylistic/eslint-plugin": "^1.7.2",
|
|
85
|
+
"@typescript-eslint/eslint-plugin": "^7.7.0",
|
|
86
|
+
"@typescript-eslint/parser": "^7.7.0",
|
|
87
87
|
"detect-indent": "^7.0.1",
|
|
88
88
|
"eslint-config-flat-gitignore": "^0.1.5",
|
|
89
|
+
"eslint-flat-config-utils": "^0.2.3",
|
|
89
90
|
"eslint-merge-processors": "^0.1.0",
|
|
90
91
|
"eslint-plugin-antfu": "^2.1.2",
|
|
91
92
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
92
93
|
"eslint-plugin-import-x": "^0.5.0",
|
|
93
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
94
|
-
"eslint-plugin-jsonc": "^2.15.
|
|
94
|
+
"eslint-plugin-jsdoc": "^48.2.3",
|
|
95
|
+
"eslint-plugin-jsonc": "^2.15.1",
|
|
95
96
|
"eslint-plugin-markdown": "^4.0.1",
|
|
96
|
-
"eslint-plugin-n": "^
|
|
97
|
+
"eslint-plugin-n": "^17.2.1",
|
|
97
98
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
98
|
-
"eslint-plugin-perfectionist": "^2.
|
|
99
|
-
"eslint-plugin-
|
|
100
|
-
"eslint-plugin-unicorn": "^51.0.1",
|
|
99
|
+
"eslint-plugin-perfectionist": "^2.9.0",
|
|
100
|
+
"eslint-plugin-unicorn": "^52.0.0",
|
|
101
101
|
"eslint-plugin-unused-imports": "^3.1.0",
|
|
102
|
-
"eslint-plugin-vitest": "^0.
|
|
103
|
-
"eslint-plugin-vue": "^9.
|
|
102
|
+
"eslint-plugin-vitest": "^0.5.3",
|
|
103
|
+
"eslint-plugin-vue": "^9.25.0",
|
|
104
104
|
"eslint-plugin-yml": "^1.14.0",
|
|
105
|
-
"eslint-processor-vue-blocks": "^0.1.
|
|
106
|
-
"eslint-typegen": "^0.2.
|
|
105
|
+
"eslint-processor-vue-blocks": "^0.1.2",
|
|
106
|
+
"eslint-typegen": "^0.2.3",
|
|
107
107
|
globals: "^15.0.0",
|
|
108
108
|
"jsonc-eslint-parser": "^2.4.0",
|
|
109
109
|
"local-pkg": "^0.5.0",
|
|
@@ -114,17 +114,18 @@ var package_default = {
|
|
|
114
114
|
yargs: "^17.7.2"
|
|
115
115
|
},
|
|
116
116
|
devDependencies: {
|
|
117
|
-
"@eslint/config-inspector": "^0.
|
|
118
|
-
"@stylistic/eslint-plugin-migrate": "^1.7.
|
|
119
|
-
"@types/eslint": "^8.56.
|
|
117
|
+
"@eslint/config-inspector": "^0.4.6",
|
|
118
|
+
"@stylistic/eslint-plugin-migrate": "^1.7.2",
|
|
119
|
+
"@types/eslint": "^8.56.10",
|
|
120
120
|
"@types/fs-extra": "^11.0.4",
|
|
121
|
-
"@types/node": "^20.12.
|
|
121
|
+
"@types/node": "^20.12.7",
|
|
122
122
|
"@types/prompts": "^2.4.9",
|
|
123
123
|
"@types/yargs": "^17.0.32",
|
|
124
|
-
"@unocss/eslint-plugin": "^0.
|
|
124
|
+
"@unocss/eslint-plugin": "^0.59.4",
|
|
125
125
|
bumpp: "^9.4.0",
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
"bundle-require": "^4.0.2",
|
|
127
|
+
eslint: "^9.1.0",
|
|
128
|
+
"eslint-plugin-format": "^0.1.1",
|
|
128
129
|
esno: "^4.7.0",
|
|
129
130
|
execa: "^8.0.1",
|
|
130
131
|
"fast-glob": "^3.3.2",
|
|
@@ -132,9 +133,9 @@ var package_default = {
|
|
|
132
133
|
"lint-staged": "^15.2.2",
|
|
133
134
|
"simple-git-hooks": "^2.11.1",
|
|
134
135
|
tsup: "^8.0.2",
|
|
135
|
-
typescript: "^5.4.
|
|
136
|
-
vitest: "^1.
|
|
137
|
-
vue: "^3.4.
|
|
136
|
+
typescript: "^5.4.5",
|
|
137
|
+
vitest: "^1.5.0",
|
|
138
|
+
vue: "^3.4.23"
|
|
138
139
|
},
|
|
139
140
|
engines: {
|
|
140
141
|
node: ">=18.12.0"
|
|
@@ -154,7 +155,7 @@ var CROSS = c.red("\u2718");
|
|
|
154
155
|
var WARN = c.yellow("\u2139");
|
|
155
156
|
var vscodeSettingsString = `
|
|
156
157
|
// Enable the ESlint flat config support
|
|
157
|
-
"eslint.
|
|
158
|
+
"eslint.useFlatConfig": true,
|
|
158
159
|
|
|
159
160
|
// Disable the default formatter, use eslint instead
|
|
160
161
|
"prettier.enable": false,
|
package/dist/index.cjs
CHANGED
|
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// node_modules/.pnpm/tsup@8.0.
|
|
36
|
+
// node_modules/.pnpm/tsup@8.0.2_postcss@8.4.38_typescript@5.4.5/node_modules/tsup/assets/cjs_shims.js
|
|
37
37
|
var init_cjs_shims = __esm({
|
|
38
|
-
"node_modules/.pnpm/tsup@8.0.
|
|
38
|
+
"node_modules/.pnpm/tsup@8.0.2_postcss@8.4.38_typescript@5.4.5/node_modules/tsup/assets/cjs_shims.js"() {
|
|
39
39
|
"use strict";
|
|
40
40
|
}
|
|
41
41
|
});
|
|
@@ -5246,6 +5246,7 @@ init_cjs_shims();
|
|
|
5246
5246
|
init_cjs_shims();
|
|
5247
5247
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
5248
5248
|
var import_node_process3 = __toESM(require("process"), 1);
|
|
5249
|
+
var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
5249
5250
|
var import_local_pkg2 = require("local-pkg");
|
|
5250
5251
|
|
|
5251
5252
|
// src/configs/index.ts
|
|
@@ -5585,7 +5586,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
5585
5586
|
}
|
|
5586
5587
|
if (options.html) {
|
|
5587
5588
|
configs.push({
|
|
5588
|
-
files: [
|
|
5589
|
+
files: [GLOB_HTML],
|
|
5589
5590
|
languageOptions: {
|
|
5590
5591
|
parser: parserPlain
|
|
5591
5592
|
},
|
|
@@ -5701,11 +5702,8 @@ async function javascript(options = {}) {
|
|
|
5701
5702
|
overrides = {}
|
|
5702
5703
|
} = options;
|
|
5703
5704
|
const [
|
|
5704
|
-
pluginPromise,
|
|
5705
5705
|
pluginUnusedImports
|
|
5706
5706
|
] = await Promise.all([
|
|
5707
|
-
// @ts-expect-error Missing types
|
|
5708
|
-
interopDefault(import("eslint-plugin-promise")),
|
|
5709
5707
|
// @ts-expect-error Missing types
|
|
5710
5708
|
interopDefault(import("eslint-plugin-unused-imports"))
|
|
5711
5709
|
]);
|
|
@@ -5736,7 +5734,6 @@ async function javascript(options = {}) {
|
|
|
5736
5734
|
name: "config:javascript",
|
|
5737
5735
|
plugins: {
|
|
5738
5736
|
"antfu": import_eslint_plugin_antfu.default,
|
|
5739
|
-
"promise": pluginPromise,
|
|
5740
5737
|
"unused-imports": pluginUnusedImports
|
|
5741
5738
|
},
|
|
5742
5739
|
rules: {
|
|
@@ -5926,11 +5923,6 @@ async function javascript(options = {}) {
|
|
|
5926
5923
|
}],
|
|
5927
5924
|
"vars-on-top": "error",
|
|
5928
5925
|
"yoda": ["error", "never"],
|
|
5929
|
-
// Promise
|
|
5930
|
-
...pluginPromise.configs.recommended.rules,
|
|
5931
|
-
"promise/always-return": ["error", {
|
|
5932
|
-
ignoreLastCallback: true
|
|
5933
|
-
}],
|
|
5934
5926
|
...overrides
|
|
5935
5927
|
}
|
|
5936
5928
|
},
|
|
@@ -6483,6 +6475,7 @@ function sortTsconfig() {
|
|
|
6483
6475
|
|
|
6484
6476
|
// src/configs/test.ts
|
|
6485
6477
|
init_cjs_shims();
|
|
6478
|
+
var _pluginTest;
|
|
6486
6479
|
async function test(options = {}) {
|
|
6487
6480
|
const {
|
|
6488
6481
|
files = GLOB_TESTS,
|
|
@@ -6497,18 +6490,19 @@ async function test(options = {}) {
|
|
|
6497
6490
|
// @ts-expect-error Missing types
|
|
6498
6491
|
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
6499
6492
|
]);
|
|
6493
|
+
_pluginTest = _pluginTest || {
|
|
6494
|
+
...pluginVitest,
|
|
6495
|
+
rules: {
|
|
6496
|
+
...pluginVitest.rules,
|
|
6497
|
+
// extend `test/no-only-tests` rule
|
|
6498
|
+
...pluginNoOnlyTests.rules
|
|
6499
|
+
}
|
|
6500
|
+
};
|
|
6500
6501
|
return [
|
|
6501
6502
|
{
|
|
6502
6503
|
name: "config:test:setup",
|
|
6503
6504
|
plugins: {
|
|
6504
|
-
test:
|
|
6505
|
-
...pluginVitest,
|
|
6506
|
-
rules: {
|
|
6507
|
-
...pluginVitest.rules,
|
|
6508
|
-
// extend `test/no-only-tests` rule
|
|
6509
|
-
...pluginNoOnlyTests.rules
|
|
6510
|
-
}
|
|
6511
|
-
}
|
|
6505
|
+
test: _pluginTest
|
|
6512
6506
|
}
|
|
6513
6507
|
},
|
|
6514
6508
|
{
|
|
@@ -6770,9 +6764,10 @@ async function unicorn() {
|
|
|
6770
6764
|
"unicorn/prefer-string-slice": "error",
|
|
6771
6765
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
6772
6766
|
"unicorn/prefer-string-trim-start-end": "error",
|
|
6773
|
-
"unicorn/prefer-top-level-await": "error",
|
|
6774
6767
|
"unicorn/prefer-type-error": "error",
|
|
6775
|
-
"unicorn/throw-new-error": "error"
|
|
6768
|
+
"unicorn/throw-new-error": "error",
|
|
6769
|
+
// Off
|
|
6770
|
+
"unicorn/prefer-top-level-await": "off"
|
|
6776
6771
|
}
|
|
6777
6772
|
}
|
|
6778
6773
|
];
|
|
@@ -7083,12 +7078,12 @@ var defaultPluginRenaming = {
|
|
|
7083
7078
|
"vitest": "test",
|
|
7084
7079
|
"yml": "yaml"
|
|
7085
7080
|
};
|
|
7086
|
-
|
|
7081
|
+
function config(options = {}, ...userConfigs) {
|
|
7087
7082
|
const {
|
|
7088
7083
|
autoRenamePlugins = true,
|
|
7089
7084
|
componentExts = [],
|
|
7090
7085
|
gitignore: enableGitignore = true,
|
|
7091
|
-
isInEditor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM) && !import_node_process3.default.env.CI),
|
|
7086
|
+
isInEditor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.VSCODE_CWD || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM) && !import_node_process3.default.env.CI),
|
|
7092
7087
|
typescript: enableTypeScript = (0, import_local_pkg2.isPackageExists)("typescript"),
|
|
7093
7088
|
unocss: enableUnoCSS = UnocssPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i)),
|
|
7094
7089
|
vue: enableVue = VuePackages.some((i) => (0, import_local_pkg2.isPackageExists)(i))
|
|
@@ -7099,9 +7094,7 @@ async function config(options = {}, ...userConfigs) {
|
|
|
7099
7094
|
const configs = [];
|
|
7100
7095
|
if (enableGitignore) {
|
|
7101
7096
|
if (typeof enableGitignore !== "boolean") {
|
|
7102
|
-
configs.push(
|
|
7103
|
-
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)])
|
|
7104
|
-
);
|
|
7097
|
+
configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)]));
|
|
7105
7098
|
} else {
|
|
7106
7099
|
if (import_node_fs.default.existsSync(".gitignore"))
|
|
7107
7100
|
configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
|
|
@@ -7138,12 +7131,6 @@ async function config(options = {}, ...userConfigs) {
|
|
|
7138
7131
|
overrides: getOverrides(options, "stylistic")
|
|
7139
7132
|
}));
|
|
7140
7133
|
}
|
|
7141
|
-
if (enableUnoCSS) {
|
|
7142
|
-
configs.push(unocss({
|
|
7143
|
-
...resolveSubOptions(options, "unocss"),
|
|
7144
|
-
overrides: getOverrides(options, "unocss")
|
|
7145
|
-
}));
|
|
7146
|
-
}
|
|
7147
7134
|
if (options.test ?? true) {
|
|
7148
7135
|
configs.push(test({
|
|
7149
7136
|
isInEditor,
|
|
@@ -7158,6 +7145,12 @@ async function config(options = {}, ...userConfigs) {
|
|
|
7158
7145
|
typescript: !!enableTypeScript
|
|
7159
7146
|
}));
|
|
7160
7147
|
}
|
|
7148
|
+
if (enableUnoCSS) {
|
|
7149
|
+
configs.push(unocss({
|
|
7150
|
+
...resolveSubOptions(options, "unocss"),
|
|
7151
|
+
overrides: getOverrides(options, "unocss")
|
|
7152
|
+
}));
|
|
7153
|
+
}
|
|
7161
7154
|
if (options.jsonc ?? true) {
|
|
7162
7155
|
configs.push(
|
|
7163
7156
|
jsonc({
|
|
@@ -7198,13 +7191,15 @@ async function config(options = {}, ...userConfigs) {
|
|
|
7198
7191
|
}, {});
|
|
7199
7192
|
if (Object.keys(fusedConfig).length > 0)
|
|
7200
7193
|
configs.push([fusedConfig]);
|
|
7201
|
-
|
|
7194
|
+
let composer = new import_eslint_flat_config_utils.FlatConfigComposer();
|
|
7195
|
+
composer = composer.append(
|
|
7202
7196
|
...configs,
|
|
7203
7197
|
...userConfigs
|
|
7204
7198
|
);
|
|
7205
|
-
if (autoRenamePlugins)
|
|
7206
|
-
|
|
7207
|
-
|
|
7199
|
+
if (autoRenamePlugins) {
|
|
7200
|
+
composer = composer.renamePlugins(defaultPluginRenaming);
|
|
7201
|
+
}
|
|
7202
|
+
return composer;
|
|
7208
7203
|
}
|
|
7209
7204
|
function resolveSubOptions(options, key) {
|
|
7210
7205
|
return typeof options[key] === "boolean" ? {} : options[key] || {};
|