eslint-interactive icon indicating copy to clipboard operation
eslint-interactive copied to clipboard

Add option to restart `eslint-interactive` from the CLI

Open Ilanaya opened this issue 8 months ago • 6 comments

The Problem:

When working with eslint-interactive I always do the same steps:

  1. Run eslint-interactive
  2. Select some rules to work with
  3. Usually print them in terminal and fix one by one in my editor
  4. Stop the eslint-interactive process manually (CTRL + C)
  5. Run the eslint-intractive again to check if I missed something
  6. 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

Image

Ilanaya avatar Apr 09 '25 15:04 Ilanaya

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.

mizdra avatar Apr 10 '25 01:04 mizdra

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:

Image

What I usually do is printing results in terminal and fix them one by one:

  1. Open terminal, CTRL + click on the file with the error
  2. Fix it
  3. 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.

Ilanaya avatar Apr 10 '25 13:04 Ilanaya

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:

Image

Something like Update lint results (re-runs eslint) or similar?

Ilanaya avatar Apr 14 '25 17:04 Ilanaya

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.

mizdra avatar Apr 21 '25 11:04 mizdra

Maybe add option Re-lint selected rules also?

Alex-Sokolov avatar Sep 18 '25 08:09 Alex-Sokolov

Maybe add option Re-lint selected rules also?

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

Ilanaya avatar Sep 19 '25 11:09 Ilanaya