Skip to content

Commit ff69d3b

Browse files
committed
Add prettier and standard
1 parent 345efa7 commit ff69d3b

File tree

3 files changed

+53
-6
lines changed

3 files changed

+53
-6
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.{diff,md}]
12+
trim_trailing_whitespace = false

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
android/
2+
ios/
3+
4+
# TODO: remove it
5+
JPushConfiguration.js

package.json

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "a jpush plugin for react native application",
55
"main": "index.js",
66
"scripts": {
7-
"postinstall": "node postInstall.js"
7+
"precommit": "lint-staged",
8+
"postinstall": "node postInstall.js",
9+
"lint": "prettier --write '**/*.{js,ts,md}'; standard --fix"
810
},
911
"types": "index.d.ts",
1012
"repository": {
@@ -25,6 +27,38 @@
2527
"peerDependencies": {
2628
"jcore-react-native": ">= 1.2.0"
2729
},
30+
"devDependencies": {
31+
"babel-eslint": "^7.2.3",
32+
"husky": "^0.14.3",
33+
"lint-staged": "^6.0.1",
34+
"prettier": "^1.10.2",
35+
"standard": "^10.0.3"
36+
},
37+
"lint-staged": {
38+
"*.{js,ts,md}": [
39+
"prettier --write",
40+
"git add"
41+
],
42+
"*.js": [
43+
"standard --fix",
44+
"git add"
45+
]
46+
},
47+
"prettier": {
48+
"semi": false,
49+
"singleQuote": true,
50+
"trailingComma": "es5"
51+
},
52+
"standard": {
53+
"env": {
54+
"jest": true
55+
},
56+
"parser": "babel-eslint",
57+
"ignore": [
58+
"android/",
59+
"ios/"
60+
]
61+
},
2862
"rnpm": {
2963
"ios": {
3064
"sharedLibraries": [
@@ -41,9 +75,5 @@
4175
"CoreGraphics"
4276
]
4377
}
44-
},
45-
"devDependencies": {
46-
"babel-cli": "^6.24.1",
47-
"babel-preset-env": "^1.6.0"
4878
}
49-
}
79+
}

0 commit comments

Comments
 (0)