Skip to content

Commit cbb7098

Browse files
committed
add git hook for lint md files
1 parent ec53668 commit cbb7098

File tree

2 files changed

+1311
-7
lines changed

2 files changed

+1311
-7
lines changed

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,21 @@
1111
"lint": "textlint **/*.md",
1212
"lint:fix": "yarn lint --fix"
1313
},
14+
"lint-staged": {
15+
"*.{md}": [
16+
"npm run lint:fix",
17+
"git add"
18+
]
19+
},
20+
"husky": {
21+
"hooks": {
22+
"post-commit": "git update-index --again",
23+
"pre-commit": "lint-staged"
24+
}
25+
},
1426
"devDependencies": {
27+
"husky": "^1.3.1",
28+
"lint-staged": "^7.3.0",
1529
"textlint": "11.3.0",
1630
"textlint-rule-ja-space-between-half-and-full-width": "2.0.1",
1731
"textlint-rule-no-todo": "2.0.1"

0 commit comments

Comments
 (0)