Skip to content

Commit 7526505

Browse files
committed
Add Prettier
1 parent c6ef273 commit 7526505

File tree

4 files changed

+398
-53
lines changed

4 files changed

+398
-53
lines changed

.eslintrc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"root": true,
3-
"extends": "eslint-config-airbnb-base",
4-
"rules": {
5-
"arrow-parens": ["error", "always"]
6-
}
3+
"extends": [
4+
"eslint-config-airbnb-base",
5+
"prettier"
6+
]
77
}

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"arrowParens": "always"
5+
}

package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,12 @@
1111
"prepublish": "npm run --if-present build",
1212
"test": "npm-run-all lint mocha",
1313
"lint": "eslint src test",
14-
"mocha": "mocha"
14+
"mocha": "mocha",
15+
"precommit": "lint-staged",
16+
"prettier": "prettier --write \"**/*.{js,json,md}\""
1517
},
16-
"files": [
17-
"lib",
18-
"src"
19-
],
20-
"keywords": [
21-
"textlint",
22-
"rule",
23-
"english",
24-
"proofreading"
25-
],
18+
"files": ["lib", "src"],
19+
"keywords": ["textlint", "rule", "english", "proofreading"],
2620
"author": "nodaguti",
2721
"license": "MIT",
2822
"bugs": "https://github.com/nodaguti/textlint-rule-write-good/issues",
@@ -32,15 +26,23 @@
3226
"textlint-rule-helper": "^2.0.0",
3327
"write-good": "^0.11.0"
3428
},
29+
"lint-staged": {
30+
"*.js": ["prettier", "git add"],
31+
"*.json": ["prettier", "git add"]
32+
},
3533
"devDependencies": {
3634
"babel-cli": "^6.26.0",
3735
"babel-core": "^6.26.0",
3836
"babel-preset-env": "^1.6.1",
3937
"eslint": "^4.13.1",
4038
"eslint-config-airbnb-base": "^12.1.0",
39+
"eslint-config-prettier": "^2.9.0",
4140
"eslint-plugin-import": "^2.8.0",
41+
"husky": "^0.14.3",
42+
"lint-staged": "^6.0.0",
4243
"mocha": "^4.0.1",
4344
"npm-run-all": "^4.1.2",
45+
"prettier": "^1.9.2",
4446
"textlint": "^9.1.1",
4547
"textlint-tester": "^3.0.3"
4648
}

0 commit comments

Comments
 (0)