diff --git a/lib/rules/no-object-constructor.js b/lib/rules/no-object-constructor.js index 0659d163381..e3ac2095734 100644 --- a/lib/rules/no-object-constructor.js +++ b/lib/rules/no-object-constructor.js @@ -35,10 +35,10 @@ const NODE_TYPES_BY_KEYWORD = { }; /* - * Before an opening parenthesis, `>` (for JSX), and postfix `++` and `--` always trigger ASI; + * Before an opening parenthesis, postfix `++` and `--` always trigger ASI; * the tokens `:`, `;`, `{` and `=>` don't expect a semicolon, as that would count as an empty statement. */ -const PUNCTUATORS = new Set([":", ";", ">", "{", "=>", "++", "--"]); +const PUNCTUATORS = new Set([":", ";", "{", "=>", "++", "--"]); /* * Statements that can contain an `ExpressionStatement` after a closing parenthesis. diff --git a/tests/lib/rules/no-object-constructor.js b/tests/lib/rules/no-object-constructor.js index 4d51f2a21d6..464a0779bc7 100644 --- a/tests/lib/rules/no-object-constructor.js +++ b/tests/lib/rules/no-object-constructor.js @@ -168,6 +168,20 @@ ruleTester.run("no-object-constructor", rule, { var foo = { bar: baz } Object() ` + }, + { + code: ` + + Object() + `, + parserOptions: { ecmaFeatures: { jsx: true } } + }, + { + code: ` + + Object() + `, + parserOptions: { ecmaFeatures: { jsx: true } } } ].map(props => ({ ...props, @@ -296,20 +310,6 @@ ruleTester.run("no-object-constructor", rule, { Object() ` }, - { - code: ` - - Object() - `, - parserOptions: { ecmaFeatures: { jsx: true } } - }, - { - code: ` - - Object() - `, - parserOptions: { ecmaFeatures: { jsx: true } } - }, { code: ` const foo = bar