diff --git a/package.json b/package.json index bed8bbf793..8c15c174eb 100644 --- a/package.json +++ b/package.json @@ -38,12 +38,14 @@ "extract-text-webpack-plugin": "^3.0.0", "html-loader": "^0.5.1", "html-webpack-plugin": "^2.30.1", + "husky": "^0.14.3", "isomorphic-fetch": "^2.2.1", "istanbul": "^0.4.5", "jsdom": "^9.12.0", "less": "^2.7.2", "less-loader": "^4.0.5", "less-plugin-clean-css": "^1.5.1", + "lint-staged": "^4.3.0", "mocha": "^3.0.2", "nps": "^5.7.1", "nps-utils": "^1.3.0", @@ -82,7 +84,8 @@ "lint": "eslint .", "publish:examples": "NODE_ENV=production nps publish", "start": "webpack-dev-server --progress", - "test": "NODE_ENV=test mocha --compilers js:babel-core/register" + "test": "NODE_ENV=test mocha --compilers js:babel-core/register", + "precommit": "lint-staged && yarn run test" }, "files": [ "dist", @@ -97,5 +100,8 @@ "react-component", "select", "ui" - ] + ], + "lint-staged": { + "*.js": "eslint" + } }