Skip to content

Commit c689c9f

Browse files
authored
Merge pull request #126 from reactjs/test/install-commit-hook
Automatically execute Lint before commit with lint-staged and husky
2 parents b2fa746 + 17a98cc commit c689c9f

File tree

2 files changed

+436
-9
lines changed

2 files changed

+436
-9
lines changed

package.json

+13
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,24 @@
9191
"devDependencies": {
9292
"@babel/preset-flow": "^7.0.0",
9393
"eslint-config-prettier": "^2.6.0",
94+
"husky": "^1.3.1",
95+
"lint-staged": "^8.1.4",
9496
"lz-string": "^1.4.4",
9597
"npm-run-all": "^4.1.5",
9698
"recursive-readdir": "^2.2.1",
9799
"textlint": "^11.2.1",
98100
"textlint-rule-preset-jtf-style": "^2.3.3",
99101
"unist-util-map": "^1.0.3"
102+
},
103+
"husky": {
104+
"hooks": {
105+
"pre-commit": "lint-staged"
106+
}
107+
},
108+
"lint-staged": {
109+
"*.md": [
110+
"textlint --rulesdir=./textlint",
111+
"git add"
112+
]
100113
}
101114
}

0 commit comments

Comments
 (0)