Closed FedeLochbaum closed 5 years ago
I think doing eslint some.files --fix
and then git add .
is a terrible practice to add as a precommit hook. For the following reasons
I think doing
eslint some.files --fix
and thengit add .
is a terrible practice to add as a precommit hook. For the following reasons* First, run eslint some.file --fix doesn't secure you that it fixed every existing eslint error, so we can't trust that we are committing free linter errors changes. * Second, mix 'normal' changes with eslint fixing changes in a single commit is not ok for me because what happen if we want to roll back the 'normal' changes but we want to keep the eslint fixes, we will not be able to do that. * Lastly, I think we should add some precommit hook, but it doesn't have to do a lot of stuff, it could be something simple like showing linter errors.
Ok! feel free to make the changes
assertTransformer.js
The pre-commit does:
eslint src/ --fix
git add .
jest --findRelatedTests