Skip to content

Commit a3a07a0

Browse files
committed
lint more files
1 parent a2e5c2d commit a3a07a0

4 files changed

Lines changed: 24 additions & 24 deletions

File tree

Jakefile.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ var serverCoreSources = [
128128
"types.d.ts",
129129
"utilities.ts",
130130
"scriptVersionCache.ts",
131+
"typingsCache.ts",
131132
"scriptInfo.ts",
132133
"lsHost.ts",
133134
"project.ts",
@@ -1101,6 +1102,8 @@ var lintTargets = compilerSources
11011102
.concat(serverCoreSources)
11021103
.concat(tslintRulesFiles)
11031104
.concat(servicesSources)
1105+
.concat(typingsInstallerSources)
1106+
.concat(cancellationTokenSources)
11041107
.concat(["Gulpfile.ts"])
11051108
.concat([nodeServerInFile, perftscPath, "tests/perfsys.ts", webhostPath]);
11061109

src/server/cancellationToken.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ function createCancellationToken(args: string[]): HostCancellationToken {
1717
}
1818
}
1919
if (!cancellationPipeName) {
20-
return { isCancellationRequested: () => false };
20+
return { isCancellationRequested: () => false };
2121
}
2222
return {
2323
isCancellationRequested() {
2424
try {
2525
fs.statSync(cancellationPipeName);
2626
return true;
2727
}
28-
catch(e) {
28+
catch (e) {
2929
return false;
3030
}
3131
}
3232
};
3333
}
34-
export = createCancellationToken
34+
export = createCancellationToken;

src/server/typingsInstaller/nodeTypingsInstaller.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace ts.server.typingsInstaller {
2121
basePath = os.homedir();
2222
break;
2323
case "darwin":
24-
basePath = combinePaths(os.homedir(), "Library/Application Support/")
24+
basePath = combinePaths(os.homedir(), "Library/Application Support/");
2525
break;
2626
}
2727

