Skip to content

Commit 11c02ed

Browse files
committed
fix type error
1 parent fcb9d0e commit 11c02ed

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/utils/ast/js/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ const VISITORS = {
335335
node: ESLintBinaryExpression,
336336
context: RuleContext,
337337
): SubPathData {
338+
if (node.left.type === "PrivateIdentifier") {
339+
return UNKNOWN_PATH_DATA
340+
}
338341
const leftData = getPathData(node.left, context)
339342
if (leftData.data === UNKNOWN) {
340343
return UNKNOWN_PATH_DATA
@@ -476,10 +479,11 @@ const VISITORS = {
476479
}
477480
expressions.push(data.data)
478481
}
479-
let data = node.quasis[0].value.cooked
482+
let data = node.quasis[0].value.cooked ?? node.quasis[0].value.raw
480483
for (let i = 0; i < expressions.length; ++i) {
481484
data += expressions[i]
482-
data += node.quasis[i + 1].value.cooked
485+
data +=
486+
node.quasis[i + 1].value.cooked ?? node.quasis[i + 1].value.raw
483487
}
484488
return { data, children: EMPTY_MAP }
485489
},
@@ -537,6 +541,9 @@ const VISITORS = {
537541
AwaitExpression() {
538542
return UNKNOWN_PATH_DATA
539543
},
544+
ChainExpression() {
545+
return UNKNOWN_PATH_DATA
546+
},
540547
}
541548

542549
/**

0 commit comments

Comments
 (0)