Fix redundant parens around JSX inside NewExpressions (#6980)
This commit is contained in:
1 parent
cf78341e98
commit
dd16afd1e7
3 files changed
+28
No files matched your search
@@ -745,6 +745,7 @@ function needsParens(path, options) {
|
||||
parent.type !== "AssignmentPattern" &&
|
||||
parent.type !== "BinaryExpression" &&
|
||||
parent.type !== "CallExpression" &&
|
||||
parent.type !== "NewExpression" &&
|
||||
parent.type !== "ConditionalExpression" &&
|
||||
parent.type !== "ExpressionStatement" &&
|
||||
parent.type !== "JsExpressionRoot" &&
|
||||
|
||||
@@ -4097,6 +4097,9 @@ f?.(<div/>);
|
||||
(<div/>)();
|
||||
(<div/>)?.();
|
||||
|
||||
new Foo(<Component/>);
|
||||
new Foo((<Component/>))
|
||||
|
||||
=====================================output=====================================
|
||||
a = [
|
||||
<path
|
||||
@@ -4115,6 +4118,9 @@ f?.(<div />);
|
||||
(<div />)();
|
||||
(<div />)?.();
|
||||
|
||||
new Foo(<Component />);
|
||||
new Foo(<Component />);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
@@ -4143,6 +4149,9 @@ f?.(<div/>);
|
||||
(<div/>)();
|
||||
(<div/>)?.();
|
||||
|
||||
new Foo(<Component/>);
|
||||
new Foo((<Component/>))
|
||||
|
||||
=====================================output=====================================
|
||||
a = [
|
||||
<path
|
||||
@@ -4161,6 +4170,9 @@ f?.(<div />);
|
||||
(<div />)();
|
||||
(<div />)?.();
|
||||
|
||||
new Foo(<Component />);
|
||||
new Foo(<Component />);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
@@ -4189,6 +4201,9 @@ f?.(<div/>);
|
||||
(<div/>)();
|
||||
(<div/>)?.();
|
||||
|
||||
new Foo(<Component/>);
|
||||
new Foo((<Component/>))
|
||||
|
||||
=====================================output=====================================
|
||||
a = [
|
||||
<path
|
||||
@@ -4207,6 +4222,9 @@ f?.(<div />);
|
||||
(<div />)();
|
||||
(<div />)?.();
|
||||
|
||||
new Foo(<Component />);
|
||||
new Foo(<Component />);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
@@ -4235,6 +4253,9 @@ f?.(<div/>);
|
||||
(<div/>)();
|
||||
(<div/>)?.();
|
||||
|
||||
new Foo(<Component/>);
|
||||
new Foo((<Component/>))
|
||||
|
||||
=====================================output=====================================
|
||||
a = [
|
||||
<path
|
||||
@@ -4253,6 +4274,9 @@ f?.(<div />);
|
||||
(<div />)();
|
||||
(<div />)?.();
|
||||
|
||||
new Foo(<Component />);
|
||||
new Foo(<Component />);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
|
||||
@@ -14,3 +14,6 @@ a = [
|
||||
f?.(<div/>);
|
||||
(<div/>)();
|
||||
(<div/>)?.();
|
||||
|
||||
new Foo(<Component/>);
|
||||
new Foo((<Component/>))
|
||||
Reference in new issue
Block a user