Skip to content

Commit 69dc21c

Browse files
committed
Added husky/lint-staged to run prettier on precommit
Doc: https://prettier.io/docs/en/precommit.html
1 parent 2ebe496 commit 69dc21c

File tree

2 files changed

+368
-8
lines changed

2 files changed

+368
-8
lines changed

Diff for: package.json

+14
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@
4343
"@types/react-dom": "^16.8.2",
4444
"@typescript-eslint/eslint-plugin": "^1.5.0",
4545
"@typescript-eslint/parser": "^1.5.0",
46+
"husky": "^1.3.1",
47+
"lint-staged": "^8.1.5",
48+
"prettier": "1.16.4",
4649
"typescript": "~3.3.4000"
50+
},
51+
"husky": {
52+
"hooks": {
53+
"pre-commit": "lint-staged"
54+
}
55+
},
56+
"lint-staged": {
57+
"*.{js,json,ts,tsx,css,md}": [
58+
"prettier --write",
59+
"git add"
60+
]
4761
}
4862
}

0 commit comments

Comments
 (0)