From 6f861ecfdc31042bf35137b9351d41d43f3e14cd Mon Sep 17 00:00:00 2001 From: foray1010 Date: Fri, 15 Apr 2016 14:52:36 +0800 Subject: [PATCH] 2.0.2: Migrate eslint 1.x config to 2.x --- index.js | 14 ++++++-------- legacy.js | 4 ---- package.json | 2 +- react.js | 5 +++++ rules/main.js | 4 ---- 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/index.js b/index.js index b319ea4..a01a5b2 100644 --- a/index.js +++ b/index.js @@ -7,15 +7,13 @@ module.exports = extendConfig({ 'eslint-config-airbnb/base', 'eslint-config-aftership/rules/main' ], - ecmaFeatures: { - // not stable and require harmony flag to enable - destructuring: false, - - // if you want to use jsx, extends "aftership/react" - jsx: false, - + parserOptions: { + ecmaFeatures: { + // if you want to use jsx, extends "aftership/react" + jsx: false + }, // we use require() instead of `import ... from ...` - modules: false + sourceType: 'script' }, rules: { /*++++++++++++++ diff --git a/legacy.js b/legacy.js index 464828a..90a3b58 100644 --- a/legacy.js +++ b/legacy.js @@ -7,10 +7,6 @@ module.exports = extendConfig({ 'eslint-config-airbnb/legacy', 'eslint-config-aftership/rules/main' ], - ecmaFeatures: { - // ES5 or below don't support `generators` - generators: false - }, rules: { /*++++++++++++++ + Strict Mode + diff --git a/package.json b/package.json index 8f9d386..000d6a8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "eslint-config-aftership", "description": "AfterShip ESLint config (modified from Airbnb)", - "version": "2.0.1", + "version": "2.0.2", "homepage": "https://github.com/AfterShip/eslint-config-aftership", "author": { "name": "AfterShip", diff --git a/react.js b/react.js index aa0f758..ffbf3ab 100644 --- a/react.js +++ b/react.js @@ -10,6 +10,11 @@ module.exports = extendConfig({ env: { browser: true }, + parserOptions: { + ecmaFeatures: { + jsx: true + } + }, rules: { // Use tab instead of 2 space when indenting jsx properties // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md diff --git a/rules/main.js b/rules/main.js index 4165ec3..d4bd79b 100644 --- a/rules/main.js +++ b/rules/main.js @@ -8,10 +8,6 @@ module.exports = { // recognize the predefined variables of mocha mocha: true }, - ecmaFeatures: { - // we use generator, a lot - generators: true - }, rules: { /*++++++++++++++++++ + Possible Errors +