From b61d16fdd837116f8c2a2fd0f858a1bc22660644 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sat, 10 Sep 2016 14:28:26 -0700 Subject: [PATCH] [eslint config] [base] [deps] update to `eslint` `v3.5.0`. --- packages/eslint-config-airbnb-base/legacy.js | 3 ++- packages/eslint-config-airbnb-base/package.json | 4 ++-- packages/eslint-config-airbnb-base/rules/es6.js | 16 ++++++++++++++-- .../eslint-config-airbnb-base/rules/node.js | 9 +++++++++ .../eslint-config-airbnb-base/rules/style.js | 17 +++++++++++++++++ 5 files changed, 44 insertions(+), 5 deletions(-) diff --git a/packages/eslint-config-airbnb-base/legacy.js b/packages/eslint-config-airbnb-base/legacy.js index 9acfb1cb4e..3de97acd21 100644 --- a/packages/eslint-config-airbnb-base/legacy.js +++ b/packages/eslint-config-airbnb-base/legacy.js @@ -16,6 +16,7 @@ module.exports = { ecmaFeatures: {}, globals: {}, rules: { - 'comma-dangle': ['error', 'never'] + 'comma-dangle': ['error', 'never'], + 'prefer-numeric-literals': 'off', } }; diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json index b935962690..f2a786b89c 100644 --- a/packages/eslint-config-airbnb-base/package.json +++ b/packages/eslint-config-airbnb-base/package.json @@ -47,7 +47,7 @@ "devDependencies": { "babel-preset-airbnb": "^2.0.0", "babel-tape-runner": "^2.0.1", - "eslint": "^3.4.0", + "eslint": "^3.5.0", "eslint-find-rules": "^1.13.1", "eslint-plugin-import": "^1.14.0", "in-publish": "^2.0.0", @@ -55,7 +55,7 @@ "tape": "^4.6.0" }, "peerDependencies": { - "eslint": "^3.4.0", + "eslint": "^3.5.0", "eslint-plugin-import": "^1.14.0" }, "engines": { diff --git a/packages/eslint-config-airbnb-base/rules/es6.js b/packages/eslint-config-airbnb-base/rules/es6.js index f1e2bd026f..11433ca3dd 100644 --- a/packages/eslint-config-airbnb-base/rules/es6.js +++ b/packages/eslint-config-airbnb-base/rules/es6.js @@ -14,10 +14,17 @@ module.exports = { rules: { // enforces no braces where they can be omitted // http://eslint.org/docs/rules/arrow-body-style - 'arrow-body-style': ['error', 'as-needed'], + // TODO: enable requireReturnForObjectLiteral? + 'arrow-body-style': ['error', 'as-needed', { + requireReturnForObjectLiteral: false, + }], // require parens in arrow function arguments - 'arrow-parens': 'off', + // http://eslint.org/docs/rules/arrow-parens + // TODO: enable, semver-minor + 'arrow-parens': ['off', 'as-needed', { + requireForBlockBody: true, + }], // require space before/after arrow function's arrow // http://eslint.org/docs/rules/arrow-spacing @@ -101,6 +108,11 @@ module.exports = { ignoreReadBeforeAssign: true, }], + // disallow parseInt() in favor of binary, octal, and hexadecimal literals + // http://eslint.org/docs/rules/prefer-numeric-literals + // TODO: enable, semver-major + 'prefer-numeric-literals': 'off', + // suggest using Reflect methods where applicable // http://eslint.org/docs/rules/prefer-reflect // TODO: enable? diff --git a/packages/eslint-config-airbnb-base/rules/node.js b/packages/eslint-config-airbnb-base/rules/node.js index e4a71a6a5a..28c37127ab 100644 --- a/packages/eslint-config-airbnb-base/rules/node.js +++ b/packages/eslint-config-airbnb-base/rules/node.js @@ -33,6 +33,15 @@ module.exports = { // restrict usage of specified node modules 'no-restricted-modules': 'off', + // disallow certain object properties + // http://eslint.org/docs/rules/no-restricted-properties + // TODO: enable, semver-major + 'no-restricted-properties': ['off', { + object: 'arguments', + property: 'callee', + message: 'arguments.callee is deprecated,' + }], + // disallow use of synchronous methods (off by default) 'no-sync': 'off', } diff --git a/packages/eslint-config-airbnb-base/rules/style.js b/packages/eslint-config-airbnb-base/rules/style.js index 243d3141d0..764fef5465 100644 --- a/packages/eslint-config-airbnb-base/rules/style.js +++ b/packages/eslint-config-airbnb-base/rules/style.js @@ -73,6 +73,15 @@ module.exports = { } }], + // enforce position of line comments + // http://eslint.org/docs/rules/line-comment-position + // TODO: enable? + 'line-comment-position': ['off', { + position: 'above', + ignorePattern: '', + applyDefaultPatterns: true, + }], + // disallow mixed 'LF' and 'CRLF' as linebreaks // http://eslint.org/docs/rules/linebreak-style 'linebreak-style': ['error', 'unix'], @@ -80,6 +89,14 @@ module.exports = { // enforces empty lines around comments 'lines-around-comment': 'off', + // require or disallow newlines around directives + // http://eslint.org/docs/rules/lines-around-directive + // TODO: enable, semver-major + 'lines-around-directive': ['off', { + before: 'always', + after: 'always', + }], + // specify the maximum depth that blocks can be nested 'max-depth': ['off', 4],