Run checks before commit (lint-staged husky)

$ npm install --save-dev lint-staged husky


package.json

"lint-staged": {
  "*.{js, jsx}": ["node_modules/.bin/eslint --max-warnings=0", "prettier --write", "git add"]
}


.huskyrc.json

{
  "hooks": {
    "pre-commit": "lint-staged",
    "pre-push": "npm run test"
  }
}