Remove useless optional chaining (#18677)
This commit is contained in:
1 parent
719373fb75
commit
42d384d148
1 file changed
+2
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user