Add option to restart `eslint-interactive` from the CLI
The Problem:
When working with eslint-interactive I always do the same steps:
- Run
eslint-interactive - Select some rules to work with
- Usually print them in terminal and fix one by one in my editor
- Stop the
eslint-interactiveprocess manually (CTRL + C) - Run the
eslint-intractiveagain to check if I missed something - Go to step 2
Steps 4 and 5 are very annoying as I need to manually stop and restart the process. I really wish an option in the menu to restart the whole linting process from the CLI
Why do you want to restart? I want to know more about the problem you want to solve. In some cases, there may be a better solution than restarting.
Why do you want to restart? I want to know more about the problem you want to solve. In some cases, there may be a better solution than restarting.
Because I want to see the updated list of the errors after I fix some of them. E.g. I'm working on introducing new eslint rule for the project, which can't be autofixed (or it just not worth to make forcibly fixable). For example:
What I usually do is printing results in terminal and fix them one by one:
- Open terminal, CTRL + click on the file with the error
- Fix it
- Return back to the terminal and select next file with error
After some time, I usually find that I've missed some files or places where I needed to fix something, or I just want to see the count of the remaining errors.
Suddenly I found that you already have an option to re-run eslint (e.g. after running eslint --fix)!
What do you think about adding this option to a more screens? E.g. here:
Something like Update lint results (re-runs eslint) or similar?
Yes, eslint-interactive has a built-in re-linting feature. Re-linting is executed when the question What's the next step? is answered with Fix other rules. That is, when you have finished fixing the first rule and are ready to move on to fixing the second rule.
What do you think about adding this option to a more screens? E.g. here:
That sounds good. I think we should add the option Re-lint and reselect rules.
Maybe add option Re-lint selected rules also?
Maybe add option
Re-lint selected rulesalso?
@Alex-Sokolov, This should be possible with proper usage of the --rule option, but it also requires passing --no-config-lookup. I dunno if disabling config lookup would work as expected - some rules may need to be applied to specific directories only, which is configured on the config level. Simply running the rule against the whole codebase will produce lots of false positive errors in some cases.
Anyways, this is definitely a separate feature request.