From acb0f2e54fc06b0075c0534f41e2bc05ee8334c9 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 11 May 2020 12:42:18 +0200 Subject: [PATCH] exclude "@babel/helpers - .." from js/unknown-directive --- javascript/ql/src/Expressions/UnknownDirective.ql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)") + "'."