Skip to content

Instantly share code, notes, and snippets.

@rhythm-sharma
Last active March 29, 2021 12:36
Show Gist options
  • Save rhythm-sharma/208a0c80df3833f1057bd5731cbdc0e6 to your computer and use it in GitHub Desktop.
Save rhythm-sharma/208a0c80df3833f1057bd5731cbdc0e6 to your computer and use it in GitHub Desktop.
Pre-commit hook with husky and lint-staged
...
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,tsx,json,md,css,scss}": [
"prettier --write",
"git add -A .",
],
"src/**/*.{js,jsx,tsx}": [
"prettier --write",
"eslint --quiet",
"git add -A .",
]
}
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment