Skip to content

Commit 9720dcb

Browse files
committed
show plugin working
1 parent e686db0 commit 9720dcb

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

core/mytestwitheslint.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
async function testPromise() {
2+
return new Promise((resolve) =>
3+
setTimeout(() => {
4+
console.log("done");
5+
resolve("done");
6+
}, 1),
7+
);
8+
}
9+
10+
async function check() {
11+
const t = testPromise();
12+
if (!!t) {
13+
console.log("there should be an error");
14+
}
15+
16+
const tt = (val = "str") => t;
17+
18+
await new Promise<void>(async (resolve) => {
19+
await tt();
20+
resolve();
21+
});
22+
23+
console.log({ foo: 42, ...tt() });
24+
}

extensions/vscode/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"extends": ["../../.eslintrc.shared.json"],
77
"rules": {
88
"@typescript-eslint/naming-convention": "off",
9-
"@typescript-eslint/no-floating-promises": "warn"
9+
"@typescript-eslint/no-floating-promises": "warn",
10+
"@typescript-eslint/no-misused-promises": "warn"
1011
}
1112
}

0 commit comments

Comments
 (0)