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

Comments

Projects
2 participants
@mysticatea
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 self-assigned this Jan 28, 2018

mysticatea added a commit that referenced this issue Jan 28, 2018

@mysticatea

This comment has been minimized.

Member

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

This comment has been minimized.

Member

not-an-aardvark commented Feb 1, 2018

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

This comment has been minimized.

Member

mysticatea commented Feb 1, 2018

@not-an-aardvark

This comment has been minimized.

Member

not-an-aardvark commented Feb 23, 2018

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

@not-an-aardvark not-an-aardvark added breaking and removed tsc agenda labels Feb 23, 2018

@mysticatea mysticatea added this to Ready to merge in v5.0.0 Mar 30, 2018

mysticatea added a commit that referenced this issue Mar 30, 2018

v5.0.0 automation moved this from Ready to merge to Done Mar 30, 2018

not-an-aardvark added a commit that referenced this issue Mar 30, 2018

@eslint eslint bot locked and limited conversation to collaborators Sep 27, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.