Ensure prettier is performed by eslint pre-commit
Basically a number of issues were happening conflating what was happening:
-
README.md
saying to only install thecommit-msg
hook when we need thepre-commit
one too - The
commit-msg
hook was passing the commit message filename to theprettier
pre-commit tasks (- this task is intended for file that aren't typescript, json, yaml, etc (probably little left)
- so this is now told to use the
pre-commit
stage
- The
commit-msg
hook was passing the commit message filename to theeslint
tasks which ignored it as not a matching file- so again this hook is now told to use the
pre-commit
stage
- so again this hook is now told to use the
- The
eslint
hook was only linting files in./src
so missing cypress files- but adding in cypress causes a load of failures so ignoring that for this MR
- The
eslint
hook wasn't actually running prettier- so added the prettier plugin
So everyone that has only installed the commit-msg
hook should add the pre-commit
one too.
It probably needs another commit with some changes to double-check this is all working. But I've tested some bad formatting of TSX and the pre-commit prevents me commit it.
Edited by Robin Goodall