Remove useless optional chaining (#18677)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-01-18 08:32:47 +08:00
1 parent 719373fb75
commit 42d384d148
1 file changed
+2 -1
+2 -1
View File
@@ -138,8 +138,9 @@ function postprocess(ast, options) {
// fix unexpected locEnd caused by --no-semi style
case "VariableDeclaration": {
const lastDeclaration = node.declarations.at(-1);
if (lastDeclaration?.init && text[locEnd(lastDeclaration)] !== ";") {
if (lastDeclaration.init && text[locEnd(lastDeclaration)] !== ";") {
node.range = [locStart(node), locEnd(lastDeclaration)];
break;
}
break;
}