Skip to content

Commit a1b9b6e

Browse files
ooflorentsokra
authored andcommitted
Lint JS files before committing them
1 parent 3f183b5 commit a1b9b6e

File tree

2 files changed

+500
-12
lines changed

2 files changed

+500
-12
lines changed

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"express": "~4.13.1",
4949
"file-loader": "^1.1.6",
5050
"glob": "^7.1.2",
51+
"husky": "^1.0.0-rc.6",
5152
"i18n-webpack-plugin": "^1.0.0",
5253
"istanbul": "^0.4.5",
5354
"jade": "^1.11.0",
@@ -57,6 +58,7 @@
5758
"json-loader": "^0.5.7",
5859
"less": "^2.5.1",
5960
"less-loader": "^4.0.3",
61+
"lint-staged": "^7.1.0",
6062
"lodash": "^4.17.4",
6163
"prettier": "^1.11.1",
6264
"pug": "^2.0.3",
@@ -129,6 +131,16 @@
129131
"cover:unit": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.unittest.js\" --coverage",
130132
"cover:report": "istanbul report"
131133
},
134+
"husky": {
135+
"hooks": {
136+
"pre-commit": "lint-staged"
137+
}
138+
},
139+
"lint-staged": {
140+
"lib/**/*.js": [
141+
"eslint --cache"
142+
]
143+
},
132144
"jest": {
133145
"forceExit": true,
134146
"setupTestFrameworkScriptFile": "<rootDir>/test/setupTestFramework.js",

0 commit comments

Comments
 (0)