Vue3+TS d.ts 中interfaceVue文件不识别

Vue全家桶安装后,若在项目中有interface,但是在vue文件内有eslint或者vetur报错找不到interface

解决方法:在eslintrc中关闭"no-undef"检查,再重启ide

原因:TS已经有格式检查,无需开启eslint

troubleshooting documentation of typescript-eslint has an entry 关于这个:

no-undef lint 规则不使用 TypeScript 来确定存在的全局变量 - 相反,它依赖于 ESLint 的配置。

我们强烈建议您不要在 TypeScript 项目中使用 no-undef lint 规则。它提供的检查已经由 TypeScript 提供,无需配置 - TypeScript 只是在这方面做得更好。

你可能感兴趣的:(Vue3+TS d.ts 中interfaceVue文件不识别)