(
currentScope: TSESLint.Scope.Scope,
)
| 100 | } |
| 101 | |
| 102 | const collectReferences = ( |
| 103 | currentScope: TSESLint.Scope.Scope, |
| 104 | ): Array<TSESLint.Scope.Reference> => { |
| 105 | const references = [...currentScope.references] |
| 106 | |
| 107 | for (const childScope of currentScope.childScopes) { |
| 108 | references.push(...collectReferences(childScope)) |
| 109 | } |
| 110 | |
| 111 | return references |
| 112 | } |
| 113 | |
| 114 | const references = collectReferences(scope) |
| 115 | .filter((x) => x.isRead() && !scope.set.has(x.identifier.name)) |