Ensure prettier is performed by eslint pre-commit
Basically a number of issues were happening conflating what was happening:
-
README.mdsaying to only install thecommit-msghook when we need thepre-commitone too - The
commit-msghook was passing the commit message filename to theprettierpre-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-commitstage
- The
commit-msghook was passing the commit message filename to theeslinttasks which ignored it as not a matching file- so again this hook is now told to use the
pre-commitstage
- so again this hook is now told to use the
- The
eslinthook was only linting files in./srcso missing cypress files- but adding in cypress causes a load of failures so ignoring that for this MR
- The
eslinthook 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