mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #15021 from RyanCavanaugh/lintFixes
Update linting to avoid typechecking for booleanTriviaRule
This commit is contained in:
@@ -51,7 +51,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
const path = ts.toPath(name, root, (fileName) => Harness.Compiler.getCanonicalFileName(fileName));
|
||||
const pathStart = ts.toPath(Harness.IO.getCurrentDirectory(), "", (fileName) => Harness.Compiler.getCanonicalFileName(fileName));
|
||||
return pathStart ? path.replace(pathStart, "/") : path;
|
||||
};
|
||||
}
|
||||
|
||||
public checkTestCodeOutput(fileName: string) {
|
||||
describe("compiler tests for " + fileName, () => {
|
||||
|
||||
@@ -1694,7 +1694,7 @@ namespace FourSlash {
|
||||
if (ch === "\r") {
|
||||
this.currentCaretPosition--;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private applyEdits(fileName: string, edits: ts.TextChange[], isFormattingEdit = false): number {
|
||||
|
||||
@@ -203,4 +203,4 @@ namespace ts {
|
||||
assert.isTrue(diags.length === 0);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace ts {
|
||||
});
|
||||
|
||||
it("Converts simple code snippet correctly", () => {
|
||||
runTest(`/// <reference path="file.ts" />
|
||||
runTest(`/// <reference path="file.ts" />
|
||||
var x: string = "string";
|
||||
console.log(x);`);
|
||||
});
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace ts {
|
||||
it("module name as directory - handle invalid 'typings'", () => {
|
||||
testTypingsIgnored(["a", "b"]);
|
||||
testTypingsIgnored({ "a": "b" });
|
||||
testTypingsIgnored(true);
|
||||
testTypingsIgnored(/*typings*/true);
|
||||
/* tslint:disable no-null-keyword */
|
||||
testTypingsIgnored(null);
|
||||
/* tslint:enable no-null-keyword */
|
||||
|
||||
@@ -326,7 +326,7 @@ namespace ts.server {
|
||||
send(msg: protocol.Message) {
|
||||
this.lastSent = msg;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
it("can override methods such as send", () => {
|
||||
const session = new TestSession();
|
||||
@@ -367,7 +367,7 @@ namespace ts.server {
|
||||
assert(this.projectService);
|
||||
expect(this.projectService).to.be.instanceOf(ProjectService);
|
||||
}
|
||||
};
|
||||
}
|
||||
new ServiceSession();
|
||||
});
|
||||
});
|
||||
@@ -462,7 +462,7 @@ namespace ts.server {
|
||||
});
|
||||
this.callbacks[this.seq] = callback;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
it("can be constructed and respond to commands", (done) => {
|
||||
const cli = new InProcClient();
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace ts.projectSystem {
|
||||
request.type = "request";
|
||||
return this.executeCommand(<T>request);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function createSession(host: server.ServerHost, typingsInstaller?: server.ITypingsInstaller, projectServiceEventHandler?: server.ProjectServiceEventHandler, cancellationToken?: server.ServerCancellationToken, throttleWaitMilliseconds?: number) {
|
||||
if (typingsInstaller === undefined) {
|
||||
@@ -381,7 +381,7 @@ namespace ts.projectSystem {
|
||||
fileExists(s: string) {
|
||||
const path = this.toPath(s);
|
||||
return this.fs.contains(path) && isFile(this.fs.get(path));
|
||||
};
|
||||
}
|
||||
|
||||
getFileSize(s: string) {
|
||||
const path = this.toPath(s);
|
||||
@@ -476,11 +476,11 @@ namespace ts.projectSystem {
|
||||
// TOOD: record and invoke callbacks to simulate timer events
|
||||
setTimeout(callback: TimeOutCallback, _time: number, ...args: any[]) {
|
||||
return this.timeoutCallbacks.register(callback, args);
|
||||
};
|
||||
}
|
||||
|
||||
clearTimeout(timeoutId: any): void {
|
||||
this.timeoutCallbacks.unregister(timeoutId);
|
||||
};
|
||||
}
|
||||
|
||||
checkTimeoutQueueLength(expected: number) {
|
||||
const callbacksCount = this.timeoutCallbacks.count();
|
||||
@@ -501,7 +501,7 @@ namespace ts.projectSystem {
|
||||
|
||||
clearImmediate(timeoutId: any): void {
|
||||
this.immediateCallbacks.unregister(timeoutId);
|
||||
};
|
||||
}
|
||||
|
||||
createDirectory(directoryName: string): void {
|
||||
this.createFileOrFolder({ path: directoryName });
|
||||
|
||||
Reference in New Issue
Block a user