()
| 94 | } |
| 95 | |
| 96 | warnUnusedImports(): void { |
| 97 | const unused = [...this.declarations] |
| 98 | .filter( |
| 99 | ([name, declaration]) => |
| 100 | name !== '*' && !declaration.included && !this.reexported && !declaration.referenced |
| 101 | ) |
| 102 | .map(([name]) => name); |
| 103 | |
| 104 | if (unused.length === 0) return; |
| 105 | |
| 106 | const importersSet = new Set<string>(); |
| 107 | for (const name of unused) { |
| 108 | const importersOfName = this.importersByExportedName.get(name); |
| 109 | for (const importer of this.importers) { |
| 110 | if (!importersOfName?.has(importer)) continue; |
| 111 | importersSet.add(importer); |
| 112 | } |
| 113 | } |
| 114 | const importersArray = [...importersSet]; |
| 115 | this.options.onLog(LOGLEVEL_WARN, logUnusedExternalImports(this.id, unused, importersArray)); |
| 116 | } |
| 117 | } |
no test coverage detected