@ivanmaxlogiudice/eslint-config 1.0.14 → 1.0.16
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 +6 -6
- package/dist/cli.cjs +21 -14
- package/dist/cli.js +21 -14
- package/dist/index.cjs +26 -11
- package/dist/index.d.cts +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +25 -11
- package/package.json +20 -21
package/README.md
CHANGED
|
@@ -91,14 +91,14 @@ For example:
|
|
|
91
91
|
### Migration
|
|
92
92
|
|
|
93
93
|
We provided an experimental CLI tool to help you migrate from the legacy config to the new flat config.
|
|
94
|
-
You can use the `-y` / `--yes` flag to skip the promps and use the default values.
|
|
95
94
|
|
|
96
95
|
```bash
|
|
97
|
-
# npm
|
|
98
|
-
npx @ivanmaxlogiudice/eslint-config@latest -y
|
|
99
|
-
|
|
100
96
|
# pnpm
|
|
101
|
-
|
|
97
|
+
pnpx @ivanmaxlogiudice/eslint-config@latest
|
|
98
|
+
|
|
99
|
+
Options:
|
|
100
|
+
-y, --yes Skip prompts and use default values
|
|
101
|
+
-i, --ignore-git Skip uncommitted changes
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
Before running the migration, make sure to commit your unsaved changes first.
|
|
@@ -417,7 +417,7 @@ export default config({
|
|
|
417
417
|
})
|
|
418
418
|
```
|
|
419
419
|
|
|
420
|
-
Running `
|
|
420
|
+
Running `pnpx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
|
|
421
421
|
|
|
422
422
|
```bash
|
|
423
423
|
pnpm add -D @unocss/eslint-plugin
|
package/dist/cli.cjs
CHANGED
|
@@ -35,16 +35,16 @@ var import_picocolors4 = __toESM(require("picocolors"), 1);
|
|
|
35
35
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
36
36
|
|
|
37
37
|
// package.json
|
|
38
|
-
var version = "1.0.
|
|
38
|
+
var version = "1.0.16";
|
|
39
39
|
var devDependencies = {
|
|
40
|
-
"@stylistic/eslint-plugin-migrate": "^1.5.
|
|
41
|
-
"@types/eslint": "^8.44.
|
|
40
|
+
"@stylistic/eslint-plugin-migrate": "^1.5.1",
|
|
41
|
+
"@types/eslint": "^8.44.9",
|
|
42
42
|
"@types/fs-extra": "^11.0.4",
|
|
43
|
-
"@types/node": "^20.10.
|
|
43
|
+
"@types/node": "^20.10.4",
|
|
44
44
|
"@types/prompts": "^2.4.9",
|
|
45
45
|
"@unocss/eslint-plugin": "^0.58.0",
|
|
46
|
-
bumpp: "^9.2.
|
|
47
|
-
eslint: "^8.
|
|
46
|
+
bumpp: "^9.2.1",
|
|
47
|
+
eslint: "^8.56.0",
|
|
48
48
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
49
49
|
"eslint-plugin-format": "^0.1.0",
|
|
50
50
|
execa: "^8.0.1",
|
|
@@ -53,8 +53,8 @@ var devDependencies = {
|
|
|
53
53
|
"lint-staged": "^15.2.0",
|
|
54
54
|
"simple-git-hooks": "^2.9.0",
|
|
55
55
|
tsup: "^8.0.1",
|
|
56
|
-
typescript: "^5.3.
|
|
57
|
-
vitest: "^1.0.
|
|
56
|
+
typescript: "^5.3.3",
|
|
57
|
+
vitest: "^1.0.4",
|
|
58
58
|
vue: "^3.3.11"
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -137,16 +137,25 @@ function isGitClean() {
|
|
|
137
137
|
|
|
138
138
|
// src/cli/run.ts
|
|
139
139
|
async function run(options = {}) {
|
|
140
|
+
console.log(options);
|
|
140
141
|
const SKIP_PROMPT = !!import_node_process2.default.env.SKIP_PROMPT || options.yes;
|
|
141
|
-
const SKIP_GIT_CHECK = !!import_node_process2.default.env.SKIP_GIT_CHECK;
|
|
142
|
+
const SKIP_GIT_CHECK = !!import_node_process2.default.env.SKIP_GIT_CHECK || options.ignoreGit;
|
|
142
143
|
const cwd = import_node_process2.default.cwd();
|
|
143
144
|
const pathPackageJSON = import_node_path.default.join(import_node_process2.default.cwd(), "package.json");
|
|
144
145
|
const pathESLintConfig = import_node_path.default.join(import_node_process2.default.cwd(), "eslint.config.js");
|
|
145
146
|
const pathESLintIngore = import_node_path.default.join(import_node_process2.default.cwd(), ".eslintignore");
|
|
146
147
|
if (import_node_fs.default.existsSync(pathESLintConfig))
|
|
147
148
|
throwError(WARN, "eslint.config.js already exists, migration wizard exited.");
|
|
148
|
-
if (!SKIP_GIT_CHECK && !isGitClean())
|
|
149
|
-
|
|
149
|
+
if (!SKIP_GIT_CHECK && !isGitClean()) {
|
|
150
|
+
const { confirmed } = await (0, import_prompts.default)({
|
|
151
|
+
initial: false,
|
|
152
|
+
message: "There are uncommitted changes in the current repository, are you sure to continue?",
|
|
153
|
+
name: "confirmed",
|
|
154
|
+
type: "confirm"
|
|
155
|
+
});
|
|
156
|
+
if (!confirmed)
|
|
157
|
+
throwError(CROSS, "There are uncommitted changes in the current repository, please commit them and try again.");
|
|
158
|
+
}
|
|
150
159
|
console.log(`
|
|
151
160
|
${ARROW} Installing ${import_picocolors3.default.green("@ivanmaxlogiudice/eslint-config")} to v${import_picocolors3.default.yellow(version)}.
|
|
152
161
|
`);
|
|
@@ -283,9 +292,7 @@ ${WARN} You can now remove those dependencies: `);
|
|
|
283
292
|
var cli = (0, import_cac.cac)(
|
|
284
293
|
import_picocolors4.default.green("@ivanmaxlogiudice/eslint-config")
|
|
285
294
|
);
|
|
286
|
-
cli.command("", "Run the initialization or migration").option("-y, --yes", "Skip prompts and use default values", { type: [Boolean] }).action(run);
|
|
295
|
+
cli.command("", "Run the initialization or migration").option("-y, --yes", "Skip prompts and use default values", { type: [Boolean] }).option("-i, --ignore-git", "Skip uncommitted changes", { type: [Boolean] }).action(run);
|
|
287
296
|
cli.help();
|
|
288
297
|
cli.version(`${import_picocolors4.default.bold(version)}`);
|
|
289
298
|
cli.parse();
|
|
290
|
-
if (!cli.matchedCommand)
|
|
291
|
-
cli.outputHelp();
|
package/dist/cli.js
CHANGED
|
@@ -6,16 +6,16 @@ import c4 from "picocolors";
|
|
|
6
6
|
import c from "picocolors";
|
|
7
7
|
|
|
8
8
|
// package.json
|
|
9
|
-
var version = "1.0.
|
|
9
|
+
var version = "1.0.16";
|
|
10
10
|
var devDependencies = {
|
|
11
|
-
"@stylistic/eslint-plugin-migrate": "^1.5.
|
|
12
|
-
"@types/eslint": "^8.44.
|
|
11
|
+
"@stylistic/eslint-plugin-migrate": "^1.5.1",
|
|
12
|
+
"@types/eslint": "^8.44.9",
|
|
13
13
|
"@types/fs-extra": "^11.0.4",
|
|
14
|
-
"@types/node": "^20.10.
|
|
14
|
+
"@types/node": "^20.10.4",
|
|
15
15
|
"@types/prompts": "^2.4.9",
|
|
16
16
|
"@unocss/eslint-plugin": "^0.58.0",
|
|
17
|
-
bumpp: "^9.2.
|
|
18
|
-
eslint: "^8.
|
|
17
|
+
bumpp: "^9.2.1",
|
|
18
|
+
eslint: "^8.56.0",
|
|
19
19
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
20
20
|
"eslint-plugin-format": "^0.1.0",
|
|
21
21
|
execa: "^8.0.1",
|
|
@@ -24,8 +24,8 @@ var devDependencies = {
|
|
|
24
24
|
"lint-staged": "^15.2.0",
|
|
25
25
|
"simple-git-hooks": "^2.9.0",
|
|
26
26
|
tsup: "^8.0.1",
|
|
27
|
-
typescript: "^5.3.
|
|
28
|
-
vitest: "^1.0.
|
|
27
|
+
typescript: "^5.3.3",
|
|
28
|
+
vitest: "^1.0.4",
|
|
29
29
|
vue: "^3.3.11"
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -108,16 +108,25 @@ function isGitClean() {
|
|
|
108
108
|
|
|
109
109
|
// src/cli/run.ts
|
|
110
110
|
async function run(options = {}) {
|
|
111
|
+
console.log(options);
|
|
111
112
|
const SKIP_PROMPT = !!process2.env.SKIP_PROMPT || options.yes;
|
|
112
|
-
const SKIP_GIT_CHECK = !!process2.env.SKIP_GIT_CHECK;
|
|
113
|
+
const SKIP_GIT_CHECK = !!process2.env.SKIP_GIT_CHECK || options.ignoreGit;
|
|
113
114
|
const cwd = process2.cwd();
|
|
114
115
|
const pathPackageJSON = path.join(process2.cwd(), "package.json");
|
|
115
116
|
const pathESLintConfig = path.join(process2.cwd(), "eslint.config.js");
|
|
116
117
|
const pathESLintIngore = path.join(process2.cwd(), ".eslintignore");
|
|
117
118
|
if (fs.existsSync(pathESLintConfig))
|
|
118
119
|
throwError(WARN, "eslint.config.js already exists, migration wizard exited.");
|
|
119
|
-
if (!SKIP_GIT_CHECK && !isGitClean())
|
|
120
|
-
|
|
120
|
+
if (!SKIP_GIT_CHECK && !isGitClean()) {
|
|
121
|
+
const { confirmed } = await prompts({
|
|
122
|
+
initial: false,
|
|
123
|
+
message: "There are uncommitted changes in the current repository, are you sure to continue?",
|
|
124
|
+
name: "confirmed",
|
|
125
|
+
type: "confirm"
|
|
126
|
+
});
|
|
127
|
+
if (!confirmed)
|
|
128
|
+
throwError(CROSS, "There are uncommitted changes in the current repository, please commit them and try again.");
|
|
129
|
+
}
|
|
121
130
|
console.log(`
|
|
122
131
|
${ARROW} Installing ${c3.green("@ivanmaxlogiudice/eslint-config")} to v${c3.yellow(version)}.
|
|
123
132
|
`);
|
|
@@ -254,9 +263,7 @@ ${WARN} You can now remove those dependencies: `);
|
|
|
254
263
|
var cli = cac(
|
|
255
264
|
c4.green("@ivanmaxlogiudice/eslint-config")
|
|
256
265
|
);
|
|
257
|
-
cli.command("", "Run the initialization or migration").option("-y, --yes", "Skip prompts and use default values", { type: [Boolean] }).action(run);
|
|
266
|
+
cli.command("", "Run the initialization or migration").option("-y, --yes", "Skip prompts and use default values", { type: [Boolean] }).option("-i, --ignore-git", "Skip uncommitted changes", { type: [Boolean] }).action(run);
|
|
258
267
|
cli.help();
|
|
259
268
|
cli.version(`${c4.bold(version)}`);
|
|
260
269
|
cli.parse();
|
|
261
|
-
if (!cli.matchedCommand)
|
|
262
|
-
cli.outputHelp();
|
package/dist/index.cjs
CHANGED
|
@@ -71,6 +71,7 @@ __export(src_exports, {
|
|
|
71
71
|
jsonc: () => jsonc,
|
|
72
72
|
markdown: () => markdown,
|
|
73
73
|
node: () => node,
|
|
74
|
+
parserPlain: () => parserPlain,
|
|
74
75
|
perfectionist: () => perfectionist,
|
|
75
76
|
renameRules: () => renameRules,
|
|
76
77
|
sortPackageJson: () => sortPackageJson,
|
|
@@ -133,6 +134,26 @@ async function ensurePackages(packages) {
|
|
|
133
134
|
if (result)
|
|
134
135
|
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
135
136
|
}
|
|
137
|
+
var parserPlain = {
|
|
138
|
+
meta: {
|
|
139
|
+
name: "parser-plain"
|
|
140
|
+
},
|
|
141
|
+
parseForESLint: (code) => ({
|
|
142
|
+
ast: {
|
|
143
|
+
body: [],
|
|
144
|
+
comments: [],
|
|
145
|
+
loc: { end: code.length, start: 0 },
|
|
146
|
+
range: [0, code.length],
|
|
147
|
+
tokens: [],
|
|
148
|
+
type: "Program"
|
|
149
|
+
},
|
|
150
|
+
scopeManager: null,
|
|
151
|
+
services: { isPlain: true },
|
|
152
|
+
visitorKeys: {
|
|
153
|
+
Program: []
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
};
|
|
136
157
|
|
|
137
158
|
// src/configs/comments.ts
|
|
138
159
|
async function comments() {
|
|
@@ -153,9 +174,6 @@ async function comments() {
|
|
|
153
174
|
];
|
|
154
175
|
}
|
|
155
176
|
|
|
156
|
-
// src/configs/formatters.ts
|
|
157
|
-
var parserPlain = __toESM(require("eslint-parser-plain"), 1);
|
|
158
|
-
|
|
159
177
|
// src/globs.ts
|
|
160
178
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
161
179
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
@@ -859,7 +877,6 @@ async function jsonc(options = {}) {
|
|
|
859
877
|
|
|
860
878
|
// src/configs/markdown.ts
|
|
861
879
|
var import_eslint_merge_processors = require("eslint-merge-processors");
|
|
862
|
-
var parserPlain2 = __toESM(require("eslint-parser-plain"), 1);
|
|
863
880
|
async function markdown(options = {}) {
|
|
864
881
|
const {
|
|
865
882
|
componentExts = [],
|
|
@@ -889,7 +906,7 @@ async function markdown(options = {}) {
|
|
|
889
906
|
{
|
|
890
907
|
files,
|
|
891
908
|
languageOptions: {
|
|
892
|
-
parser:
|
|
909
|
+
parser: parserPlain
|
|
893
910
|
},
|
|
894
911
|
name: "config:markdown:parser"
|
|
895
912
|
},
|
|
@@ -1107,15 +1124,11 @@ function sortPackageJson() {
|
|
|
1107
1124
|
},
|
|
1108
1125
|
{
|
|
1109
1126
|
order: { type: "asc" },
|
|
1110
|
-
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies
|
|
1111
|
-
},
|
|
1112
|
-
{
|
|
1113
|
-
order: { type: "asc" },
|
|
1114
|
-
pathPattern: "^resolutions$"
|
|
1127
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
1115
1128
|
},
|
|
1116
1129
|
{
|
|
1117
1130
|
order: { type: "asc" },
|
|
1118
|
-
pathPattern: "^pnpm.overrides$"
|
|
1131
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
1119
1132
|
},
|
|
1120
1133
|
{
|
|
1121
1134
|
order: [
|
|
@@ -1293,6 +1306,7 @@ async function test(options = {}) {
|
|
|
1293
1306
|
"node/prefer-global/process": "off",
|
|
1294
1307
|
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1295
1308
|
"test/no-identical-title": "error",
|
|
1309
|
+
"test/no-import-node-test": "error",
|
|
1296
1310
|
"test/no-only-tests": isInEditor ? "off" : "error",
|
|
1297
1311
|
"test/prefer-hooks-in-order": "error",
|
|
1298
1312
|
"test/prefer-lowercase-title": "error",
|
|
@@ -1956,6 +1970,7 @@ var src_default = config;
|
|
|
1956
1970
|
jsonc,
|
|
1957
1971
|
markdown,
|
|
1958
1972
|
node,
|
|
1973
|
+
parserPlain,
|
|
1959
1974
|
perfectionist,
|
|
1960
1975
|
renameRules,
|
|
1961
1976
|
sortPackageJson,
|
package/dist/index.d.cts
CHANGED
|
@@ -428,5 +428,30 @@ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
|
428
428
|
default: infer U;
|
|
429
429
|
} ? U : T>;
|
|
430
430
|
declare function ensurePackages(packages: string[]): Promise<void>;
|
|
431
|
+
declare const parserPlain: {
|
|
432
|
+
meta: {
|
|
433
|
+
name: string;
|
|
434
|
+
};
|
|
435
|
+
parseForESLint: (code: string) => {
|
|
436
|
+
ast: {
|
|
437
|
+
body: never[];
|
|
438
|
+
comments: never[];
|
|
439
|
+
loc: {
|
|
440
|
+
end: number;
|
|
441
|
+
start: number;
|
|
442
|
+
};
|
|
443
|
+
range: number[];
|
|
444
|
+
tokens: never[];
|
|
445
|
+
type: string;
|
|
446
|
+
};
|
|
447
|
+
scopeManager: null;
|
|
448
|
+
services: {
|
|
449
|
+
isPlain: boolean;
|
|
450
|
+
};
|
|
451
|
+
visitorKeys: {
|
|
452
|
+
Program: never[];
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
};
|
|
431
456
|
|
|
432
|
-
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NODE_MODULES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type OptionsVue, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, combine, comments, config, config as default, ensurePackages, formatters, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, typescript, unicorn, unocss, vue, yaml };
|
|
457
|
+
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NODE_MODULES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type OptionsVue, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, combine, comments, config, config as default, ensurePackages, formatters, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, typescript, unicorn, unocss, vue, yaml };
|
package/dist/index.d.ts
CHANGED
|
@@ -428,5 +428,30 @@ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
|
428
428
|
default: infer U;
|
|
429
429
|
} ? U : T>;
|
|
430
430
|
declare function ensurePackages(packages: string[]): Promise<void>;
|
|
431
|
+
declare const parserPlain: {
|
|
432
|
+
meta: {
|
|
433
|
+
name: string;
|
|
434
|
+
};
|
|
435
|
+
parseForESLint: (code: string) => {
|
|
436
|
+
ast: {
|
|
437
|
+
body: never[];
|
|
438
|
+
comments: never[];
|
|
439
|
+
loc: {
|
|
440
|
+
end: number;
|
|
441
|
+
start: number;
|
|
442
|
+
};
|
|
443
|
+
range: number[];
|
|
444
|
+
tokens: never[];
|
|
445
|
+
type: string;
|
|
446
|
+
};
|
|
447
|
+
scopeManager: null;
|
|
448
|
+
services: {
|
|
449
|
+
isPlain: boolean;
|
|
450
|
+
};
|
|
451
|
+
visitorKeys: {
|
|
452
|
+
Program: never[];
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
};
|
|
431
456
|
|
|
432
|
-
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NODE_MODULES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type OptionsVue, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, combine, comments, config, config as default, ensurePackages, formatters, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, typescript, unicorn, unocss, vue, yaml };
|
|
457
|
+
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NODE_MODULES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type OptionsVue, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, combine, comments, config, config as default, ensurePackages, formatters, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, typescript, unicorn, unocss, vue, yaml };
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,26 @@ async function ensurePackages(packages) {
|
|
|
45
45
|
if (result)
|
|
46
46
|
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
47
47
|
}
|
|
48
|
+
var parserPlain = {
|
|
49
|
+
meta: {
|
|
50
|
+
name: "parser-plain"
|
|
51
|
+
},
|
|
52
|
+
parseForESLint: (code) => ({
|
|
53
|
+
ast: {
|
|
54
|
+
body: [],
|
|
55
|
+
comments: [],
|
|
56
|
+
loc: { end: code.length, start: 0 },
|
|
57
|
+
range: [0, code.length],
|
|
58
|
+
tokens: [],
|
|
59
|
+
type: "Program"
|
|
60
|
+
},
|
|
61
|
+
scopeManager: null,
|
|
62
|
+
services: { isPlain: true },
|
|
63
|
+
visitorKeys: {
|
|
64
|
+
Program: []
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
};
|
|
48
68
|
|
|
49
69
|
// src/configs/comments.ts
|
|
50
70
|
async function comments() {
|
|
@@ -65,9 +85,6 @@ async function comments() {
|
|
|
65
85
|
];
|
|
66
86
|
}
|
|
67
87
|
|
|
68
|
-
// src/configs/formatters.ts
|
|
69
|
-
import * as parserPlain from "eslint-parser-plain";
|
|
70
|
-
|
|
71
88
|
// src/globs.ts
|
|
72
89
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
73
90
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
@@ -771,7 +788,6 @@ async function jsonc(options = {}) {
|
|
|
771
788
|
|
|
772
789
|
// src/configs/markdown.ts
|
|
773
790
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
774
|
-
import * as parserPlain2 from "eslint-parser-plain";
|
|
775
791
|
async function markdown(options = {}) {
|
|
776
792
|
const {
|
|
777
793
|
componentExts = [],
|
|
@@ -801,7 +817,7 @@ async function markdown(options = {}) {
|
|
|
801
817
|
{
|
|
802
818
|
files,
|
|
803
819
|
languageOptions: {
|
|
804
|
-
parser:
|
|
820
|
+
parser: parserPlain
|
|
805
821
|
},
|
|
806
822
|
name: "config:markdown:parser"
|
|
807
823
|
},
|
|
@@ -1019,15 +1035,11 @@ function sortPackageJson() {
|
|
|
1019
1035
|
},
|
|
1020
1036
|
{
|
|
1021
1037
|
order: { type: "asc" },
|
|
1022
|
-
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies
|
|
1023
|
-
},
|
|
1024
|
-
{
|
|
1025
|
-
order: { type: "asc" },
|
|
1026
|
-
pathPattern: "^resolutions$"
|
|
1038
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
1027
1039
|
},
|
|
1028
1040
|
{
|
|
1029
1041
|
order: { type: "asc" },
|
|
1030
|
-
pathPattern: "^pnpm.overrides$"
|
|
1042
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
1031
1043
|
},
|
|
1032
1044
|
{
|
|
1033
1045
|
order: [
|
|
@@ -1205,6 +1217,7 @@ async function test(options = {}) {
|
|
|
1205
1217
|
"node/prefer-global/process": "off",
|
|
1206
1218
|
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1207
1219
|
"test/no-identical-title": "error",
|
|
1220
|
+
"test/no-import-node-test": "error",
|
|
1208
1221
|
"test/no-only-tests": isInEditor ? "off" : "error",
|
|
1209
1222
|
"test/prefer-hooks-in-order": "error",
|
|
1210
1223
|
"test/prefer-lowercase-title": "error",
|
|
@@ -1868,6 +1881,7 @@ export {
|
|
|
1868
1881
|
jsonc,
|
|
1869
1882
|
markdown,
|
|
1870
1883
|
node,
|
|
1884
|
+
parserPlain,
|
|
1871
1885
|
perfectionist,
|
|
1872
1886
|
renameRules,
|
|
1873
1887
|
sortPackageJson,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ivanmaxlogiudice/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"packageManager": "pnpm@8.
|
|
3
|
+
"version": "1.0.16",
|
|
4
|
+
"packageManager": "pnpm@8.12.1",
|
|
5
5
|
"description": "Personal ESLint config",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"eslint-plugin-format": "^0.0.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
|
-
"eslint-plugin
|
|
41
|
+
"@unocss/eslint-plugin": {
|
|
42
42
|
"optional": true
|
|
43
43
|
},
|
|
44
|
-
"
|
|
44
|
+
"eslint-plugin-format": {
|
|
45
45
|
"optional": true
|
|
46
46
|
}
|
|
47
47
|
},
|
|
@@ -51,31 +51,30 @@
|
|
|
51
51
|
"@eslint-types/jsdoc": "46.9.0",
|
|
52
52
|
"@eslint-types/typescript-eslint": "^6.12.0",
|
|
53
53
|
"@eslint-types/unicorn": "^49.0.0",
|
|
54
|
-
"@stylistic/eslint-plugin": "^1.5.
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
56
|
-
"@typescript-eslint/parser": "^6.
|
|
54
|
+
"@stylistic/eslint-plugin": "^1.5.1",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
|
56
|
+
"@typescript-eslint/parser": "^6.14.0",
|
|
57
57
|
"cac": "^6.7.14",
|
|
58
58
|
"detect-indent": "^7.0.1",
|
|
59
59
|
"eslint-config-flat-gitignore": "^0.1.2",
|
|
60
60
|
"eslint-merge-processors": "^0.1.0",
|
|
61
|
-
"eslint-parser-plain": "^0.1.0",
|
|
62
61
|
"eslint-plugin-antfu": "^2.0.0",
|
|
63
62
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
64
63
|
"eslint-plugin-i": "^2.29.0",
|
|
65
|
-
"eslint-plugin-jsdoc": "^46.9.
|
|
66
|
-
"eslint-plugin-jsonc": "^2.
|
|
64
|
+
"eslint-plugin-jsdoc": "^46.9.1",
|
|
65
|
+
"eslint-plugin-jsonc": "^2.11.1",
|
|
67
66
|
"eslint-plugin-markdown": "^3.0.1",
|
|
68
|
-
"eslint-plugin-n": "^16.
|
|
67
|
+
"eslint-plugin-n": "^16.4.0",
|
|
69
68
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
70
69
|
"eslint-plugin-perfectionist": "^2.5.0",
|
|
71
70
|
"eslint-plugin-promise": "^6.1.1",
|
|
72
71
|
"eslint-plugin-unicorn": "^49.0.0",
|
|
73
72
|
"eslint-plugin-unused-imports": "^3.0.0",
|
|
74
|
-
"eslint-plugin-vitest": "^0.3.
|
|
73
|
+
"eslint-plugin-vitest": "^0.3.17",
|
|
75
74
|
"eslint-plugin-vue": "^9.19.2",
|
|
76
|
-
"eslint-plugin-yml": "^1.
|
|
75
|
+
"eslint-plugin-yml": "^1.11.0",
|
|
77
76
|
"eslint-processor-vue-blocks": "^0.1.1",
|
|
78
|
-
"globals": "^13.
|
|
77
|
+
"globals": "^13.24.0",
|
|
79
78
|
"jsonc-eslint-parser": "^2.4.0",
|
|
80
79
|
"local-pkg": "^0.5.0",
|
|
81
80
|
"parse-gitignore": "^2.0.0",
|
|
@@ -85,14 +84,14 @@
|
|
|
85
84
|
"yaml-eslint-parser": "^1.2.2"
|
|
86
85
|
},
|
|
87
86
|
"devDependencies": {
|
|
88
|
-
"@stylistic/eslint-plugin-migrate": "^1.5.
|
|
89
|
-
"@types/eslint": "^8.44.
|
|
87
|
+
"@stylistic/eslint-plugin-migrate": "^1.5.1",
|
|
88
|
+
"@types/eslint": "^8.44.9",
|
|
90
89
|
"@types/fs-extra": "^11.0.4",
|
|
91
|
-
"@types/node": "^20.10.
|
|
90
|
+
"@types/node": "^20.10.4",
|
|
92
91
|
"@types/prompts": "^2.4.9",
|
|
93
92
|
"@unocss/eslint-plugin": "^0.58.0",
|
|
94
|
-
"bumpp": "^9.2.
|
|
95
|
-
"eslint": "^8.
|
|
93
|
+
"bumpp": "^9.2.1",
|
|
94
|
+
"eslint": "^8.56.0",
|
|
96
95
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
97
96
|
"eslint-plugin-format": "^0.1.0",
|
|
98
97
|
"execa": "^8.0.1",
|
|
@@ -101,8 +100,8 @@
|
|
|
101
100
|
"lint-staged": "^15.2.0",
|
|
102
101
|
"simple-git-hooks": "^2.9.0",
|
|
103
102
|
"tsup": "^8.0.1",
|
|
104
|
-
"typescript": "^5.3.
|
|
105
|
-
"vitest": "^1.0.
|
|
103
|
+
"typescript": "^5.3.3",
|
|
104
|
+
"vitest": "^1.0.4",
|
|
106
105
|
"vue": "^3.3.11"
|
|
107
106
|
},
|
|
108
107
|
"engines": {
|