QuiiBz / sherif

Opinionated, zero-config linter for JavaScript monorepos
MIT License
607 stars 10 forks source link

Add a non-interactive version for --fix #68

Open thomasfr opened 1 week ago

thomasfr commented 1 week ago

In order to run sherif in pre-commit hooks for example, it would be necessary to be able to run sherif --fix in non-interactive mode. For instance by specifying which version it should change it to (e.g --highest, --lowest, --in-between) together with --fix it should run in non-interactive mode and not ask for any inputs, just fix it.

QuiiBz commented 1 week ago

Auto-fixing the dependencies would require to refresh the lockfile, which the user might forgot to do if Sherif was run automatically via a pre-commit hook (unless we do https://github.com/QuiiBz/sherif/issues/38#issuecomment-2198020817).

thomasfr commented 1 week ago

That’s true, you are right. Haven’t thought about that. Well I guess then --fix should implicitly also call --install automatically.