From 09841c05e2954eb271766d4801729e5ef9962d1d Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Tue, 13 Sep 2016 15:27:29 +0200 Subject: [PATCH] Added lint-staged with the eslint autofix config. --- package.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1d335ab9..a30f1cf0 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,16 @@ "storybook": "start-storybook -p 9001", "storybook-build": "build-storybook -o dist", "lint": "eslint .", - "lint:fix": "npm run lint -- --fix" + "lint:fix": "npm run lint -- --fix", + "lint:staged": "lint-staged" }, + "lint-staged": { + "*.@(js|jsx)": [ + "eslint --fix", + "git add" + ] + }, + "pre-commit": "lint:staged", "keywords": [ "netlify", "cms" @@ -43,12 +51,14 @@ "immutable": "^3.7.6", "imports-loader": "^0.6.5", "js-yaml": "^3.5.3", + "lint-staged": "^3.0.2", "mocha": "^2.4.5", "moment": "^2.11.2", "normalizr": "^2.0.0", "postcss-cssnext": "^2.7.0", "postcss-import": "^8.1.2", "postcss-loader": "^0.9.1", + "pre-commit": "^1.1.3", "react": "^15.1.0", "react-dom": "^15.1.0", "react-immutable-proptypes": "^1.6.0",