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

can't get plugin rules by CLIEngine#getRules #11871

Closed
fisker opened this issue Jun 22, 2019 · 3 comments · Fixed by #11872 or GrabarzUndPartner/gp-vue-boilerplate#206 · May be fixed by ajesse11x/marketplace#1, rubarb666/rails#3 or rubarb666/git-sketch-plugin#2
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features regression Something broke

Comments

@fisker
Copy link
Contributor

fisker commented Jun 22, 2019

Tell us about your environment

  • ESLint Version:
    6.0.0

cli.getRules().get(ruleId) used can get plugin rule, now not.

Is this by design or a bug?

new (require('eslint').CLIEngine)().getRules().has('yoda')
// -> true
new (require('eslint').CLIEngine)({plugins: ['unicorn']}).getRules().has('unicorn/no-process-exit')
// -> false, should be true
@fisker fisker added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Jun 22, 2019
@fisker
Copy link
Contributor Author

fisker commented Jun 22, 2019

After a few tries, I found after calling executeOnText or executeOnFiles, rules appeared, but calling getConfigForFile (which is I used before and works in #10838 ) plugin rules are not loaded.

@mysticatea mysticatea added accepted There is consensus among the team that this change meets the criteria for inclusion core Relates to ESLint's core APIs and features and removed triage An ESLint team member will look at this issue soon labels Jun 22, 2019
@mysticatea
Copy link
Member

Thank you for your report.

Sounds like a bug.

@mysticatea
Copy link
Member

mysticatea commented Jun 22, 2019

Yes, currently, it returns core rules and the plugin rules that the last execute* method call used.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features regression Something broke
Projects
None yet
2 participants