解决“Unsafe call of a type that could not be resolved”报错
·

这几天使用nest写需求时遇到这样一个报错,究其原因才知道原来是typescript无法正确解析 @nestjs/typeorm 的类型定义,导致 InjectRepository 被推断为 any 类型,而 @typescript-eslint/no-unsafe-call 规则禁止调用 any 类型的值。
点开链接 https://typescript-eslint.io/rules/no-unsafe-call/

在 eslint.config.mjs 文件里面添加"@typescript-eslint/no-unsafe-call": "error",这行命令,然后关闭文件夹进行重启,提示就会消失了
更多推荐
所有评论(0)