CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.8.15-dev (changelog, source)
Search

Predicate maybeCausedByTemplate

Holds if e may be caused by parsing a template file as plain HTML or JavaScript.

We use two heuristics: check for the presence of a known template delimiter preceding the error on the same line, and check whether the file name contains template or templates.

Import path

import semmle.javascript.filters.ClassifyFiles
predicate maybeCausedByTemplate(JSParseError e)