From 9720dcb9a2be04f1b3ad30c99e15daa4ed1665f6 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 13 Jun 2025 22:38:04 +0530 Subject: [PATCH] show plugin working --- core/mytestwitheslint.ts | 24 ++++++++++++++++++++++++ extensions/vscode/.eslintrc.json | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 core/mytestwitheslint.ts 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" } }