mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge pull request #383 from esben-semmle/js/unused-eval-variable
Approved by xiemaisi
This commit is contained in:
@@ -163,6 +163,12 @@ predicate whitelisted(UnusedLocal v) {
|
||||
isEnumMember(vd) or
|
||||
// ignore ambient declarations - too noisy
|
||||
vd.isAmbient()
|
||||
) or
|
||||
exists (DirectEval eval |
|
||||
// eval nearby
|
||||
eval.getEnclosingFunction() = v.getADeclaration().getEnclosingFunction() and
|
||||
// ... but not on the RHS
|
||||
not v.getAnAssignedExpr() = eval
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user