From 647923a273078af1669faed758d2eabbaba06b3b Mon Sep 17 00:00:00 2001 From: Mike Cooper Date: Thu, 22 Feb 2018 16:44:56 -0800 Subject: [PATCH] Add eslint and configs --- .eslintrc.js | 8 ++++++++ package.json | 5 ++++- test/.eslintrc.js | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) 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..fe0fb2a --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + env: { + browser: true, + node: true, + es6: true + }, + extends: ["eslint:recommended", "plugin:prettier/recommended"] +}; diff --git a/package.json b/package.json index 0ea50ec..fa1c17c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "scripts": { "test": "istanbul cover _mocha -- -R spec --recursive test", "prepublish": "gulp", - "lint": "prettier --list-different 'lib/**' 'test/**' gulpfile.js" + "lint": "eslint lib test gulpfile.js .eslintrc.js --ignore-pattern '!.eslintrc.js'" }, "repository": { "type": "git", @@ -50,6 +50,9 @@ "vinyl-transform": "=1.0.0" }, "dependencies": { + "eslint": "^4.18.1", + "eslint-config-prettier": "^2.9.0", + "eslint-plugin-prettier": "^2.6.0", "prettier": "^1.10.2" } } diff --git a/test/.eslintrc.js b/test/.eslintrc.js new file mode 100644 index 0000000..bf3479f --- /dev/null +++ b/test/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + env: { + mocha: true + } +};