Require parenthesis around "TSAsExpression" inside an "UpdateExpression" (#4183)
This commit is contained in:
1 parent
5b8e0e6201
commit
24f45d1b50
3 files changed
+4
No files matched your search
@@ -320,6 +320,7 @@ FastPath.prototype.needsParens = function(options) {
|
||||
case "AwaitExpression":
|
||||
case "TSAsExpression":
|
||||
case "TSNonNullExpression":
|
||||
case "UpdateExpression":
|
||||
return true;
|
||||
|
||||
case "MemberExpression":
|
||||
|
||||
@@ -24,6 +24,7 @@ const state = JSON.stringify({
|
||||
} as State);
|
||||
|
||||
(foo.bar as Baz) = [bar];
|
||||
(foo.bar as any)++;
|
||||
|
||||
(bValue as boolean) ? 0 : -1;
|
||||
<boolean>bValue ? 0 : -1;
|
||||
@@ -59,6 +60,7 @@ const state = JSON.stringify({
|
||||
} as State);
|
||||
|
||||
(foo.bar as Baz) = [bar];
|
||||
(foo.bar as any)++;
|
||||
|
||||
(bValue as boolean) ? 0 : -1;
|
||||
<boolean>bValue ? 0 : -1;
|
||||
|
||||
@@ -21,6 +21,7 @@ const state = JSON.stringify({
|
||||
} as State);
|
||||
|
||||
(foo.bar as Baz) = [bar];
|
||||
(foo.bar as any)++;
|
||||
|
||||
(bValue as boolean) ? 0 : -1;
|
||||
<boolean>bValue ? 0 : -1;
|
||||
|
||||
Reference in new issue
Block a user