diff --git a/javascript/ql/src/Expressions/UnknownDirective.ql b/javascript/ql/src/Expressions/UnknownDirective.ql index 4f027db6bbc..48d1ea63e06 100644 --- a/javascript/ql/src/Expressions/UnknownDirective.ql +++ b/javascript/ql/src/Expressions/UnknownDirective.ql @@ -16,5 +16,7 @@ where // ignore ":" pseudo-directive sometimes seen in dual-use shell/node.js scripts not d.getExpr().getStringValue() = ":" and // but exclude attribute top-levels: `` - not d.getParent() instanceof CodeInAttribute + not d.getParent() instanceof CodeInAttribute and + // exclude babel generated directives like "@babel/helpers - typeof". + not d.getDirectiveText().prefix(14) = "@babel/helpers" select d, "Unknown directive: '" + truncate(d.getDirectiveText(), 20, " ... (truncated)") + "'."