Skip to content

Instantly share code, notes, and snippets.

@LordKayBanks
Last active July 9, 2020 10:49
Show Gist options
  • Save LordKayBanks/81aa796a05f1b9dafb5d5a7bf30e076c to your computer and use it in GitHub Desktop.
Save LordKayBanks/81aa796a05f1b9dafb5d5a7bf30e076c to your computer and use it in GitHub Desktop.
NPM git pre-commit hook
"scripts": {
"start:local": "react-scripts start --no-cache",
"start": "source dev.env && react-scripts start --no-cache",
"build": "react-scripts build",
"test": "react-scripts test --no-cache",
"eject": "react-scripts eject",
"prettier:fix": "prettier --write --no-config src/**/*.{js,ts,css.scss,json}",
"precommit": "lint-staged"
},
"lint-staged": {
"*.{js,ts,css.scss,json}": [
"prettier --write --no-config src/**/*.{js,ts,css.scss,json}",
"git add"
]
},
"devDependencies": {
"husky": "^3.0.1",
"lint-staged": "^4.2.3",
"prettier": "^1.18.2"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment