eslint 在 VScod 中检查HTML文件时报出大量no-unused-vars,是正常现象吗?
已全局安装eslint和eslint-plugin-html;
也设置了
"plugins": [
"react",
"html"],
和
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "html",
"autoFix": true
},
{
"language": "vue",
"autoFix": true
}
],
问题就是
1.html里写的JS里的function 会被认为是no-unused-vars报错,而我在HTML里绑了onclick事件.这是正常的吗?
2.上文中那个 "language": "html","autoFix": true 的autoFix好像没什么用啊.我不明白很多人说要这么写.
3.airbnb,我下载了airbnb,看到说是需要eslint a peer of 4.9.0 ,eslint现在都是4.19了,我小试了下能用,这不会出什么问题吧?
还请各位不吝指教.
update:
Consider running eslint --debug C:Userszhaohe.eslintrc.js from a terminal to obtain a trace about the configuration files used.
[Error - 22:23:47]
Failed to load plugin html: Cannot find module 'eslint-plugin-html'
Happened while validating C:Userszhaohe.eslintrc.js
This can happen for a couple of reasons:
- The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc).
- If ESLint is installed globally, then make sure 'eslint-plugin-html' is installed globally as well.
- If ESLint is installed locally, then 'eslint-plugin-html' isn't installed correctly.
啊,我在输出中看到这么一大串.
我安装都是在CMD中运行
npm install -g eslint
npm install -g eslint-plugin-html
我在VScode的设置里改了"eslint.nodePath",好像不出这个一大串了,但报变量的问题还是有的.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论