Resolve other plugins as siblings to this plugin#342
Resolve other plugins as siblings to this plugin#342ota-meshi merged 2 commits intoota-meshi:masterfrom
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! |
ota-meshi
left a comment
There was a problem hiding this comment.
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-jsoncsince this plugin keeps trying to load plugins relative to the root of the monorepo, rather than theresolvePluginsRelativeTothat I passed to my central linter.This PR should modify the behavior of
eslint-plugin-jsoncto always resolve plugins relative to itself.P.S. I cannot upgrade to ESLint v9 yet because
nxandeslint-plugin-reactdoes not support ESLint v9 yet.