Skip to content

Commit acb0f2e

Browse files
committed
exclude "@babel/helpers - .." from js/unknown-directive
1 parent 964b847 commit acb0f2e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

javascript/ql/src/Expressions/UnknownDirective.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ where
1616
// ignore ":" pseudo-directive sometimes seen in dual-use shell/node.js scripts
1717
not d.getExpr().getStringValue() = ":" and
1818
// but exclude attribute top-levels: `<a href="javascript:'some-attribute-string'">`
19-
not d.getParent() instanceof CodeInAttribute
19+
not d.getParent() instanceof CodeInAttribute and
20+
// exclude babel generated directives like "@babel/helpers - typeof".
21+
not d.getDirectiveText().prefix(14) = "@babel/helpers"
2022
select d, "Unknown directive: '" + truncate(d.getDirectiveText(), 20, " ... (truncated)") + "'."

0 commit comments

Comments
 (0)