Open chiefmikey opened 2 years ago
New flow:
Read eslint config
Pull plugin rules with disable-autofix/
and remove prefix
Read node modules eslint plugins
Match plugins to pulled config plugins and import
Disable as usual
This would be a great improvement, it's a good idea
At the moment, I can't use the plugin on my monorepo, because it's using Yarn workspaces, with all the plugins from all the different eslint setups hoisted to the root. So, when the plugin reads node_modules/, it sees all the plugins I haven't got configured on this particular .eslintrc.cjs
, and tries to load them. But then those fail to load because they require non-optional configuration.
@dominics thanks for the feedback, that's a great use case to consider. This update should solve that issue and I will circle back with you after it's released to make sure.
Pull rules from config Find ones prefixed with 'disable-autofix' If plugin scope exists, extract name and import etc. If no plugin scope, assume builtin and import etc. This solution should at least minimize packages being imported to just the ones with rules being disabled vs doing a full dir search.
Not sure about lazy loading to the rule level and pulling individual rule objects off packages without importing the entire thing.