1

Visual Code (tsserver) 发出一些建议,例如'await' has no effect on the type of this expression ts(80007)

在此处输入图像描述

但是我找不到解决此错误的方法,tsc也找不到eslint在 CI 环境中使用它的方法

4

1 回答 1

0

最后我找到了一条typescript-eslint规则https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/await-thenable.md

因此,将其添加到 .eslintrc 就足够了:

"@typescript-eslint/await-thenable": "error"

于 2022-01-25T09:14:08.133 回答