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

Proposal: support @scope for @scope/eslint-plugin #9903

Closed
mysticatea opened this issue Jan 28, 2018 · 4 comments · Fixed by #9905
Closed

Proposal: support @scope for @scope/eslint-plugin #9903

mysticatea opened this issue Jan 28, 2018 · 4 comments · Fixed by #9905
Assignees
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion breaking This change is backwards-incompatible core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects

Comments

@mysticatea
Copy link
Member

mysticatea commented Jan 28, 2018

Tell us about your environment

  • ESLint Version: v4.16.0
  • Node Version: v9.2.0
  • npm Version: v5.6.0

What parser (default, Babel-ESLint, etc.) are you using?

  • default

Please show your full configuration:

Configuration
module.exports = {
  plugins: [
    '@scope'
  ],
  rules: {
    '@scope/rule': 'error'
  }
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

I run ESLint.

What did you expect to happen?

ESLint loads @scope/eslint-plugin.

What actually happened? Please include the actual, raw output from ESLint.

ESLint failed to load eslint-plugin-@scope.

Oops! Something went wrong! :(

ESLint: 4.16.0.
ESLint couldn't find the plugin "eslint-plugin-@scope". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-@scope is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm i eslint-plugin-@scope@latest --save-dev

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

ESLint supports @scope for @scope/eslint-config since #3123, but doesn't support @scope for @scope/eslint-plugin.
It looks inconsistent.

I propose the feature, ESLint resolves plugins: ["@scope"] to @scope/eslint-plugin.

@mysticatea mysticatea added enhancement This change enhances an existing feature of ESLint core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jan 28, 2018
@mysticatea mysticatea self-assigned this Jan 28, 2018
@mysticatea mysticatea added the tsc agenda This issue will be discussed by ESLint's TSC at the next meeting label Jan 30, 2018
@mysticatea
Copy link
Member Author

mysticatea commented Jan 30, 2018

I add this to tsc-agenda since this is an enhancement to core functionality.

TSC Summary: ESLint resolves @scope inconsistently:

  • extends: ["@scope"]@scope/eslint-config
  • plugins: ["@scope"]eslint-plugin-@scope

Because we have received the request "@scope@scope/eslint-config" in #3123 but never received the request "@scope@scope/eslint-plugin".
So I propose the feature that ESLint resolves "plugins: ["@scope"] to @scope/eslint-plugin" for consistency.

TSC Question: Should we accept this feature?

@not-an-aardvark
Copy link
Member

What happens if @foo/eslint-plugin and eslint-plugin-@foo both exist?

plugins:
  - @foo
  - eslint-plugin-@foo
rules:
  @foo/bar: error

It seems like @foo/eslint-plugin and eslint-plugin-@foo would both be able to create rules under the @foo namespace.

@mysticatea
Copy link
Member Author

mysticatea commented Feb 1, 2018 via email

@not-an-aardvark
Copy link
Member

In last week's TSC meeting, the TSC decided to accept this as a breaking change.

@not-an-aardvark not-an-aardvark added breaking This change is backwards-incompatible and removed tsc agenda This issue will be discussed by ESLint's TSC at the next meeting labels Feb 23, 2018
@mysticatea mysticatea added this to Ready to merge in v5.0.0 Mar 30, 2018
v5.0.0 automation moved this from Ready to merge to Done Mar 30, 2018
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 27, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Sep 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion breaking This change is backwards-incompatible core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
No open projects
v5.0.0
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants