在vue3项目中,出现如下告警:
Failed to load plugin 'html' declared in 'CLIOptions': Cannot find module 'eslint-plugin-html'
在Eslint官网中有说明:
Initially, eslint-plugin-vue was using eslint-plugin-html to lint code inside script tags. Since v3, eslint-plugin-vue is using its own parser, so it is incompatible with eslint-plugin-html. You should use eslint-plugin-vue exclusively and remove eslint-plugin-html from your dependencies if you still have it.
简单说,在vue3中,'eslint-plugin-html'插件已经用不到了,删了就可以了。
npm uninstall eslint-plugin-html
另外,在VScode 设置中,删除html一项:
(把中括号里面的 "html"去掉即可)