Skip to content

Commit 977c3ee

Browse files
committed
fix lints
1 parent cadf543 commit 977c3ee

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/compiler/declarationEmitter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ namespace ts {
143143

144144
// create asynchronous output for the importDeclarations
145145
if (moduleElementDeclarationEmitInfo.length) {
146-
let oldWriter = writer;
146+
const oldWriter = writer;
147147
forEach(moduleElementDeclarationEmitInfo, aliasEmitInfo => {
148148
if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) {
149149
Debug.assert(aliasEmitInfo.node.kind === SyntaxKind.ImportDeclaration);
@@ -744,7 +744,7 @@ namespace ts {
744744

745745
function emitExternalModuleSpecifier(moduleSpecifier: Expression) {
746746
if (moduleSpecifier.kind === SyntaxKind.StringLiteral && (!root) && (compilerOptions.out || compilerOptions.outFile)) {
747-
let moduleName = getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent as (ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration));
747+
const moduleName = getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent as (ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration));
748748
if (moduleName) {
749749
write("\"");
750750
write(moduleName);

src/compiler/emitter.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace ts {
1212
}
1313

1414
export function getExternalModuleNameFromDeclaration(host: EmitHost, resolver: EmitResolver, declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration): string {
15-
let file = resolver.getExternalModuleFileFromDeclaration(declaration);
15+
const file = resolver.getExternalModuleFileFromDeclaration(declaration);
1616
if (!file || isDeclarationFile(file)) {
1717
return undefined;
1818
}
@@ -355,7 +355,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
355355
else {
356356
forEach(host.getSourceFiles(), sourceFile => {
357357
if (shouldEmitToOwnFile(sourceFile, compilerOptions)) {
358-
let jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js");
358+
const jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js");
359359
emitFile(jsFilePath, sourceFile);
360360
}
361361
});
@@ -616,7 +616,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
616616
if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) {
617617
initializeEmitterWithSourceMaps(jsFilePath, root);
618618
}
619-
619+
620620
if (root) {
621621
// Do not call emit directly. It does not set the currentSourceFile.
622622
emitSourceFile(root);
@@ -7372,7 +7372,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
73727372
}
73737373

73747374
if (emitRelativePathAsModuleName) {
7375-
let name = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]);
7375+
const name = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]);
73767376
if (name) {
73777377
text = `"${name}"`;
73787378
}
@@ -7422,7 +7422,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
74227422
let externalModuleName = getExternalModuleNameText(importNode);
74237423

74247424
if (emitRelativePathAsModuleName) {
7425-
let name = getExternalModuleNameFromDeclaration(host, resolver, importNode);
7425+
const name = getExternalModuleNameFromDeclaration(host, resolver, importNode);
74267426
if (name) {
74277427
externalModuleName = `"${name}"`;
74287428
}

src/compiler/utilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,8 +1805,8 @@ namespace ts {
18051805
* Resolves a local path to a path which is absolute to the base of the emit
18061806
*/
18071807
export function getExternalModuleNameFromPath(host: EmitHost, fileName: string): string {
1808-
let dir = host.getCurrentDirectory();
1809-
let relativePath = getRelativePathToDirectoryOrUrl(dir, fileName, dir, f => host.getCanonicalFileName(f), /*isAbsolutePathAnUrl*/ false);
1808+
const dir = host.getCurrentDirectory();
1809+
const relativePath = getRelativePathToDirectoryOrUrl(dir, fileName, dir, f => host.getCanonicalFileName(f), /*isAbsolutePathAnUrl*/ false);
18101810
return removeFileExtension(relativePath);
18111811
}
18121812

0 commit comments

Comments
 (0)