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

Comments

Projects
2 participants
@fisker
Copy link

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 triage labels Jun 22, 2019

@fisker

This comment has been minimized.

Copy link
Author

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 core and removed triage labels Jun 22, 2019

@mysticatea

This comment has been minimized.

Copy link
Member

commented Jun 22, 2019

Thank you for your report.

Sounds like a bug.

@mysticatea

This comment has been minimized.

Copy link
Member

commented Jun 22, 2019

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

mysticatea added a commit that referenced this issue Jun 22, 2019

@mysticatea mysticatea added this to Implemented, pending review in v6.0.0 Jun 22, 2019

v6.0.0 automation moved this from Implemented, pending review to Done Jun 23, 2019

mysticatea added a commit that referenced this issue Jun 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.