Skip to content

Commit a696d95

Browse files
author
Kadi Kraman
committed
Add a pre-commit hook to keep things pretty
1 parent 19fedc5 commit a696d95

File tree

3 files changed

+315
-10
lines changed

3 files changed

+315
-10
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
extends:
33
- formidable
4+
- prettier
45
plugins:
56
- jest
67
env:

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "jest",
8-
"lint": "eslint ."
8+
"lint": "eslint .",
9+
"precommit": "lint-staged"
10+
},
11+
"lint-staged": {
12+
"*.js": [
13+
"eslint --fix",
14+
"git add"
15+
]
916
},
1017
"files": [
1118
"package.json",
@@ -44,11 +51,14 @@
4451
"babel-preset-env": "^1.6.1",
4552
"eslint": "2.10.2",
4653
"eslint-config-formidable": "^3.0.0",
54+
"eslint-config-prettier": "^2.9.0",
4755
"eslint-plugin-filenames": "^1.2.0",
4856
"eslint-plugin-import": "^2.8.0",
4957
"eslint-plugin-jest": "^21.3.2",
58+
"husky": "^0.14.3",
5059
"invariant": "^2.2.2",
5160
"jest": "^21.2.1",
61+
"lint-staged": "^6.1.0",
5262
"react": "^16.1.1",
5363
"react-native": "^0.50.3"
5464
},

0 commit comments

Comments
 (0)