File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
test/query-tests/Declarations/UnusedVariable Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,12 @@ predicate whitelisted(UnusedLocal v) {
156156 isEnumMember ( vd ) or
157157 // ignore ambient declarations - too noisy
158158 vd .isAmbient ( )
159+ ) or
160+ exists ( DirectEval eval |
161+ // eval nearby
162+ eval .getEnclosingFunction ( ) = v .getADeclaration ( ) .getEnclosingFunction ( ) and
163+ // ... but not on the RHS
164+ not v .getAnAssignedExpr ( ) = eval
159165 )
160166}
161167
Original file line number Diff line number Diff line change 11| decorated.ts:1:1:1:126 | import ... where'; | Unused import actionHandler. |
22| decorated.ts:4:10:4:12 | fun | Unused function fun. |
3- | eval.js:2:9:2:20 | used_by_eval | Unused variable used_by_eval. |
4- | eval.js:7:9:7:20 | used_by_eval | Unused variable used_by_eval. |
53| eval.js:10:9:10:24 | not_used_by_eval | Unused variable not_used_by_eval. |
64| eval.js:19:9:19:24 | not_used_by_eval | Unused variable not_used_by_eval. |
75| externs.js:6:5:6:13 | iAmUnused | Unused variable iAmUnused. |
You can’t perform that action at this time.
0 commit comments