Skip to content

Commit 40c0cbd

Browse files
author
Paul van Brenk
committed
Clean up
1 parent 2f453ce commit 40c0cbd

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

src/services/codefixes/unusedIdentifierFixes.ts

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ namespace ts.codefix {
8080

8181
// handle case where 'import a = A;'
8282
case SyntaxKind.ImportEqualsDeclaration:
83-
let importEquals = findImportDeclaration(token);
83+
const importEquals = findImportDeclaration(token);
8484
return createCodeFix("", importEquals.pos, importEquals.end - importEquals.pos);
8585

8686
case SyntaxKind.ImportSpecifier:
8787
const namedImports = <NamedImports>token.parent.parent;
8888
if (namedImports.elements.length === 1) {
8989
// Only 1 import and it is unused. So the entire declaration should be removed.
90-
let importSpec = findImportDeclaration(token);
90+
const importSpec = findImportDeclaration(token);
9191
return createCodeFix("", importSpec.pos, importSpec.end - importSpec.pos);
9292
}
9393
else {
@@ -108,10 +108,11 @@ namespace ts.codefix {
108108

109109
case SyntaxKind.NamespaceImport:
110110
const namespaceImport = <NamespaceImport>token.parent;
111-
if(namespaceImport.name == token && !(<ImportClause>namespaceImport.parent).name){
111+
if (namespaceImport.name == token && !(<ImportClause>namespaceImport.parent).name) {
112112
const importDecl = findImportDeclaration(namespaceImport);
113113
return createCodeFix("", importDecl.pos, importDecl.end - importDecl.pos);
114-
} else {
114+
}
115+
else {
115116
const start = (<ImportClause>namespaceImport.parent).name.end;
116117
return createCodeFix("", start, (<ImportClause>namespaceImport.parent).namedBindings.end - start);
117118
}
@@ -163,20 +164,4 @@ namespace ts.codefix {
163164
}
164165
}
165166
});
166-
}
167-
168-
const s = "hello";
169-
170-
class C {
171-
172-
173-
174-
private ["string"]: string;
175-
private "b iz": string;
176-
177-
bar() {
178-
this
179-
}
180-
}
181-
182-
167+
}

src/services/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"compilerOptions": {
33
"noImplicitAny": true,
44
"noImplicitThis": true,

0 commit comments

Comments
 (0)