Based on the solution created by luuuis,
I added two npm scripts lint-css-staged
and lint-js-staged
. They both lint (with ESLint and stylelint)
only staged files.
You could also use pre-commit.sh
from luuuis,
if you do not want to put this into your package.json.
Prettier provides an example as well.
MIT