Skip to content

Commit

Permalink
feat: add pre-commit lint
Browse files Browse the repository at this point in the history
  • Loading branch information
amje committed Aug 29, 2022
1 parent e54b839 commit 1f8787a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 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"

npx nano-staged
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"eslint": "^8.0.0",
"jest": "^28.0.0",
"husky": "^8.0.0",
"nano-staged": "^0.6.0",
"npm-run-all": "^4.0.0",
"prettier": "^2.0.0",
"react": "^17.0.0",
Expand All @@ -56,5 +57,16 @@
"peerDependencies": {
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
"nano-staged": {
"*.{scss}": [
"stylelint --fix --quiet"
],
"*.{js,jsx,ts,tsx}": [
"eslint --fix --quiet"
],
"*.md": [
"prettier --write"
]
}
}

0 comments on commit 1f8787a

Please sign in to comment.