From c06d87b98b81901a2fd38dd665b58d88fb0840c5 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 2 Jan 2016 18:25:30 -0600 Subject: [PATCH] lint: Add babel rules to .eslintrc --- .eslintrc | 28 +++++++++++++++++----------- package.json | 4 +++- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.eslintrc b/.eslintrc index 585f456870..7613632120 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,8 @@ { + "parser": "babel-eslint", + "plugins": ["babel"], "rules": { - "indent": [2, 2], + "indent": [2, 2, {"SwitchCase": 1}], "quotes": [2, "single"], "linebreak-style": [2, "unix"], "semi": [2, "always"], @@ -43,13 +45,13 @@ "no-self-compare": 2, "no-return-assign": 2, "no-redeclare": 2, - "strict": [2, "global"], + "strict": [0, "global"], "no-delete-var": 2, "no-label-var": 2, "no-shadow-restricted-names": 2, "no-shadow": [2, { "builtinGlobals": true }], "no-undef-init": 2, - "no-undef": [2, { typeof: true }], + "no-undef": [2, { "typeof": true }], "no-unused-vars": 2, "no-use-before-define": 2, "global-require": 2, @@ -64,7 +66,7 @@ "no-dupe-class-members": 2, "no-this-before-super": 2, "no-var": 2, - "object-shorthand": 2, + "object-shorthand": 0, "prefer-const": 0, "prefer-spread": 2, "prefer-template": 2, @@ -75,15 +77,15 @@ "comma-style": [2, "last"], "comma-dangle": [2, "always-multiline"], "computed-property-spacing": [2, "never"], - "consistent-this": [2, "self"], + "consistent-this": [0, "self"], "func-names": 2, "func-style": [2, "declaration", { "allowArrowFunctions": true }], "block-spacing": [2, "always"], "key-spacing": [2, {"beforeColon": false, "afterColon": true}], "max-nested-callbacks": [2, 3], - "new-cap": 2, + "new-cap": 0, "new-parens": 2, - "newline-after-var": 2, + "newline-after-var": 0, "no-array-constructor": 2, "no-continue": 2, "no-lonely-if": 2, @@ -104,17 +106,21 @@ "space-infix-ops": 2, "space-return-throw-case": 2, "space-unary-ops": 2, - "spaced-comment": [2, "always", { exceptions: ["-"]}], + "spaced-comment": [2, "always", { "exceptions": ["-"]}], "padded-blocks": [2, "never"], - "no-multiple-empty-lines": [2, {max: 2}] + "no-multiple-empty-lines": [2, {"max": 2}], + "generator-star-spacing": 0, + "babel/new-cap": 2, + "babel/object-shorthand": 2, + "babel/no-await-in-loop": 2 }, "env": { "es6": true, "mocha": true, "node": true }, - ecmaFeatures : { - modules: true + "ecmaFeatures" : { + "modules": true }, "extends": "eslint:recommended" } diff --git a/package.json b/package.json index d8e4ac2478..73e723954e 100644 --- a/package.json +++ b/package.json @@ -91,17 +91,18 @@ "coverage": "COVERAGE=true mocha --require register-handlers.js --reporter html-cov > coverage.html; open coverage.html" }, "devDependencies": { + "babel-eslint": "^4.1.6", "chai": "^3.4.0", "chai-as-promised": "^5.1.0", "coveralls": "^2.11.2", "csv": "~0.3.6", "deep-diff": "~0.1.4", "eslint": "^1.9.0", + "eslint-plugin-babel": "^3.0.0", "eslint-plugin-mocha": "^1.1.0", "event-stream": "^3.2.2", "expect.js": "~0.2.0", "istanbul": "^0.3.14", - "phantomjs": "^1.9", "karma": "~0.13.15", "karma-babel-preprocessor": "^5.0.0", "karma-chai-plugins": "~0.6.0", @@ -113,6 +114,7 @@ "mocha": "^2.3.3", "mongodb": "^2.0.46", "mongoskin": "~0.6.1", + "phantomjs": "^1.9", "protractor": "~2.5.1", "rewire": "^2.3.3", "rimraf": "^2.4.3",