Apply 'variable-name' tslint rule (#19743)

This commit is contained in:
Andy
2017-11-06 09:23:47 -08:00
committed by GitHub
parent 8d5b0529b2
commit 0a7b7e07ee
36 changed files with 349 additions and 331 deletions

View File

@@ -63,9 +63,9 @@ namespace ts.server.typingsInstaller {
}
}
const TypesRegistryPackageName = "types-registry";
const typesRegistryPackageName = "types-registry";
function getTypesRegistryFileLocation(globalTypingsCacheLocation: string): string {
return combinePaths(normalizeSlashes(globalTypingsCacheLocation), `node_modules/${TypesRegistryPackageName}/index.json`);
return combinePaths(normalizeSlashes(globalTypingsCacheLocation), `node_modules/${typesRegistryPackageName}/index.json`);
}
interface ExecSyncOptions {
@@ -105,16 +105,16 @@ namespace ts.server.typingsInstaller {
try {
if (this.log.isEnabled()) {
this.log.writeLine(`Updating ${TypesRegistryPackageName} npm package...`);
this.log.writeLine(`Updating ${typesRegistryPackageName} npm package...`);
}
this.execSyncAndLog(`${this.npmPath} install --ignore-scripts ${TypesRegistryPackageName}`, { cwd: globalTypingsCacheLocation });
this.execSyncAndLog(`${this.npmPath} install --ignore-scripts ${typesRegistryPackageName}`, { cwd: globalTypingsCacheLocation });
if (this.log.isEnabled()) {
this.log.writeLine(`Updated ${TypesRegistryPackageName} npm package`);
this.log.writeLine(`Updated ${typesRegistryPackageName} npm package`);
}
}
catch (e) {
if (this.log.isEnabled()) {
this.log.writeLine(`Error updating ${TypesRegistryPackageName} package: ${(<Error>e).message}`);
this.log.writeLine(`Error updating ${typesRegistryPackageName} package: ${(<Error>e).message}`);
}
// store error info to report it later when it is known that server is already listening to events from typings installer
this.delayedInitializationError = {
@@ -243,7 +243,7 @@ namespace ts.server.typingsInstaller {
const installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, /*throttleLimit*/5, log);
installer.listen();
function indent(newline: string, string: string): string {
return `${newline} ` + string.replace(/\r?\n/, `${newline} `);
function indent(newline: string, str: string): string {
return `${newline} ` + str.replace(/\r?\n/, `${newline} `);
}
}