使用vite-plugin-eslint在ts环境中会出现如下环境错误.
Vue: Could not find a declaration file for module vite-plugin-eslint. implicitly has an any type.
There are types at, but this result could not be resolved when respecting package. json exports. The vite-plugin-eslint library may need to update its package. json or typings
可以在下载node_module中对应的包的package.json文件中添加如下内容
"exports": {
".": {
+ "types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
}
},
注意这个包已经三年没有维护了
https://github.com/gxmari007/vite-plugin-eslint
文心一言/通义千问/Deepseek/ Claude/Cursor与Vue3、Electron
了解课程