@antfu/eslint-config 5.2.2 → 5.4.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/dist/cli.js +10 -13
- package/dist/index.d.ts +336 -220
- package/dist/index.js +5 -9
- package/package.json +21 -21
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ import parse from "parse-gitignore";
|
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "5.
|
|
12
|
+
var version = "5.4.0";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/cli/constants.ts
|
|
@@ -144,15 +144,13 @@ async function updateEslintFiles(result) {
|
|
|
144
144
|
const pathESLintIgnore = path.join(cwd, ".eslintignore");
|
|
145
145
|
const pathPackageJSON = path.join(cwd, "package.json");
|
|
146
146
|
const pkgContent = await fsp.readFile(pathPackageJSON, "utf-8");
|
|
147
|
-
const
|
|
148
|
-
const configFileName = pkg.type === "module" ? "eslint.config.js" : "eslint.config.mjs";
|
|
147
|
+
const configFileName = JSON.parse(pkgContent).type === "module" ? "eslint.config.js" : "eslint.config.mjs";
|
|
149
148
|
const pathFlatConfig = path.join(cwd, configFileName);
|
|
150
149
|
const eslintIgnores = [];
|
|
151
150
|
if (fs.existsSync(pathESLintIgnore)) {
|
|
152
151
|
p.log.step(c.cyan`Migrating existing .eslintignore`);
|
|
153
152
|
const content = await fsp.readFile(pathESLintIgnore, "utf-8");
|
|
154
|
-
const
|
|
155
|
-
const globs = parsed.globs();
|
|
153
|
+
const globs = parse(content).globs();
|
|
156
154
|
for (const glob of globs) if (glob.type === "ignore") eslintIgnores.push(...glob.patterns);
|
|
157
155
|
else if (glob.type === "unignore") eslintIgnores.push(...glob.patterns.map((pattern) => `!${pattern}`));
|
|
158
156
|
}
|
|
@@ -162,8 +160,7 @@ async function updateEslintFiles(result) {
|
|
|
162
160
|
if (result.extra.includes("unocss")) configLines.push(`unocss: true,`);
|
|
163
161
|
for (const framework of result.frameworks) configLines.push(`${framework}: true,`);
|
|
164
162
|
const mainConfig = configLines.map((i) => ` ${i}`).join("\n");
|
|
165
|
-
const
|
|
166
|
-
const eslintConfigContent = getEslintConfigContent(mainConfig, additionalConfig);
|
|
163
|
+
const eslintConfigContent = getEslintConfigContent(mainConfig, []);
|
|
167
164
|
await fsp.writeFile(pathFlatConfig, eslintConfigContent);
|
|
168
165
|
p.log.success(c.green`Created ${configFileName}`);
|
|
169
166
|
const files = fs.readdirSync(cwd);
|
|
@@ -177,20 +174,20 @@ async function updateEslintFiles(result) {
|
|
|
177
174
|
//#endregion
|
|
178
175
|
//#region src/cli/constants-generated.ts
|
|
179
176
|
const versionsMap = {
|
|
180
|
-
"@eslint-react/eslint-plugin": "^1.53.
|
|
181
|
-
"@next/eslint-plugin-next": "^15.5.
|
|
182
|
-
"@unocss/eslint-plugin": "^66.5.
|
|
177
|
+
"@eslint-react/eslint-plugin": "^1.53.1",
|
|
178
|
+
"@next/eslint-plugin-next": "^15.5.3",
|
|
179
|
+
"@unocss/eslint-plugin": "^66.5.1",
|
|
183
180
|
"astro-eslint-parser": "^1.2.2",
|
|
184
|
-
"eslint": "^9.
|
|
181
|
+
"eslint": "^9.36.0",
|
|
185
182
|
"eslint-plugin-astro": "^1.3.1",
|
|
186
183
|
"eslint-plugin-format": "^1.0.1",
|
|
187
184
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
188
185
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
189
186
|
"eslint-plugin-solid": "^0.14.5",
|
|
190
|
-
"eslint-plugin-svelte": "^3.12.
|
|
187
|
+
"eslint-plugin-svelte": "^3.12.3",
|
|
191
188
|
"prettier-plugin-astro": "^0.14.1",
|
|
192
189
|
"prettier-plugin-slidev": "^1.0.5",
|
|
193
|
-
"svelte-eslint-parser": "^1.3.
|
|
190
|
+
"svelte-eslint-parser": "^1.3.2"
|
|
194
191
|
};
|
|
195
192
|
|
|
196
193
|
//#endregion
|