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

Breaking: support @scope shorthand in plugins (fixes #9903) #9905

merged 2 commits into from Mar 30, 2018


4 participants

mysticatea commented Jan 28, 2018

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[X] Add something to the core
[ ] Other, please explain:

Fixes #9903.

What changes did you make? (Give an overview)

This is a reference implementation for #9903.
This PR changes the logic to normalize plugin names as same as shareable config's.
As the result, we can use plugins: ["@scope"] shorthand for @scope/eslint-plugin package.

Is there anything you'd like reviewers to focus on?

Nothing in particular.


Left one comment.

Also: Since we have accepted this as a breaking change, could you please change the commit message tag to "Breaking:"? Thanks!

function getShorthandName(fullname, prefix) {
if (fullname[0] === "@") {
let m = new RegExp(`^(@[^/]+)/${prefix}$`).exec(fullname);

This comment has been minimized.


platinumazure Mar 22, 2018


Could we use a more descriptive variable name here?

@mysticatea mysticatea changed the title from Update: support @scope shorthand in plugins (fixes #9903) to Breaking: support @scope shorthand in plugins (fixes #9903) Mar 30, 2018

mysticatea added some commits Jan 28, 2018


This comment has been minimized.


mysticatea commented Mar 30, 2018

Thank you for the review and I'm sorry for my delay.

I updated this PR.


LGTM, thanks!

Comments have been addressed

@not-an-aardvark not-an-aardvark merged commit d440e84 into master Mar 30, 2018

5 checks passed

commit-message PR title follows commit message guidelines
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
licence/cla Contributor License Agreement is signed.
release-monitor No patch release is pending

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

@not-an-aardvark not-an-aardvark deleted the scoped-plugin-shorthand branch 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.