请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

使用vite-plugin-eslint在ts环境中会出现错误及其解决方案

使用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

正在回答 回答被采纳积分+3

1回答

张轩 2025-02-26 17:04:23

非常感谢同学专业的解答

原因就是作者的这个库一直没有适配 vite5

issue 还是 open 的,后面评论是另外一个人 fork 了这个项目,自己修改的版本,看起来这个是和高版本 vite 5 的兼容性问题。这个看起来作者一直都没有维护,这个 issue 也没有修。


可以安装另外一个试试看,https://github.com/nabla/vite-plugin-eslint



0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号