Skip to content

Commit

Permalink
Fix many more eslint issues
Browse files Browse the repository at this point in the history
+ disable some rules we don't want or do not yet pass.
  • Loading branch information
DanTup committed Sep 30, 2020
1 parent bae4a14 commit 1b7beb8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
28 changes: 20 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ module.exports = {
"allowSingleLine": true
}
],
"camelcase": [
"error",
{
"allow": ["child_process"]
}
],
"comma-dangle": [
"error",
"always-multiline"
Expand Down Expand Up @@ -136,13 +142,6 @@ module.exports = {
}
}
],
"@typescript-eslint/camelcase": [
"error",
{
"allow": ["child_process"]
}
],

"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/explicit-function-return-type": "off",
// "@typescript-eslint/explicit-member-accessibility": [
Expand All @@ -151,6 +150,8 @@ module.exports = {
// "accessibility": "explicit"
// }
// ],
// TODO: Enable this when fixed
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/indent": [
"error",
"tab",
Expand Down Expand Up @@ -183,6 +184,16 @@ module.exports = {
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
// TODO: Re-enable this when fixed.
"@typescript-eslint/no-floating-promises": "off",
// TODO: Re-enable this when fixed.
"@typescript-eslint/no-unsafe-assignment": "off",
// TODO: Re-enable this when fixed.
"@typescript-eslint/no-unsafe-call": "off",
// TODO: Re-enable this when fixed.
"@typescript-eslint/no-unsafe-member-access": "off",
// TODO: Re-enable this when fixed.
"@typescript-eslint/no-unsafe-return": "off",
// TODO: Re-enable this when fixed.
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-misused-promises": [
"error",
Expand All @@ -200,6 +211,8 @@ module.exports = {
"@typescript-eslint/prefer-function-type": "error",
// TODO: Re-enable this when fixed.
"@typescript-eslint/prefer-includes": "off",
// TODO: Enable this when fixed
"@typescript-eslint/restrict-template-expressions": "off",
// TODO: Re-enable this when fixed.
"@typescript-eslint/require-await": "off",
"@typescript-eslint/quotes": [
Expand Down Expand Up @@ -249,7 +262,6 @@ module.exports = {
}
]
}
// TODO: No floating promises
// TODO: no unused expression
// "max-line-length": false,
// "ordered-imports": false,
Expand Down
1 change: 1 addition & 0 deletions src/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ export async function withTimeout<T>(promise: Thenable<T>, message: string | (()
}, seconds * 1000);

// When the main promise completes, cancel the timeout and return its result.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
promise.then((result) => {
clearTimeout(timeoutTimer);
resolve(result);
Expand Down
1 change: 1 addition & 0 deletions src/test/test_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = {
});

// Set up source map support.
// eslint-disable-next-line @typescript-eslint/no-var-requires
require("source-map-support").install();

const callCallback = (error: any, failures?: number) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/web_debug/debug/web.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe.skip("web debugger", () => {
it.skip("can quit during a build", async () => {
const config = await startDebugger(webHelloWorldIndexFile);
// Kick off a build, but do not await it...
// tslint:disable-next-line: no-floating-promises
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Promise.all([
dc.configurationSequence(),
dc.launch(config),
Expand Down
1 change: 1 addition & 0 deletions src/tool/generate_launch_configs.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/tslint/config */
import * as fs from "fs";
import { flatMap } from "../shared/utils";
import { unique } from "../shared/utils/array";
Expand Down

0 comments on commit 1b7beb8

Please sign in to comment.