Skip to content

Commit fd1b245

Browse files
authored
Merge pull request webpack#6371 from webpack/precommit_lint
Lint JS files before committing them
2 parents 7f937e8 + 15bec9b commit fd1b245

File tree

2 files changed

+522
-12
lines changed

2 files changed

+522
-12
lines changed

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"express": "~4.13.1",
5151
"file-loader": "^1.1.6",
5252
"glob": "^7.1.2",
53+
"husky": "^1.0.0-rc.6",
5354
"i18n-webpack-plugin": "^1.0.0",
5455
"istanbul": "^0.4.5",
5556
"jade": "^1.11.0",
@@ -59,6 +60,7 @@
5960
"json-loader": "^0.5.7",
6061
"less": "^2.5.1",
6162
"less-loader": "^4.0.3",
63+
"lint-staged": "^7.1.0",
6264
"lodash": "^4.17.4",
6365
"prettier": "^1.13.5",
6466
"pug": "^2.0.3",
@@ -131,6 +133,16 @@
131133
"cover:unit": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.unittest.js\" --coverage",
132134
"cover:report": "istanbul report"
133135
},
136+
"husky": {
137+
"hooks": {
138+
"pre-commit": "lint-staged"
139+
}
140+
},
141+
"lint-staged": {
142+
"lib/**/*.js": [
143+
"eslint --cache"
144+
]
145+
},
134146
"jest": {
135147
"forceExit": true,
136148
"setupTestFrameworkScriptFile": "<rootDir>/test/setupTestFramework.js",

0 commit comments

Comments
 (0)