Skip to content
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

New: Add a flag to specify the folder where plugins are resolved from #18

Merged
merged 2 commits into from
Apr 11, 2019

Conversation

not-an-aardvark
Copy link
Member

Summary

With the 2018-simplified-package-loading RFC implemented, ESLint always resolves plugins relative to the current working directory. The CWD works well for the most common use case, but is inconvenient for certain integrations. This RFC proposes adding a CLI flag to specify an alternative place where plugins should be resolved from.

Related Issues

@not-an-aardvark not-an-aardvark added feature Initial Commenting This RFC is in the initial feedback stage labels Mar 13, 2019
@platinumazure
Copy link
Member

Question: Does this definitely need a CLI flag, or could we just add a property to the CLIEngine constructor? (Put another way, is there an integration is invoking ESLint using our CLI, so having a flag there would be beneficial for that integration?)

@not-an-aardvark
Copy link
Member Author

not-an-aardvark commented Mar 13, 2019

I know that there are integrations that invoke ESLint using our CLI, based on feature requests related to exit codes that we've received in the past. I don't have specific examples of integrations that use the CLI and would also need this option, but it seems likely that they exist based on how many users we have. I'm inclined to to have us support the same options in the CLI as we do in CLIEngine, except when there are compelling reasons not to do so (e.g. when CLIEngine accepts function arguments).

@not-an-aardvark
Copy link
Member Author

When working on eslint/eslint#11515, I realized that this flag would also be useful for users who currently run global installations of ESLint with an external config file, since it would prevent them from needing to install any plugins locally when their projects don't have anything else related to ESLint installed locally. So I think we should have a CLI flag in addition to a CLIEngine option.

While this isn't a breaking change (so it has no hard deadline), I think it would be nice if this is ready around the same time as ESLint v6 to minimize migration issues for integrations/global installation users.

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'm convinced. This LGTM at this point. Thanks!

@not-an-aardvark
Copy link
Member Author

@eslint/eslint-tsc This has been open for 21 days with no objections, so I'm moving it to the final comment period.

@not-an-aardvark not-an-aardvark added Final Commenting This RFC is in the final week of commenting and removed Initial Commenting This RFC is in the initial feedback stage labels Apr 4, 2019
@not-an-aardvark not-an-aardvark merged commit f2d3eff into master Apr 11, 2019
@not-an-aardvark not-an-aardvark deleted the plugin-root-path-flag branch April 11, 2019 19:59
@not-an-aardvark
Copy link
Member Author

If my counting is right:

  • 3 TSC members have approved (or created) this proposal.
  • 3 of the remaining TSC members have "supports consensus" status
  • The remaining 2 members haven't commented

So this RFC has majority support and is now accepted.

not-an-aardvark added a commit to eslint/eslint that referenced this pull request May 10, 2019
With the [2018-simplified-package-loading RFC](https://github.com/eslint/rfcs/blob/8bc0b80e0b3e54d10991a4774c41f7375dfcbbfe/designs/2018-simplified-package-loading/README.md) implemented, ESLint always resolves plugins relative to the current working directory. The CWD works well for the most common use case, but is inconvenient for certain integrations. This commit proposes adding a CLI flag to specify an alternative place where plugins should be resolved from.

(Implements eslint/rfcs#18)
not-an-aardvark added a commit to eslint/eslint that referenced this pull request May 11, 2019
With the [2018-simplified-package-loading RFC](https://github.com/eslint/rfcs/blob/8bc0b80e0b3e54d10991a4774c41f7375dfcbbfe/designs/2018-simplified-package-loading/README.md) implemented, ESLint always resolves plugins relative to the current working directory. The CWD works well for the most common use case, but is inconvenient for certain integrations. This commit proposes adding a CLI flag to specify an alternative place where plugins should be resolved from.

(Implements eslint/rfcs#18)
@mysticatea mysticatea added the implemented This RFC has been implemented label Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Final Commenting This RFC is in the final week of commenting implemented This RFC has been implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants