Skip to content

Commit ab4b4e0

Browse files
committed
Add lint, format and check scripts + prettier stuff
1 parent d711a20 commit ab4b4e0

15 files changed

Lines changed: 682 additions & 672 deletions

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
build
3+
coverage
4+
public

.prettierrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"trailingCommas": "es5"
2+
"endOfLine": "lf",
3+
"printWidth": 80,
4+
"tabWidth": 2,
5+
"trailingComma": "es5"
36
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
"test": "react-scripts test",
1818
"test:non-watch": "react-scripts test --watchAll=false",
1919
"coverage": "react-scripts test --coverage --watchAll=false",
20-
"eject": "react-scripts eject"
20+
"eject": "react-scripts eject",
21+
"lint": "eslint . --cache-location node_modules/.cache/eslint",
22+
"format": "prettier --write \"**/*.+(js|json|css|html)\"",
23+
"check": "prettier --check \"**/*.+(js|json|css|html)\""
2124
},
2225
"eslintConfig": {
2326
"extends": "react-app"
@@ -49,7 +52,7 @@
4952
},
5053
"husky": {
5154
"hooks": {
52-
"pre-commit": "pretty-quick --staged && npm run test:non-watch"
55+
"pre-commit": "pretty-quick --staged && npm run format && npm run check && npm run test:non-watch"
5356
}
5457
},
5558
"jest": {

0 commit comments

Comments
 (0)