diff --git a/core/mytestwitheslint.ts b/core/mytestwitheslint.ts new file mode 100644 index 000000000..15eb160eb --- /dev/null +++ b/core/mytestwitheslint.ts @@ -0,0 +1,24 @@ +async function testPromise() { + return new Promise((resolve) => + setTimeout(() => { + console.log("done"); + resolve("done"); + }, 1), + ); +} + +async function check() { + const t = testPromise(); + if (!!t) { + console.log("there should be an error"); + } + + const tt = (val = "str") => t; + + await new Promise(async (resolve) => { + await tt(); + resolve(); + }); + + console.log({ foo: 42, ...tt() }); +} diff --git a/extensions/vscode/.eslintrc.json b/extensions/vscode/.eslintrc.json index e1e339ce7..ce0283909 100644 --- a/extensions/vscode/.eslintrc.json +++ b/extensions/vscode/.eslintrc.json @@ -6,6 +6,7 @@ "extends": ["../../.eslintrc.shared.json"], "rules": { "@typescript-eslint/naming-convention": "off", - "@typescript-eslint/no-floating-promises": "warn" + "@typescript-eslint/no-floating-promises": "warn", + "@typescript-eslint/no-misused-promises": "warn" } }