有没有办法使用 tsc 命令(或其他命令)显示可视化代码(tsserver)建议,例如 TS80007?

Tlm*_*aK0 5 typescript tsc eslint tsserver

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

在此输入图像描述

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

Tlm*_*aK0 3

最后我找到了一条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"