Skip to content

Commit

Permalink
Add Husky for pre-commit formatting hooks (#17625)
Browse files Browse the repository at this point in the history
* Add Husky for pre-commit formatting hooks

* Make hook executable

* Add lint-staged

* Simplify command for JSON files
  • Loading branch information
queengooborg authored Sep 14, 2022
1 parent 1c1183d commit 9d42eba
Show file tree
Hide file tree
Showing 4 changed files with 899 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

node node_modules/.bin/lint-staged
5 changes: 5 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*": "prettier --ignore-unknown --write",
"*.{js,jsx,tsx}": "eslint --fix",
"*.{json}": "npm run lint:fix"
}
Loading

0 comments on commit 9d42eba

Please sign in to comment.