Require parenthesis around "TSAsExpression" inside an "UpdateExpression" (#4183)

This commit is contained in:
Jeff Lau authored and Lucas Duailibe committed 2018-03-21 11:38:10 -03:00
1 parent 5b8e0e6201
commit 24f45d1b50
3 files changed
+4

No files matched your search

+1
View File
@@ -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;
+1
View File
@@ -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;