From 2af31007e32c4dd63d9ee8c4dd0688185d1b4b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=BA?= Date: Mon, 14 Aug 2017 11:44:53 +0800 Subject: [PATCH] fix npm script precommit & add eslint --- .eslintrc.js | 10 ++++++++++ package.json | 6 ++++-- test/.eslintrc.js | 5 +++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .eslintrc.js create mode 100644 test/.eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..23e2f5d --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,10 @@ +module.exports = { + "root": true, + "env" : { + "node": true, + "es6": true, + }, + "extends": "eslint:recommended", + "rules": { + } +} \ No newline at end of file diff --git a/package.json b/package.json index 663f99e..4f54562 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,16 @@ "split-transform-stream": "~1.0.0" }, "devDependencies": { - "husky": "^0.10.2", + "eslint": "^4.4.1", + "husky": "^0.14.3", "mocha": "~2.3.4", "proxyquire": "~1.7.3", "should": "~7.1.1" }, "scripts": { + "pretest": "eslint .", "test": "mocha", - "precommit": "npm run lint && npm test" + "precommit": "npm test" }, "repository": { "type": "git", diff --git a/test/.eslintrc.js b/test/.eslintrc.js new file mode 100644 index 0000000..135f050 --- /dev/null +++ b/test/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + "env" : { + "mocha": true, + }, +} \ No newline at end of file