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 added by cli.addPlugin
#12425
Can't get plugin rules added by cli.addPlugin
#12425
Comments
Maybe related to #11871 |
Thank you for your report. That's expected because On the other hand, it looks like a bug because const { CLIEngine } = require('eslint')
const engine = new CLIEngine({ plugins: ["foo"] })
engine.addPlugin('foo', require('eslint-plugin-unicorn'))
console.log(engine.getRules().has('foo/no-process-exit')) was false. I expected true in this case. |
As a side note, I'm proposing to remove |
The reason I check this, is because I want run plugin against plugin source, so I add cli to do this https://github.com/sindresorhus/eslint-plugin-unicorn/blob/d638e5477d7240ea777dcaf249d0121a5a1910eb/test/lint/lint.js#L11-L25 , I want make sure the plugin is loaded, but get a false result. According to the comments above, I'm not doing it right. I should point |
In that case, you can use The Because, internally, the configuration object stores the loaded plugins that the config used. ESLint doesn't load plugins until configurations are determined and configurations are not determined until target files are determined. #11871 has updated The |
I remember I tried call this after |
Tested
|
|
Sorry, I miss understood it, my purpose is avoid use Thanks a lot for explaining |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
I can't get the plugin rules, Is this by design or a bug?
quick reproduction
The text was updated successfully, but these errors were encountered: