IanVS / eslint-nibble

Ease into ESLint, by fixing one rule at a time
MIT License
787 stars 29 forks source link

Add `--fix` flag to combine with `--no-interactive` #74

Closed nordringrayhide closed 3 years ago

nordringrayhide commented 4 years ago

yarn eslint-nibble --rule quotes --no-interactive --fix .

Invalid option '--fix' - perhaps you meant '-f'?
IanVS commented 4 years ago

Sorry, that's not one of the eslint-nibble flags. What use-case do you have for this? You just want to fix a single rule without the interactive chooser?

nordringrayhide commented 4 years ago

Exactly. If it can be done in interactive mode I'd be great to have it in non-interactive one as well. For instance in Ruby linter tool RuboCop can do that from the box()

rubocop app/controllers/users_controller.rb --only Layout/ExtraSpacing --auto-correct

so I'm looking the same functionality tool for js part

IanVS commented 4 years ago

Hmmm, I'll need to think about it. The original goal of --no-interactive was simply to enable use in CI, but your case makes sense too. In fact, eslint-nibble uses https://github.com/IanVS/eslint-filtered-fix under the hood, and I think it could meet your needs nicely. Maybe try it out and let me know what you think?

bdefore commented 4 years ago

would also like to see this. interactive mode is particularly challenging on a large project where if there is more than one page worth of rule options, it will redraw for each cursor movement.

IanVS commented 4 years ago

Have you tried using https://github.com/IanVS/eslint-filtered-fix for this, @bdefore?

bdefore commented 4 years ago

i have not yet

IanVS commented 4 years ago

I'd suggest trying it out, I think it will meet your needs nicely.

bdefore commented 4 years ago

indeed it does. thanks for your work on these libraries.