Add prettier support

Add prettier and bind it with eslint.
Also add pre-commit hook to prettify before commit

Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
This commit is contained in:
Sudhanshu Gautam 2019-09-02 02:30:15 +05:30
parent 3f46d13ccf
commit ce4d2e1436
13 changed files with 776 additions and 468 deletions

View file

@ -25,7 +25,8 @@
"eject": "react-scripts eject",
"predeploy": "yarn run build",
"deploy": "gh-pages -d build",
"lint": "eslint src/ --ext .js --fix"
"lint": "eslint src/ --ext .js --fix",
"pretty": "prettier --single-quote --trailing-comma es5 --write \"src/**/*.js\""
},
"browserslist": {
"production": [
@ -42,8 +43,17 @@
"devDependencies": {
"babel-eslint": "^10.0.2",
"eslint": "^6.1.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.2",
"husky": "^3.0.5",
"prettier": "1.18.2",
"pretty-quick": "^1.11.1",
"prop-types": "latest",
"typescript": "^3.5.3"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
}