From 56fd094e0186040c11a6ba59008bf1771a5d269b Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 29 Apr 2016 23:57:23 -0700 Subject: [PATCH] [eslint config] [base] [deps] update `eslint`, `eslint-plugin-import` --- packages/eslint-config-airbnb-base/package.json | 8 ++++---- .../eslint-config-airbnb-base/rules/best-practices.js | 6 +++++- packages/eslint-config-airbnb-base/rules/es6.js | 9 ++++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json index f7d1b6fb..5690895a 100644 --- a/packages/eslint-config-airbnb-base/package.json +++ b/packages/eslint-config-airbnb-base/package.json @@ -44,13 +44,13 @@ "homepage": "https://github.com/airbnb/javascript", "devDependencies": { "babel-tape-runner": "^1.3.1", - "eslint": "^2.8.0", + "eslint": "^2.9.0", "eslint-find-rules": "^1.7.0", - "eslint-plugin-import": "^1.6.0", + "eslint-plugin-import": "^1.6.1", "tape": "^4.5.1" }, "peerDependencies": { - "eslint": "^2.8.0", - "eslint-plugin-import": "^1.6.0" + "eslint": "^2.9.0", + "eslint-plugin-import": "^1.6.1" } } diff --git a/packages/eslint-config-airbnb-base/rules/best-practices.js b/packages/eslint-config-airbnb-base/rules/best-practices.js index 38072220..5e14e840 100644 --- a/packages/eslint-config-airbnb-base/rules/best-practices.js +++ b/packages/eslint-config-airbnb-base/rules/best-practices.js @@ -14,7 +14,7 @@ module.exports = { // specify curly brace conventions for all control statements 'curly': [2, 'multi-line'], // require default case in switch statements - 'default-case': 2, + 'default-case': [2, { 'commentPattern': '^no default$' }], // encourages use of dot notation whenever possible 'dot-notation': [2, { 'allowKeywords': true }], // enforces consistent newlines before or after dots @@ -136,6 +136,10 @@ module.exports = { // disallow unmodified conditions of loops // http://eslint.org/docs/rules/no-unmodified-loop-condition 'no-unmodified-loop-condition': 0, + // disallow return/throw/break/continue inside finally blocks + // http://eslint.org/docs/rules/no-unsafe-finally + // TODO: enable + 'no-unsafe-finally': 0, // disallow usage of expressions in statement position 'no-unused-expressions': 2, // disallow unused labels diff --git a/packages/eslint-config-airbnb-base/rules/es6.js b/packages/eslint-config-airbnb-base/rules/es6.js index 77c0b325..4caff23b 100644 --- a/packages/eslint-config-airbnb-base/rules/es6.js +++ b/packages/eslint-config-airbnb-base/rules/es6.js @@ -55,6 +55,10 @@ module.exports = { 'no-this-before-super': 0, // require let or const instead of var 'no-var': 2, + // disallow useless computed property keys + // http://eslint.org/docs/rules/no-useless-computed-key + // TODO: enable + 'no-useless-computed-key': 0, // disallow unnecessary constructor // http://eslint.org/docs/rules/no-useless-constructor 'no-useless-constructor': 2, @@ -62,7 +66,10 @@ module.exports = { // http://eslint.org/docs/rules/object-shorthand 'object-shorthand': [2, 'always'], // suggest using arrow functions as callbacks - 'prefer-arrow-callback': 2, + 'prefer-arrow-callback': [2, { + 'allowNamedFunctions': false, + 'allowUnboundThis': true, + }], // suggest using of const declaration for variables that are never modified after declared 'prefer-const': 2, // suggest using the spread operator instead of .apply()