Enable @typescript-eslint/space-before-function-paren, @typescript-eslint/no-unused-expressions (#36569)

* use @typescript-eslint/no-unused-expressions instead of no-unused-expressions

* enable @typescript-eslint/space-before-function-paren
This commit is contained in:
Alexander T
2020-02-05 00:43:25 +02:00
committed by GitHub
parent 7726464abd
commit 8c31700735
13 changed files with 40 additions and 30 deletions

View File

@@ -30,7 +30,7 @@ namespace Harness {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const cls = this;
describe(`${this.kind()} code samples`, function(this: Mocha.ISuiteCallbackContext) {
describe(`${this.kind()} code samples`, function (this: Mocha.ISuiteCallbackContext) {
this.timeout(600_000); // 10 minutes
for (const test of testList) {
cls.runTest(typeof test === "string" ? test : test.file);
@@ -41,7 +41,7 @@ namespace Harness {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const cls = this;
const timeout = 600_000; // 10 minutes
describe(directoryName, function(this: Mocha.ISuiteCallbackContext) {
describe(directoryName, function (this: Mocha.ISuiteCallbackContext) {
this.timeout(timeout);
const cp: typeof import("child_process") = require("child_process");
@@ -123,7 +123,7 @@ ${stripAbsoluteImportPaths(result.stderr.toString().replace(/\r\n/g, "\n"))}`;
// eslint-disable-next-line @typescript-eslint/no-this-alias
const cls = this;
describe(`${this.kind()} code samples`, function(this: Mocha.ISuiteCallbackContext) {
describe(`${this.kind()} code samples`, function (this: Mocha.ISuiteCallbackContext) {
this.timeout(cls.timeout); // 20 minutes
before(() => {
cls.exec("docker", ["build", ".", "-t", "typescript/typescript"], { cwd: IO.getWorkspaceRoot() }); // cached because workspace is hashed to determine cacheability

View File

@@ -47,7 +47,7 @@ namespace RWC {
caseSensitive = false;
});
it("can compile", function(this: Mocha.ITestCallbackContext) {
it("can compile", function (this: Mocha.ITestCallbackContext) {
this.timeout(800_000); // Allow long timeouts for RWC compilations
let opts!: ts.ParsedCommandLine;
@@ -145,7 +145,7 @@ namespace RWC {
});
it("has the expected emitted code", function(this: Mocha.ITestCallbackContext) {
it("has the expected emitted code", function (this: Mocha.ITestCallbackContext) {
this.timeout(100_000); // Allow longer timeouts for RWC js verification
Harness.Baseline.runMultifileBaseline(baseName, "", () => {
return Harness.Compiler.iterateOutputs(compilerResult.js.values());

View File

@@ -46,7 +46,7 @@ export function Component(x: Config): any;`
it("should be able to create a language service which can respond to deinition requests without throwing", () => {
const languageService = createLanguageService();
const definitions = languageService.getDefinitionAtPosition("foo.ts", 160); // 160 is the latter `vueTemplateHtml` position
expect(definitions).to.exist; // eslint-disable-line no-unused-expressions
expect(definitions).to.exist; // eslint-disable-line @typescript-eslint/no-unused-expressions
});
it("getEmitOutput on language service has way to force dts emit", () => {

View File

@@ -343,7 +343,7 @@ namespace ts.server {
session.send = Session.prototype.send;
assert(session.send);
expect(session.send(msg)).to.not.exist; // eslint-disable-line no-unused-expressions
expect(session.send(msg)).to.not.exist; // eslint-disable-line @typescript-eslint/no-unused-expressions
expect(lastWrittenToHost).to.equal(resultMsg);
});
});