-
Hello there 👋 I'm using yarn v3.1.1 with PnP enabled. I have a monorepository architecture: // package.json
{
// ...
"devDependencies": {
"eslint": "^8.5.0",
"eslint-config-convergence-json": "workspace:^",
},
"workspaces": [
"packages/eslint-config-convergence-json",
],
} Notice how the root package is dependent on the In my root ESLint config, I extend from the config exposed by the // .eslintrc.json
{
// ...
"overrides": [
{
"extends": ["convergence-json"], // Note: ESLint automatically adds the `eslint-config-` prefix.
"files": "*.json"
}
]
} The // packages/eslint-config-json/package.json
{
// ...
"dependencies": {
"eslint-plugin-jsonc": "^2.0.0"
},
"main": "index.js",
"peerDependencies": {
"eslint": *,
} It exposes an ESLint config that one can extend from: // packages/eslint-config-json/index.js
module.exports = {
// ...
plugins: ["jsonc"],
}; Running the command (from the root): yarn eslint any-json-file.json Gives me the following error: Oops! Something went wrong! :(
ESLint: 8.5.0
ESLint couldn't find the plugin "eslint-plugin-jsonc".
(The package "eslint-plugin-jsonc" was not found when loaded as a Node module from the directory "/Users/blackjelly/code/resume-studio/eslint-config-convergence".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm install eslint-plugin-jsonc@latest --save-dev
The plugin "eslint-plugin-jsonc" was referenced from the config file in ".eslintrc.json#overrides[0] » eslint-config-convergence-json". My guess is that, because Note that adding Any workaround apart from switching |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The way ESLint requires plugins is a bit special... |
Beta Was this translation helpful? Give feedback.
The way ESLint requires plugins is a bit special...
Have you tried https://yarnpkg.com/package/@rushstack/eslint-patch?