diff --git a/.eslintrc b/.eslintrc index 59feac25f7..5d2e174936 100644 --- a/.eslintrc +++ b/.eslintrc @@ -19,7 +19,7 @@ "no-debugger": 2, "no-dupe-keys": 2, "no-empty": 2, - "no-empty-class": 2, + "no-empty-character-class": 2, "no-ex-assign": 2, "no-extra-boolean-cast": 2, "no-extra-parens": 0, @@ -132,7 +132,6 @@ "no-trailing-spaces": 2, "no-multiple-empty-lines": 2, "no-underscore-dangle": 0, - "no-wrap-func": 2, "one-var": 0, "operator-assignment": [2, "always"], "padded-blocks": 0, @@ -142,12 +141,13 @@ "sort-vars": [2, {"ignoreCase": true}], "space-after-keywords": 2, "space-before-blocks": 2, - "space-in-brackets": 2, + "object-curly-spacing": [2, "never"], + "array-bracket-spacing": [2, "never"], "space-in-parens": 2, "space-infix-ops": 2, "space-return-throw-case": 2, "space-unary-ops": 2, - "spaced-line-comment": 2, + "spaced-comment": 2, "wrap-regex": 0, // Legacy "max-depth": 0, diff --git a/lib/rules/jsx-no-undef.js b/lib/rules/jsx-no-undef.js index 695d16bb97..caea00dc5f 100644 --- a/lib/rules/jsx-no-undef.js +++ b/lib/rules/jsx-no-undef.js @@ -54,12 +54,12 @@ module.exports = function(context) { } return { - JSXOpeningElement: function(node) { - if (isTagName(node.name.name)) { - return; - } - checkIdentifierInJSX(node.name); - } + JSXOpeningElement: function(node) { + if (isTagName(node.name.name)) { + return; + } + checkIdentifierInJSX(node.name); + } }; }; diff --git a/package.json b/package.json index 1d53c1bd2f..4a2c13e83f 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,10 @@ "description": "React specific linting rules for ESLint", "main": "index.js", "scripts": { - "test": "npm run lint && npm run unit-test", + "coveralls": "cat ./reports/coverage/lcov.info | coveralls", "lint": "eslint ./", - "unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/**/*.js -- --reporter dot", - "coveralls": "cat ./reports/coverage/lcov.info | coveralls" + "test": "npm run lint && npm run unit-test", + "unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/**/*.js -- --reporter dot" }, "files": [ "LICENSE", @@ -23,9 +23,9 @@ "homepage": "https://github.com/yannickcr/eslint-plugin-react", "bugs": "https://github.com/yannickcr/eslint-plugin-react/issues", "devDependencies": { - "babel-eslint": "3.1.19", + "babel-eslint": "3.1.23", "coveralls": "2.11.2", - "eslint": "0.24.0", + "eslint": "1.0.0-rc-1", "eslint-tester": "0.8.2", "istanbul": "0.3.17", "mocha": "2.2.5" @@ -34,9 +34,9 @@ "eslint": ">=0.8.0" }, "keywords": [ + "eslint", "eslint-plugin", "eslintplugin", - "eslint", "react" ], "license": "MIT" diff --git a/tests/lib/rules/jsx-boolean-value.js b/tests/lib/rules/jsx-boolean-value.js index 8c01a07428..1eee93f680 100644 --- a/tests/lib/rules/jsx-boolean-value.js +++ b/tests/lib/rules/jsx-boolean-value.js @@ -17,14 +17,14 @@ var ESLintTester = require('eslint-tester'); var eslintTester = new ESLintTester(eslint); eslintTester.addRuleTest('lib/rules/jsx-boolean-value', { - valid: [ - {code: ';', args: [1, 'never'], ecmaFeatures: {jsx: true}}, - {code: ';', args: [1, 'always'], ecmaFeatures: {jsx: true}} - ], - invalid: [ - {code: ';', args: [1, 'never'], - errors: [{message: 'Value must be omitted for boolean attributes'}], ecmaFeatures: {jsx: true}}, - {code: ';', args: [1, 'always'], - errors: [{message: 'Value must be set for boolean attributes'}], ecmaFeatures: {jsx: true}} - ] + valid: [ + {code: ';', args: [1, 'never'], ecmaFeatures: {jsx: true}}, + {code: ';', args: [1, 'always'], ecmaFeatures: {jsx: true}} + ], + invalid: [ + {code: ';', args: [1, 'never'], + errors: [{message: 'Value must be omitted for boolean attributes'}], ecmaFeatures: {jsx: true}}, + {code: ';', args: [1, 'always'], + errors: [{message: 'Value must be set for boolean attributes'}], ecmaFeatures: {jsx: true}} + ] }); diff --git a/tests/lib/rules/jsx-quotes.js b/tests/lib/rules/jsx-quotes.js index f07e89e1b2..f92d142875 100644 --- a/tests/lib/rules/jsx-quotes.js +++ b/tests/lib/rules/jsx-quotes.js @@ -18,17 +18,17 @@ var ESLintTester = require('eslint-tester'); var eslintTester = new ESLintTester(eslint); eslintTester.addRuleTest('lib/rules/jsx-quotes', { - valid: [ - {code: ';', args: [1, 'single'], ecmaFeatures: {jsx: true}}, - {code: ';', args: [1, 'double'], ecmaFeatures: {jsx: true}}, - {code: ';', args: [1, 'single', 'avoid-escape'], ecmaFeatures: {jsx: true}}, - {code: ';', args: [1, 'double', 'avoid-escape'], ecmaFeatures: {jsx: true}}, - {code: 'foo;', args: [1, 'single'], ecmaFeatures: {jsx: true}} - ], - invalid: [ - {code: ';', - errors: [{message: 'JSX attributes must use singlequote.'}], args: [1, 'single'], ecmaFeatures: {jsx: true}}, - {code: ';', - errors: [{message: 'JSX attributes must use doublequote.'}], args: [1, 'double'], ecmaFeatures: {jsx: true}} - ] + valid: [ + {code: ';', args: [1, 'single'], ecmaFeatures: {jsx: true}}, + {code: ';', args: [1, 'double'], ecmaFeatures: {jsx: true}}, + {code: ';', args: [1, 'single', 'avoid-escape'], ecmaFeatures: {jsx: true}}, + {code: ';', args: [1, 'double', 'avoid-escape'], ecmaFeatures: {jsx: true}}, + {code: 'foo;', args: [1, 'single'], ecmaFeatures: {jsx: true}} + ], + invalid: [ + {code: ';', + errors: [{message: 'JSX attributes must use singlequote.'}], args: [1, 'single'], ecmaFeatures: {jsx: true}}, + {code: ';', + errors: [{message: 'JSX attributes must use doublequote.'}], args: [1, 'double'], ecmaFeatures: {jsx: true}} + ] }); diff --git a/tests/lib/rules/jsx-sort-prop-types.js b/tests/lib/rules/jsx-sort-prop-types.js index 3099866459..4f12ba9ca7 100644 --- a/tests/lib/rules/jsx-sort-prop-types.js +++ b/tests/lib/rules/jsx-sort-prop-types.js @@ -213,7 +213,7 @@ eslintTester.addRuleTest('lib/rules/jsx-sort-prop-types', { errors: [{ message: ERROR_MESSAGE, line: 4, - column: 4, + column: 5, type: 'Property' }] }, { @@ -234,7 +234,7 @@ eslintTester.addRuleTest('lib/rules/jsx-sort-prop-types', { errors: [{ message: ERROR_MESSAGE, line: 4, - column: 4, + column: 5, type: 'Property' }] }, { @@ -258,7 +258,7 @@ eslintTester.addRuleTest('lib/rules/jsx-sort-prop-types', { errors: [{ message: ERROR_MESSAGE, line: 4, - column: 4, + column: 5, type: 'Property' }] }, { diff --git a/tests/lib/rules/jsx-uses-react.js b/tests/lib/rules/jsx-uses-react.js index ab5791bdc0..913ebb6ab0 100644 --- a/tests/lib/rules/jsx-uses-react.js +++ b/tests/lib/rules/jsx-uses-react.js @@ -19,16 +19,16 @@ var ESLintTester = require('eslint-tester'); var eslintTester = new ESLintTester(eslint); eslint.defineRule('jsx-uses-react', require('../../../lib/rules/jsx-uses-react')); eslintTester.addRuleTest('node_modules/eslint/lib/rules/no-unused-vars', { - valid: [ - {code: '/*eslint jsx-uses-react:1*/ var React;
;', ecmaFeatures: {jsx: true}}, - {code: '/*eslint jsx-uses-react:1*/ var React; (function () {
})();', ecmaFeatures: {jsx: true}}, - {code: '/*eslint jsx-uses-react:1*/ /** @jsx Foo */ var Foo;
;', ecmaFeatures: {jsx: true}}, - {code: '/*eslint jsx-uses-react:[1,{"pragma":"Foo"}]*/ var Foo;
;', ecmaFeatures: {jsx: true}} - ], - invalid: [ - {code: '/*eslint jsx-uses-react:1*/ var React;', - errors: [{message: 'React is defined but never used'}], ecmaFeatures: {jsx: true}}, - {code: '/*eslint jsx-uses-react:1*/ /** @jsx Foo */ var React;
;', - errors: [{message: 'React is defined but never used'}], ecmaFeatures: {jsx: true}} - ] + valid: [ + {code: '/*eslint jsx-uses-react:1*/ var React;
;', ecmaFeatures: {jsx: true}}, + {code: '/*eslint jsx-uses-react:1*/ var React; (function () {
})();', ecmaFeatures: {jsx: true}}, + {code: '/*eslint jsx-uses-react:1*/ /** @jsx Foo */ var Foo;
;', ecmaFeatures: {jsx: true}}, + {code: '/*eslint jsx-uses-react:[1,{"pragma":"Foo"}]*/ var Foo;
;', ecmaFeatures: {jsx: true}} + ], + invalid: [ + {code: '/*eslint jsx-uses-react:1*/ var React;', + errors: [{message: 'React is defined but never used'}], ecmaFeatures: {jsx: true}}, + {code: '/*eslint jsx-uses-react:1*/ /** @jsx Foo */ var React;
;', + errors: [{message: 'React is defined but never used'}], ecmaFeatures: {jsx: true}} + ] }); diff --git a/tests/lib/rules/no-danger.js b/tests/lib/rules/no-danger.js index e76a666e05..b9ce49c191 100644 --- a/tests/lib/rules/no-danger.js +++ b/tests/lib/rules/no-danger.js @@ -27,6 +27,5 @@ eslintTester.addRuleTest('lib/rules/no-danger', { code: '
;', errors: [{message: 'Dangerous property \'dangerouslySetInnerHTML\' found'}], ecmaFeatures: {jsx: true} - } - ] + }] }); diff --git a/tests/lib/rules/no-did-mount-set-state.js b/tests/lib/rules/no-did-mount-set-state.js index 59c840bdf6..2753cdcb32 100644 --- a/tests/lib/rules/no-did-mount-set-state.js +++ b/tests/lib/rules/no-did-mount-set-state.js @@ -92,9 +92,9 @@ eslintTester.addRuleTest('lib/rules/no-did-mount-set-state', { code: [ 'var Hello = React.createClass({', ' componentDidMount: function() {', - ' this.setState({', - ' data: data', - ' });', + ' this.setState({', + ' data: data', + ' });', ' }', '});' ].join('\n'), @@ -108,9 +108,9 @@ eslintTester.addRuleTest('lib/rules/no-did-mount-set-state', { code: [ 'var Hello = React.createClass({', ' componentDidMount: function() {', - ' this.setState({', - ' data: data', - ' });', + ' this.setState({', + ' data: data', + ' });', ' }', '});' ].join('\n'), diff --git a/tests/lib/rules/no-unknown-property.js b/tests/lib/rules/no-unknown-property.js index 18cd54edff..df3d4c10a0 100644 --- a/tests/lib/rules/no-unknown-property.js +++ b/tests/lib/rules/no-unknown-property.js @@ -30,19 +30,19 @@ eslintTester.addRuleTest('lib/rules/no-unknown-property', { code: '
;', errors: [{message: 'Unknown property \'class\' found, use \'className\' instead'}], ecmaFeatures: {jsx: true} - }, { + }, { code: '
;', errors: [{message: 'Unknown property \'for\' found, use \'htmlFor\' instead'}], ecmaFeatures: {jsx: true} - }, { + }, { code: '
;', errors: [{message: 'Unknown property \'accept-charset\' found, use \'acceptCharset\' instead'}], ecmaFeatures: {jsx: true} - }, { + }, { code: '
;', errors: [{message: 'Unknown property \'http-equiv\' found, use \'httpEquiv\' instead'}], ecmaFeatures: {jsx: true} - }, { + }, { code: '
;', errors: [{message: 'Unknown property \'accesskey\' found, use \'accessKey\' instead'}], ecmaFeatures: {jsx: true}} diff --git a/tests/lib/rules/prop-types.js b/tests/lib/rules/prop-types.js index 56c4b607a9..422f4834d3 100644 --- a/tests/lib/rules/prop-types.js +++ b/tests/lib/rules/prop-types.js @@ -583,7 +583,8 @@ eslintTester.addRuleTest('lib/rules/prop-types', { classes: true, jsx: true } - }], + } + ], invalid: [ { @@ -600,7 +601,7 @@ eslintTester.addRuleTest('lib/rules/prop-types', { errors: [{ message: '\'name\' is missing in props validation', line: 3, - column: 53, + column: 54, type: 'Identifier' }] }, { @@ -617,7 +618,7 @@ eslintTester.addRuleTest('lib/rules/prop-types', { errors: [{ message: '\'name\' is missing in props validation', line: 3, - column: 34, + column: 35, type: 'Identifier' }] }, { @@ -635,7 +636,7 @@ eslintTester.addRuleTest('lib/rules/prop-types', { errors: [{ message: '\'name\' is missing in props validation for Hello', line: 3, - column: 34, + column: 35, type: 'Identifier' }] }, { diff --git a/tests/lib/rules/react-in-jsx-scope.js b/tests/lib/rules/react-in-jsx-scope.js index 88c07bcefa..5457a33b29 100644 --- a/tests/lib/rules/react-in-jsx-scope.js +++ b/tests/lib/rules/react-in-jsx-scope.js @@ -18,39 +18,43 @@ var ESLintTester = require('eslint-tester'); var eslintTester = new ESLintTester(eslint); eslintTester.addRuleTest('lib/rules/react-in-jsx-scope', { - valid: [ - {code: 'var React, App; ;', ecmaFeatures: {jsx: true}}, - {code: 'var React; ;', ecmaFeatures: {jsx: true}}, - {code: 'var React; ;', ecmaFeatures: {jsx: true}}, - {code: 'var React, App, a=1; ;', ecmaFeatures: {jsx: true}}, - {code: 'var React, App, a=1; function elem() { return ; }', ecmaFeatures: {jsx: true}}, - {code: 'var React, App; ;', ecmaFeatures: {globalReturn: true, jsx: true}}, - {code: '/** @jsx Foo */ var Foo, App; ;', ecmaFeatures: {jsx: true}}, - {code: '/** @jsx Foo.Bar */ var Foo, App; ;', ecmaFeatures: {jsx: true}}, - {code: [ - 'import React from \'react/addons\';', - 'const Button = React.createClass({', - ' render() {', - ' return (', - ' ', - ' )', - ' }', - '});', - 'export default Button;' - ].join('\n'), - ecmaFeatures: {blockBindings: true, objectLiteralShorthandMethods: true, modules: true, jsx: true} - } - ], - invalid: [ - {code: 'var App, a = ;', - errors: [{message: '\'React\' must be in scope when using JSX'}], ecmaFeatures: {jsx: true}}, - {code: 'var a = ;', - errors: [{message: '\'React\' must be in scope when using JSX'}], ecmaFeatures: {jsx: true}}, - {code: 'var a = ;', - errors: [{message: '\'React\' must be in scope when using JSX'}], ecmaFeatures: {jsx: true}}, - {code: '/** @jsx React.DOM */ var a = ;', - errors: [{message: '\'React\' must be in scope when using JSX'}], ecmaFeatures: {jsx: true}}, - {code: '/** @jsx Foo.bar */ var React, a = ;', - errors: [{message: '\'Foo\' must be in scope when using JSX'}], ecmaFeatures: {jsx: true}} - ] + valid: [ + {code: 'var React, App; ;', ecmaFeatures: {jsx: true}}, + {code: 'var React; ;', ecmaFeatures: {jsx: true}}, + {code: 'var React; ;', ecmaFeatures: {jsx: true}}, + {code: 'var React, App, a=1; ;', ecmaFeatures: {jsx: true}}, + {code: 'var React, App, a=1; function elem() { return ; }', ecmaFeatures: {jsx: true}}, + {code: 'var React, App; ;', ecmaFeatures: {globalReturn: true, jsx: true}}, + {code: '/** @jsx Foo */ var Foo, App; ;', ecmaFeatures: {jsx: true}}, + {code: '/** @jsx Foo.Bar */ var Foo, App; ;', ecmaFeatures: {jsx: true}}, + {code: [ + 'import React from \'react/addons\';', + 'const Button = React.createClass({', + ' render() {', + ' return (', + ' ', + ' )', + ' }', + '});', + 'export default Button;' + ].join('\n'), + ecmaFeatures: { + blockBindings: true, + objectLiteralShorthandMethods: true, + modules: true, + jsx: true + }} + ], + invalid: [ + {code: 'var App, a = ;', + errors: [{message: '\'React\' must be in scope when using JSX'}], ecmaFeatures: {jsx: true}}, + {code: 'var a = ;', + errors: [{message: '\'React\' must be in scope when using JSX'}], ecmaFeatures: {jsx: true}}, + {code: 'var a = ;', + errors: [{message: '\'React\' must be in scope when using JSX'}], ecmaFeatures: {jsx: true}}, + {code: '/** @jsx React.DOM */ var a = ;', + errors: [{message: '\'React\' must be in scope when using JSX'}], ecmaFeatures: {jsx: true}}, + {code: '/** @jsx Foo.bar */ var React, a = ;', + errors: [{message: '\'Foo\' must be in scope when using JSX'}], ecmaFeatures: {jsx: true}} + ] }); diff --git a/tests/lib/rules/require-extension.js b/tests/lib/rules/require-extension.js index 3e48542a19..e20c46db4c 100644 --- a/tests/lib/rules/require-extension.js +++ b/tests/lib/rules/require-extension.js @@ -34,62 +34,62 @@ var REQUIRE_OBJECT = 'require({})'; var eslintTester = new ESLintTester(eslint); eslintTester.addRuleTest('lib/rules/require-extension', { - valid: [ - { - code: REQUIRE_PACKAGE - }, { - code: REQUIRE_JS - }, { - code: REQUIRE_JSON - }, { - code: REQUIRE_EMPTY - }, { - code: REQUIRE_OBJECT - }, { - code: REQUIRE_PACKAGE, - args: [1] - }, { - code: REQUIRE_JS, - args: [1] - }, { - code: REQUIRE_JSON, - args: [1] - }, { - code: REQUIRE_EMPTY, - args: [1] - }, { - code: REQUIRE_OBJECT, - args: [1] - }, { - code: REQUIRE_JSON, - args: [1, {extensions: ['.js']}] - }, { - code: REQUIRE_JSX, - args: [1, {extensions: ['.js']}] - } - ], + valid: [ + { + code: REQUIRE_PACKAGE + }, { + code: REQUIRE_JS + }, { + code: REQUIRE_JSON + }, { + code: REQUIRE_EMPTY + }, { + code: REQUIRE_OBJECT + }, { + code: REQUIRE_PACKAGE, + args: [1] + }, { + code: REQUIRE_JS, + args: [1] + }, { + code: REQUIRE_JSON, + args: [1] + }, { + code: REQUIRE_EMPTY, + args: [1] + }, { + code: REQUIRE_OBJECT, + args: [1] + }, { + code: REQUIRE_JSON, + args: [1, {extensions: ['.js']}] + }, { + code: REQUIRE_JSX, + args: [1, {extensions: ['.js']}] + } + ], - invalid: [ - { - code: REQUIRE_JSX, - errors: [{message: 'Unable to require module with extension \'.jsx\''}] - }, { - code: REQUIRE_JSX, - args: [1], - errors: [{message: 'Unable to require module with extension \'.jsx\''}] - }, { - code: REQUIRE_JS, - args: [1, {extensions: ['.js']}], - errors: [{message: 'Unable to require module with extension \'.js\''}] - }, { - code: REQUIRE_JS, - args: [1, {extensions: ['.js', '.jsx']}], - errors: [{message: 'Unable to require module with extension \'.js\''}] - }, { - code: REQUIRE_JSX, - args: [1, {extensions: ['.js', '.jsx']}], - errors: [{message: 'Unable to require module with extension \'.jsx\''}] - } - ] + invalid: [ + { + code: REQUIRE_JSX, + errors: [{message: 'Unable to require module with extension \'.jsx\''}] + }, { + code: REQUIRE_JSX, + args: [1], + errors: [{message: 'Unable to require module with extension \'.jsx\''}] + }, { + code: REQUIRE_JS, + args: [1, {extensions: ['.js']}], + errors: [{message: 'Unable to require module with extension \'.js\''}] + }, { + code: REQUIRE_JS, + args: [1, {extensions: ['.js', '.jsx']}], + errors: [{message: 'Unable to require module with extension \'.js\''}] + }, { + code: REQUIRE_JSX, + args: [1, {extensions: ['.js', '.jsx']}], + errors: [{message: 'Unable to require module with extension \'.jsx\''}] + } + ] }); diff --git a/tests/lib/rules/self-closing-comp.js b/tests/lib/rules/self-closing-comp.js index 12f07e7334..490d28f1b4 100644 --- a/tests/lib/rules/self-closing-comp.js +++ b/tests/lib/rules/self-closing-comp.js @@ -18,58 +18,58 @@ var ESLintTester = require('eslint-tester'); var eslintTester = new ESLintTester(eslint); eslintTester.addRuleTest('lib/rules/self-closing-comp', { - valid: [ - { - code: 'var contentContainer =
;', - ecmaFeatures: { - jsx: true - } - }, { - code: 'var HelloJohn = ;', - ecmaFeatures: { - jsx: true - } - }, { - code: 'var Profile = ;', - ecmaFeatures: { - jsx: true - } - }, { - code: '\ - \ - \ - ', - ecmaFeatures: { - jsx: true - } - } - ], + valid: [ + { + code: 'var contentContainer =
;', + ecmaFeatures: { + jsx: true + } + }, { + code: 'var HelloJohn = ;', + ecmaFeatures: { + jsx: true + } + }, { + code: 'var Profile = ;', + ecmaFeatures: { + jsx: true + } + }, { + code: '\ + \ + \ + ', + ecmaFeatures: { + jsx: true + } + } + ], - invalid: [ - { - code: 'var HelloJohn = ;', - ecmaFeatures: { - jsx: true - }, - errors: [{ - message: 'Empty components are self-closing' - }] - }, { - code: 'var HelloJohn = \n;', - ecmaFeatures: { - jsx: true - }, - errors: [{ - message: 'Empty components are self-closing' - }] - }, { - code: 'var HelloJohn = ;', - ecmaFeatures: { - jsx: true - }, - errors: [{ - message: 'Empty components are self-closing' - }] - } - ] + invalid: [ + { + code: 'var HelloJohn = ;', + ecmaFeatures: { + jsx: true + }, + errors: [{ + message: 'Empty components are self-closing' + }] + }, { + code: 'var HelloJohn = \n;', + ecmaFeatures: { + jsx: true + }, + errors: [{ + message: 'Empty components are self-closing' + }] + }, { + code: 'var HelloJohn = ;', + ecmaFeatures: { + jsx: true + }, + errors: [{ + message: 'Empty components are self-closing' + }] + } + ] }); diff --git a/tests/lib/rules/wrap-multilines.js b/tests/lib/rules/wrap-multilines.js index aa32d87769..c816a73b51 100644 --- a/tests/lib/rules/wrap-multilines.js +++ b/tests/lib/rules/wrap-multilines.js @@ -79,69 +79,69 @@ var ASSIGNMENT_NO_PAREN = '\ var eslintTester = new ESLintTester(eslint); eslintTester.addRuleTest('lib/rules/wrap-multilines', { - valid: [ - { - code: RETURN_SINGLE_LINE, - ecmaFeatures: {jsx: true} - }, { - code: RETURN_PAREN, - ecmaFeatures: {jsx: true} - }, { - code: RETURN_NO_PAREN, - args: [1, {return: false}], - ecmaFeatures: {jsx: true} - }, { - code: DECLARATION_SINGLE_LINE, - ecmaFeatures: {jsx: true} - }, { - code: DECLARATION_PAREN, - ecmaFeatures: {jsx: true} - }, { - code: DECLARATION_NO_PAREN, - args: [1, {declaration: false}], - ecmaFeatures: {jsx: true} - }, { - code: ASSIGNMENT_SINGLE_LINE, - args: [1, {declaration: false}], - ecmaFeatures: {jsx: true} - }, { - code: ASSIGNMENT_PAREN, - ecmaFeatures: {jsx: true} - }, { - code: ASSIGNMENT_NO_PAREN, - args: [1, {assignment: false}], - ecmaFeatures: {jsx: true} - } - ], - - invalid: [ - { - code: RETURN_NO_PAREN, - ecmaFeatures: {jsx: true}, - errors: [{message: 'Missing parentheses around multilines JSX'}] - }, { - code: RETURN_NO_PAREN, - ecmaFeatures: {jsx: true}, - args: [1, {return: true}], - errors: [{message: 'Missing parentheses around multilines JSX'}] - }, { - code: DECLARATION_NO_PAREN, - ecmaFeatures: {jsx: true}, - errors: [{message: 'Missing parentheses around multilines JSX'}] - }, { - code: DECLARATION_NO_PAREN, - ecmaFeatures: {jsx: true}, - args: [1, {declaration: true}], - errors: [{message: 'Missing parentheses around multilines JSX'}] - }, { - code: ASSIGNMENT_NO_PAREN, - ecmaFeatures: {jsx: true}, - errors: [{message: 'Missing parentheses around multilines JSX'}] - }, { - code: ASSIGNMENT_NO_PAREN, - ecmaFeatures: {jsx: true}, - args: [1, {assignment: true}], - errors: [{message: 'Missing parentheses around multilines JSX'}] - } - ] + valid: [ + { + code: RETURN_SINGLE_LINE, + ecmaFeatures: {jsx: true} + }, { + code: RETURN_PAREN, + ecmaFeatures: {jsx: true} + }, { + code: RETURN_NO_PAREN, + args: [1, {return: false}], + ecmaFeatures: {jsx: true} + }, { + code: DECLARATION_SINGLE_LINE, + ecmaFeatures: {jsx: true} + }, { + code: DECLARATION_PAREN, + ecmaFeatures: {jsx: true} + }, { + code: DECLARATION_NO_PAREN, + args: [1, {declaration: false}], + ecmaFeatures: {jsx: true} + }, { + code: ASSIGNMENT_SINGLE_LINE, + args: [1, {declaration: false}], + ecmaFeatures: {jsx: true} + }, { + code: ASSIGNMENT_PAREN, + ecmaFeatures: {jsx: true} + }, { + code: ASSIGNMENT_NO_PAREN, + args: [1, {assignment: false}], + ecmaFeatures: {jsx: true} + } + ], + + invalid: [ + { + code: RETURN_NO_PAREN, + ecmaFeatures: {jsx: true}, + errors: [{message: 'Missing parentheses around multilines JSX'}] + }, { + code: RETURN_NO_PAREN, + ecmaFeatures: {jsx: true}, + args: [1, {return: true}], + errors: [{message: 'Missing parentheses around multilines JSX'}] + }, { + code: DECLARATION_NO_PAREN, + ecmaFeatures: {jsx: true}, + errors: [{message: 'Missing parentheses around multilines JSX'}] + }, { + code: DECLARATION_NO_PAREN, + ecmaFeatures: {jsx: true}, + args: [1, {declaration: true}], + errors: [{message: 'Missing parentheses around multilines JSX'}] + }, { + code: ASSIGNMENT_NO_PAREN, + ecmaFeatures: {jsx: true}, + errors: [{message: 'Missing parentheses around multilines JSX'}] + }, { + code: ASSIGNMENT_NO_PAREN, + ecmaFeatures: {jsx: true}, + args: [1, {assignment: true}], + errors: [{message: 'Missing parentheses around multilines JSX'}] + } + ] });