From ff0adbe2918dbc5b26814f61853227318d787965 Mon Sep 17 00:00:00 2001 From: Harrison Shoff Date: Sat, 20 Feb 2016 12:59:00 -0800 Subject: [PATCH] [eslint-v2][react] acceptTranspilerName => ignoreTranspilerName --- packages/eslint-config-airbnb/rules/react.js | 5 ++++- packages/eslint-config-airbnb/rules/style.js | 5 +++-- packages/eslint-config-airbnb/test/test-react-order.js | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js index e1e1c259..2b59ca20 100644 --- a/packages/eslint-config-airbnb/rules/react.js +++ b/packages/eslint-config-airbnb/rules/react.js @@ -10,7 +10,7 @@ module.exports = { 'rules': { // Prevent missing displayName in a React component definition // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md - 'react/display-name': [0, { 'acceptTranspilerName': false }], + 'react/display-name': [0, { 'ignoreTranspilerName': true }], // Forbid certain propTypes (any, array, object) // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md 'react/forbid-prop-types': [0, { 'forbid': ['any', 'array', 'object'] }], @@ -116,6 +116,9 @@ module.exports = { // Prevent extra closing tags for components without children // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md 'react/self-closing-comp': 2, + // Enforce spaces before the closing bracket of self-closing JSX elements + // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-space-before-closing.md + 'react/jsx-space-before-closing': [2, 'always'], // Enforce component methods order // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md 'react/sort-comp': [2, { diff --git a/packages/eslint-config-airbnb/rules/style.js b/packages/eslint-config-airbnb/rules/style.js index a5d9e094..c147aae8 100644 --- a/packages/eslint-config-airbnb/rules/style.js +++ b/packages/eslint-config-airbnb/rules/style.js @@ -59,9 +59,10 @@ module.exports = { 'new-parens': 0, // allow/disallow an empty newline after var statement 'newline-after-var': 0, - // enforces new line after each method call in the chain to make it more readable and easy to maintain + // enforces new line after each method call in the chain to make it + // more readable and easy to maintain // http://eslint.org/docs/rules/newline-per-chained-call - 'newline-per-chained-call': [2, { "ignoreChainWithDepth": 3 }], + 'newline-per-chained-call': [2, { 'ignoreChainWithDepth': 3 }], // disallow use of the Array constructor 'no-array-constructor': 0, // disallow use of the continue statement diff --git a/packages/eslint-config-airbnb/test/test-react-order.js b/packages/eslint-config-airbnb/test/test-react-order.js index 77448cf8..f5b2d452 100644 --- a/packages/eslint-config-airbnb/test/test-react-order.js +++ b/packages/eslint-config-airbnb/test/test-react-order.js @@ -14,7 +14,8 @@ const cli = new CLIEngine({ function lint(text) { // @see http://eslint.org/docs/developer-guide/nodejs-api.html#executeonfiles // @see http://eslint.org/docs/developer-guide/nodejs-api.html#executeontext - return cli.executeOnText(text).results[0]; + const linter = cli.executeOnText(text); + return linter.results[0]; } function wrapComponent(body) {