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 · May be fixed by ajesse11x/marketplace#1, rubarb666/rails#3 or rubarb666/git-sketch-plugin#2
Closed

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

fisker opened this issue Jun 22, 2019 · 3 comments · May be fixed by ajesse11x/marketplace#1, rubarb666/rails#3 or rubarb666/git-sketch-plugin#2

Comments

@fisker
Copy link
Contributor

@fisker 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
Copy link
Contributor Author

@fisker 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.

Loading

@mysticatea
Copy link
Member

@mysticatea mysticatea commented Jun 22, 2019

Thank you for your report.

Sounds like a bug.

Loading

@mysticatea
Copy link
Member

@mysticatea mysticatea commented Jun 22, 2019

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

Loading

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