@@ -32,7 +32,7 @@ namespace ts.server.typingsInstaller {
3232
class FileLog implements Log {
3333
constructor(private readonly logFile?: string) {
3434
}
35-
35+
3636
isEnabled() {
3737
return this.logFile !== undefined;
3838
}
@@ -44,9 +44,8 @@ namespace ts.server.typingsInstaller {
4444
export class NodeTypingsInstaller extends TypingsInstaller {
4545
private execSync: { (command: string, options: { stdio: "ignore" | "pipe" }): Buffer | string };
4646
private exec: { (command: string, options: { cwd: string }, callback?: (error: Error, stdout: string, stderr: string) => void): any };
47-
4847
private npmBinPath: string;
49-
48+
5049
private tsdRunCount = 1;
5150
readonly installTypingHost: InstallTypingHost = sys;
5251

@@ -55,7 +54,7 @@ namespace ts.server.typingsInstaller {
5554
if (this.log.isEnabled()) {
5655
this.log.writeLine(`Process id: ${process.pid}`);
5756
}
58-
const { exec, execSync } = require("child_process");
57+
const { exec, execSync } = require("child_process");
5958
this.execSync = execSync;
6059
this.exec = exec;
6160
}
@@ -68,7 +67,7 @@ namespace ts.server.typingsInstaller {
6867
this.log.writeLine(`Global npm bin path '${this.npmBinPath}'`);
6968
}
7069
}
71-
catch(e) {
70+
catch (e) {
7271
this.npmBinPath = "";
7372
if (this.log.isEnabled()) {
7473
this.log.writeLine(`Error when getting npm bin path: ${e}. Set bin path to ""`);
@@ -82,7 +81,7 @@ namespace ts.server.typingsInstaller {
8281
case "closeProject":
8382
this.closeProject(req);
8483
}
85-
})
84+
});
8685
}
8786

8887
protected isPackageInstalled(packageName: string) {
@@ -121,11 +120,11 @@ namespace ts.server.typingsInstaller {
121120

122121
protected sendResponse(response: SetTypings | InvalidateCachedTypings) {
123122
if (this.log.isEnabled()) {
124-
this.log.writeLine(`Sending response: ${JSON.stringify(response)}`)
123+
this.log.writeLine(`Sending response: ${JSON.stringify(response)}`);
125124
}
126125
process.send(response);
127126
if (this.log.isEnabled()) {
128-
this.log.writeLine(`Response has been sent.`)
127+
this.log.writeLine(`Response has been sent.`);
129128
}
130129
}
131130

@@ -134,12 +133,12 @@ namespace ts.server.typingsInstaller {
134133
this.tsdRunCount++;
135134
const tsdPath = combinePaths(this.npmBinPath, "tsd");
136135
if (this.log.isEnabled()) {
137-
this.log.writeLine(`Running tsd ${id}, tsd path '${tsdPath}, typings to install: ${JSON.stringify(typingsToInstall)}. cache path '${cachePath}'`)
136+
this.log.writeLine(`Running tsd ${id}, tsd path '${tsdPath}, typings to install: ${JSON.stringify(typingsToInstall)}. cache path '${cachePath}'`);
138137
}
139-
this.exec(`${tsdPath} install ${typingsToInstall.join(" ")} -ros`, { cwd: cachePath }, (err, stdout, stderr) => {
138+
this.exec(`${tsdPath} install ${typingsToInstall.join(" ")} -ros`, { cwd: cachePath }, (err, stdout, stderr) => {
140139
if (this.log.isEnabled()) {
141140
this.log.writeLine(`TSD ${id} stdout: ${stdout}`);
142-
this.log.writeLine(`TSD ${id} stderr: ${stderr}`)
141+
this.log.writeLine(`TSD ${id} stderr: ${stderr}`);
143142
}
144143
const i = stdout.indexOf("running install");
145144
if (i < 0) {
@@ -154,7 +153,7 @@ namespace ts.server.typingsInstaller {
154153
installedTypings.push(match[1]);
155154
}
156155
postInstallAction(installedTypings);
157-
})
156+
});
158157
}
159158
}
160159

src/server/typingsInstaller/typingsInstaller.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ namespace ts.server.typingsInstaller {
1717
isEnabled(): boolean;
1818
writeLine(text: string): void;
1919
}
20-
20+
2121
const nullLog: Log = {
2222
isEnabled: () => false,
2323
writeLine: () => {}
24-
}
24+
};
2525

2626
function tsdTypingToFileName(cachePath: string, tsdTypingFile: string) {
2727
return combinePaths(cachePath, `typings/${tsdTypingFile}`);
@@ -33,7 +33,6 @@ namespace ts.server.typingsInstaller {
3333
}
3434

3535
export abstract class TypingsInstaller {
36-
3736
private isTsdInstalled: boolean;
3837

3938
private packageNameToTypingLocation: Map<string> = createMap<string>();
@@ -81,14 +80,13 @@ namespace ts.server.typingsInstaller {
8180
if (this.log.isEnabled()) {
8281
this.log.writeLine(`No watchers are registered for project '${projectName}'`);
8382
}
84-
8583
return;
8684
}
8785
for (const w of watchers) {
8886
w.close();
8987
}
9088

91-
delete this.projectWatchers[projectName]
89+
delete this.projectWatchers[projectName];
9290

9391
if (this.log.isEnabled()) {
9492
this.log.writeLine(`Closing file watchers for project '${projectName}' - done.`);
@@ -102,7 +100,7 @@ namespace ts.server.typingsInstaller {
102100
}
103101
return;
104102
}
105-
103+
106104
if (this.log.isEnabled()) {
107105
this.log.writeLine(`Got install request ${JSON.stringify(req)}`);
108106
}
@@ -123,7 +121,7 @@ namespace ts.server.typingsInstaller {
123121
this.packageNameToTypingLocation,
124122
req.typingOptions,
125123
req.compilerOptions);
126-
124+
127125
if (this.log.isEnabled()) {
128126
this.log.writeLine(`Finished typings discovery: ${JSON.stringify(discoverTypingsResult)}`);
129127
}
@@ -151,7 +149,7 @@ namespace ts.server.typingsInstaller {
151149
}
152150
if (this.knownCachesSet[cacheLocation]) {
153151
if (this.log.isEnabled()) {
154-
this.log.writeLine(`Cache location was already processed...`)
152+
this.log.writeLine(`Cache location was already processed...`);
155153
}
156154
return;
157155
}

0 commit comments

Comments
 (0)