Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb329ea7

Browse files
authored
fix: add; after JSX nodes inno-object-constructor autofix (#17672)
Fix `no-object-constructor` autofix after JSX nodes
1 parent994596b commitb329ea7

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

‎lib/rules/no-object-constructor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ const NODE_TYPES_BY_KEYWORD = {
3535
};
3636

3737
/*
38-
* Before an opening parenthesis,`>` (for JSX), andpostfix `++` and `--` always trigger ASI;
38+
* Before an opening parenthesis, postfix `++` and `--` always trigger ASI;
3939
* the tokens `:`, `;`, `{` and `=>` don't expect a semicolon, as that would count as an empty statement.
4040
*/
41-
constPUNCTUATORS=newSet([":",";",">","{","=>","++","--"]);
41+
constPUNCTUATORS=newSet([":",";","{","=>","++","--"]);
4242

4343
/*
4444
* Statements that can contain an `ExpressionStatement` after a closing parenthesis.

‎tests/lib/rules/no-object-constructor.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,20 @@ ruleTester.run("no-object-constructor", rule, {
168168
var foo = { bar: baz }
169169
Object()
170170
`
171+
},
172+
{
173+
code:`
174+
<foo />
175+
Object()
176+
`,
177+
parserOptions:{ecmaFeatures:{jsx:true}}
178+
},
179+
{
180+
code:`
181+
<foo></foo>
182+
Object()
183+
`,
184+
parserOptions:{ecmaFeatures:{jsx:true}}
171185
}
172186
].map(props=>({
173187
...props,
@@ -296,20 +310,6 @@ ruleTester.run("no-object-constructor", rule, {
296310
Object()
297311
`
298312
},
299-
{
300-
code:`
301-
<foo />
302-
Object()
303-
`,
304-
parserOptions:{ecmaFeatures:{jsx:true}}
305-
},
306-
{
307-
code:`
308-
<foo></foo>
309-
Object()
310-
`,
311-
parserOptions:{ecmaFeatures:{jsx:true}}
312-
},
313313
{
314314
code:`
315315
const foo = bar

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp