Skip to content

Commit

Permalink
fix: add warning message for ESLint v9 compatibility with npm --force…
Browse files Browse the repository at this point in the history
… flag

fixes #125

Signed-off-by: 唯然 <weiran.zsd@outlook.com>
  • Loading branch information
aladdin-add committed Jun 18, 2024
1 parent 6a1d4f2 commit 5959e7c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/config-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,14 @@ export default [\n${exportContent}];`;
} else {
log.info(`Successfully created ${configPath} file.`);
}

if (packageManager === "npm" && this.result.installFlags.includes("--force")) {
const pkg = JSON.parse(await path.readFile(this.packageJsonPath, "utf8"));

log.warn("Note some plugins currently do not support ESLint v9 yet.\nYou will need to use '--force' when installing, or add the following to your package.json:\n");
log.warn(`"overrides": {"eslint": "${pkg.devDependencies.eslint}"}`);
}

} else {
await writeFile(configPath, this.result.configContent);

Expand Down

0 comments on commit 5959e7c

Please sign in to comment.