Skip to content

Commit

Permalink
🔧 add lint-staged with prettier config (#1954)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-walker committed May 5, 2021
1 parent 6808e34 commit 38562bc
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 8 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
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 lint-staged
3 changes: 3 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'*': 'prettier --ignore-unknown --write',
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"format": "prettier --write .",
"lint": "eslint --ignore-path .gitignore .",
"test": "jest --watch",
"coverage": "jest --coverage"
"coverage": "jest --coverage",
"prepare": "husky install"
},
"private": true,
"devDependencies": {
Expand All @@ -19,7 +20,9 @@
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-react": "^7.23.2",
"jest": "^26.6.3",
"husky": ">=6",
"msw": "^0.28.2",
"lint-staged": ">=10",
"prettier": "^2.2.1"
}
}
Loading

0 comments on commit 38562bc

Please sign in to comment.