mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
fix lints
This commit is contained in:
parent
cadf54334b
commit
977c3eec22
@ -143,7 +143,7 @@ namespace ts {
|
||||
|
||||
// create asynchronous output for the importDeclarations
|
||||
if (moduleElementDeclarationEmitInfo.length) {
|
||||
let oldWriter = writer;
|
||||
const oldWriter = writer;
|
||||
forEach(moduleElementDeclarationEmitInfo, aliasEmitInfo => {
|
||||
if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) {
|
||||
Debug.assert(aliasEmitInfo.node.kind === SyntaxKind.ImportDeclaration);
|
||||
@ -744,7 +744,7 @@ namespace ts {
|
||||
|
||||
function emitExternalModuleSpecifier(moduleSpecifier: Expression) {
|
||||
if (moduleSpecifier.kind === SyntaxKind.StringLiteral && (!root) && (compilerOptions.out || compilerOptions.outFile)) {
|
||||
let moduleName = getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent as (ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration));
|
||||
const moduleName = getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent as (ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration));
|
||||
if (moduleName) {
|
||||
write("\"");
|
||||
write(moduleName);
|
||||
|
||||
@ -12,7 +12,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function getExternalModuleNameFromDeclaration(host: EmitHost, resolver: EmitResolver, declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration): string {
|
||||
let file = resolver.getExternalModuleFileFromDeclaration(declaration);
|
||||
const file = resolver.getExternalModuleFileFromDeclaration(declaration);
|
||||
if (!file || isDeclarationFile(file)) {
|
||||
return undefined;
|
||||
}
|
||||
@ -355,7 +355,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
else {
|
||||
forEach(host.getSourceFiles(), sourceFile => {
|
||||
if (shouldEmitToOwnFile(sourceFile, compilerOptions)) {
|
||||
let jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js");
|
||||
const jsFilePath = getOwnEmitOutputFilePath(sourceFile, host, shouldEmitJsx(sourceFile) ? ".jsx" : ".js");
|
||||
emitFile(jsFilePath, sourceFile);
|
||||
}
|
||||
});
|
||||
@ -616,7 +616,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) {
|
||||
initializeEmitterWithSourceMaps(jsFilePath, root);
|
||||
}
|
||||
|
||||
|
||||
if (root) {
|
||||
// Do not call emit directly. It does not set the currentSourceFile.
|
||||
emitSourceFile(root);
|
||||
@ -7372,7 +7372,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
|
||||
if (emitRelativePathAsModuleName) {
|
||||
let name = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]);
|
||||
const name = getExternalModuleNameFromDeclaration(host, resolver, externalImports[i]);
|
||||
if (name) {
|
||||
text = `"${name}"`;
|
||||
}
|
||||
@ -7422,7 +7422,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
let externalModuleName = getExternalModuleNameText(importNode);
|
||||
|
||||
if (emitRelativePathAsModuleName) {
|
||||
let name = getExternalModuleNameFromDeclaration(host, resolver, importNode);
|
||||
const name = getExternalModuleNameFromDeclaration(host, resolver, importNode);
|
||||
if (name) {
|
||||
externalModuleName = `"${name}"`;
|
||||
}
|
||||
|
||||
@ -1805,8 +1805,8 @@ namespace ts {
|
||||
* Resolves a local path to a path which is absolute to the base of the emit
|
||||
*/
|
||||
export function getExternalModuleNameFromPath(host: EmitHost, fileName: string): string {
|
||||
let dir = host.getCurrentDirectory();
|
||||
let relativePath = getRelativePathToDirectoryOrUrl(dir, fileName, dir, f => host.getCanonicalFileName(f), /*isAbsolutePathAnUrl*/ false);
|
||||
const dir = host.getCurrentDirectory();
|
||||
const relativePath = getRelativePathToDirectoryOrUrl(dir, fileName, dir, f => host.getCanonicalFileName(f), /*isAbsolutePathAnUrl*/ false);
|
||||
return removeFileExtension(relativePath);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user