diff --git a/crates/oxc_formatter/src/parentheses/expression.rs b/crates/oxc_formatter/src/parentheses/expression.rs index 4c44e6abac999..7268a9e99be70 100644 --- a/crates/oxc_formatter/src/parentheses/expression.rs +++ b/crates/oxc_formatter/src/parentheses/expression.rs @@ -662,6 +662,7 @@ impl<'a> NeedsParentheses<'a> for AstNode<'a, TSTypeAssertion<'a>> { | AstNodes::IdentifierReference(_) | AstNodes::AssignmentExpression(_) | AstNodes::AssignmentTargetWithDefault(_) + | AstNodes::UpdateExpression(_) ) } } @@ -937,6 +938,7 @@ fn ts_as_or_satisfies_needs_parens(parent: &AstNodes<'_>) -> bool { | AstNodes::PrivateFieldExpression(_) | AstNodes::AssignmentExpression(_) | AstNodes::AssignmentTargetWithDefault(_) + | AstNodes::UpdateExpression(_) ) } diff --git a/tasks/coverage/snapshots/formatter_typescript.snap b/tasks/coverage/snapshots/formatter_typescript.snap index 2dde527ac4768..f984274b4845c 100644 --- a/tasks/coverage/snapshots/formatter_typescript.snap +++ b/tasks/coverage/snapshots/formatter_typescript.snap @@ -2,7 +2,7 @@ commit: 261630d6 formatter_typescript Summary: AST Parsed : 8816/8816 (100.00%) -Positive Passed: 8757/8816 (99.33%) +Positive Passed: 8758/8816 (99.34%) Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/APISample_jsdoc.ts Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/amdLikeInputDeclarationEmit.ts @@ -45,8 +45,6 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/readonlyAssignme Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/reducibleIndexedAccessTypes.ts -Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/referenceSatisfiesExpression.ts - Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/reverseMappedTypeInferenceSameSource1.ts Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/sourceMapValidationClasses.ts diff --git a/tasks/prettier_conformance/snapshots/prettier.ts.snap.md b/tasks/prettier_conformance/snapshots/prettier.ts.snap.md index b54a435bf3202..faf3bd4f81eb7 100644 --- a/tasks/prettier_conformance/snapshots/prettier.ts.snap.md +++ b/tasks/prettier_conformance/snapshots/prettier.ts.snap.md @@ -1,4 +1,4 @@ -ts compatibility: 350/573 (61.08%) +ts compatibility: 351/573 (61.26%) # Failed @@ -18,7 +18,7 @@ ts compatibility: 350/573 (61.08%) | typescript/array/comment.ts | 💥 | 87.50% | | typescript/arrow/16067.ts | 💥💥 | 95.92% | | typescript/arrow/comments.ts | 💥✨ | 44.44% | -| typescript/as/as.ts | 💥 | 67.72% | +| typescript/as/as.ts | 💥 | 69.29% | | typescript/as/assignment.ts | 💥 | 86.67% | | typescript/as/assignment2.ts | 💥 | 94.12% | | typescript/as/export_default_as.ts | 💥 | 0.00% | @@ -225,5 +225,4 @@ ts compatibility: 350/573 (61.08%) | typescript/union/consistent-with-flow/single-type.ts | 💥 | 3.39% | | typescript/union/consistent-with-flow/within-tuple.ts | 💥 | 16.51% | | typescript/union/single-type/single-type.ts | 💥 | 33.33% | -| typescript/update-expression/update-expressions.ts | 💥 | 81.25% | | typescript/webhost/webtsc.ts | 💥 | 99.08% |