exclude "@babel/helpers - .." from js/unknown-directive

This commit is contained in:
Erik Krogh Kristensen
2020-05-11 12:42:18 +02:00
parent 964b8478dc
commit acb0f2e54f

View File

@@ -16,5 +16,7 @@ where
// ignore ":" pseudo-directive sometimes seen in dual-use shell/node.js scripts // ignore ":" pseudo-directive sometimes seen in dual-use shell/node.js scripts
not d.getExpr().getStringValue() = ":" and not d.getExpr().getStringValue() = ":" and
// but exclude attribute top-levels: `<a href="javascript:'some-attribute-string'">` // but exclude attribute top-levels: `<a href="javascript:'some-attribute-string'">`
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)") + "'." select d, "Unknown directive: '" + truncate(d.getDirectiveText(), 20, " ... (truncated)") + "'."