(declaration)
| 82095 | return ts.tryCast(ts.getRootDeclaration(node), ts.isParameter); |
| 82096 | } |
| 82097 | function isValidUnusedLocalDeclaration(declaration) { |
| 82098 | if (ts.isBindingElement(declaration)) { |
| 82099 | if (ts.isObjectBindingPattern(declaration.parent)) { |
| 82100 | /** |
| 82101 | * ignore starts with underscore names _ |
| 82102 | * const { a: _a } = { a: 1 } |
| 82103 | */ |
| 82104 | return !!(declaration.propertyName && isIdentifierThatStartsWithUnderscore(declaration.name)); |
| 82105 | } |
| 82106 | return isIdentifierThatStartsWithUnderscore(declaration.name); |
| 82107 | } |
| 82108 | return ts.isAmbientModule(declaration) || |
| 82109 | (ts.isVariableDeclaration(declaration) && ts.isForInOrOfStatement(declaration.parent.parent) || isImportedDeclaration(declaration)) && isIdentifierThatStartsWithUnderscore(declaration.name); |
| 82110 | } |
| 82111 | function checkUnusedLocalsAndParameters(nodeWithLocals, addDiagnostic) { |
| 82112 | // Ideally we could use the ImportClause directly as a key, but must wait until we have full ES6 maps. So must store key along with value. |
| 82113 | var unusedImports = new ts.Map(); |
no test coverage detected