Commit 04d19e80 authored by Yannick Li's avatar Yannick Li
Browse files

Setup ESLint and Prettier as pre-commit using lint-staging and Husky

parent 6670b5aa
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
cd collaborative
npm run pre-commit
This diff is collapsed.
......@@ -27,8 +27,10 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"prepare": "cd .. && husky install collaborative/.husky",
"test": "react-scripts test",
"lint": "eslint .",
"pre-commit": "lint-staged --verbose",
"eject": "react-scripts eject"
},
"browserslist": {
......@@ -50,6 +52,12 @@
"enzyme-adapter-react-16": "^1.15.5",
"eslint": "^7.24.0",
"eslint-plugin-react": "^7.23.2",
"prettier": "2.2.1"
"prettier": "2.2.1",
"husky": "^6.0.0",
"lint-staged": "^10.5.4"
},
"lint-staged": {
"*.{js,ts,tsx}": "eslint --cache --fix",
"*.{js,ts,css,md,json,yml}": "prettier --write"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment