Skip to content

Commit e4ecdfe

Browse files
committed
Added git-staged for prettier
1 parent 988d166 commit e4ecdfe

File tree

3 files changed

+303
-47
lines changed

3 files changed

+303
-47
lines changed

.eslintrc

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
2-
"extends": ["plugin:react-app/recommended"],
3-
"plugins": ["prettier"],
4-
"rules": {
5-
"prettier/prettier": ["error", {
6-
"printWidth": 100,
7-
"trailingComma": "all",
8-
"singleQuote": true
9-
}]
10-
}
11-
}
2+
"extends": [
3+
"plugin:react-app/recommended"
4+
]
5+
}

package.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"typings": "src/index.d.ts",
77
"scripts": {
88
"lint": "eslint src",
9+
"precommit": "lint-staged",
910
"test": "npm run lint",
11+
"prettier": "prettier --write --print-width 100 --single-quote --trailing-comma all src/**/*.js",
1012
"reset": "watchman watch-del-all && rm -rf node_modules/ && npm cache clean && npm prune && yarn cache clean"
1113
},
1214
"keywords": [
@@ -28,15 +30,23 @@
2830
},
2931
"dependencies": {
3032
"moment": "^2.18.1",
31-
"react-native-modal": "^2.2.0"
33+
"react-native-modal": "^2.4.0"
3234
},
3335
"devDependencies": {
3436
"babel-eslint": "^7.2.2",
3537
"eslint": "^3.19.0",
36-
"eslint-plugin-prettier": "^2.0.1",
3738
"eslint-plugin-react-app": "^1.0.2",
38-
"prettier": "^1.1.0",
39+
"husky": "0.13.3",
40+
"lint-staged": "3.4.1",
41+
"prettier": "^1.3.1",
3942
"react": ">=15.0.0",
4043
"react-native": ">=0.24.0"
44+
},
45+
"lint-staged": {
46+
"*.js": [
47+
"npm run test",
48+
"npm run prettier",
49+
"git add"
50+
]
4151
}
42-
}
52+
}

0 commit comments

Comments
 (0)