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

Predicate isDeclaration

Holds if e is of the form x; or e.p; and has a JSDoc comment containing a tag. In that case, it is probably meant as a declaration and shouldn’t be flagged by this query.

This will still flag cases where the JSDoc comment contains no tag at all (and hence carries no semantic information), and expression statements with an ordinary (non-JSDoc) comment attached to them.

Import path

import Expressions.ExprHasNoEffect
predicate isDeclaration(Expr e)