在vite.config.ts 中 import eslint from ‘vite-plugin-eslint’
一直报错Could not find a declaration file for module ‘vite-plugin-eslint’. ‘/Users/fulei/vuetest/vue3-basic1/node_modules/vite-plugin-eslint/dist/index.mjs’ implicitly has an ‘any’ type.
There are types at ‘/Users/fulei/vuetest/vue3-basic1/node_modules/vite-plugin-eslint/dist/index.d.ts’, 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.ts(7016)
按照网上办法尝试了半天 要么可以修复这个报错但是运行 npm run dev 的时候会报错
要么就是 报错一直存在 但是可以运行npm run dev
后面用gork3推荐的方法 把 tsconfig.node.json 中的 /* Bundler mode */
“moduleResolution”: “bundler”, 改为"moduleResolution": “node”, 后就不会在报错了 且运行也一切正常
文心一言/通义千问/Deepseek/ Claude/Cursor与Vue3、Electron
了解课程