-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve other plugins as siblings to this plugin #342
Conversation
🦋 Changeset detectedLatest commit: b6a1cb4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@ota-meshi Whenever you get a chance, could you please take a look at this PR? Thank you! |
Hmm. I'm not sure if this PR change will work in anyone's environment. |
@ota-meshi My thinking is this: two scenarios: Scenario One: with In this scenario, the folder structure is as follows:
Eslint is executed on the CLI using:
We want to resolve the Scenario One: WITHOUT In this scenario, which is how most people use eslint, the folder structure is as follows:
Eslint is executed on the CLI using:
From Therefore, I believe this PR should work in both scenarios. |
Thank you for the explanation! I think that explanation makes sense! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for your contribution!
Why do I want this?
I have a monorepo with the current file structure:
I want to install eslint and all of its configs and plugins into the repotools/central-linter/node_modules. I do not want to install a separate copy of eslint and its plugins in each app/package. Also note that there is no package.json file at the root of the repo because I have lots of issues with npm workspaces.
I also want to keep the .eslintrc.json and .eslintignore files at the root of the monorepo for better IDE integration.
I am able to accomplish all of this except for this
eslint-plugin-jsonc
since this plugin keeps trying to load plugins relative to the root of the monorepo, rather than theresolvePluginsRelativeTo
that I passed to my central linter.This PR should modify the behavior of
eslint-plugin-jsonc
to always resolve plugins relative to itself.P.S. I cannot upgrade to ESLint v9 yet because
nx
andeslint-plugin-react
does not support ESLint v9 yet.