账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    eslint 在 VScod 中检查HTML文件时报出大量no-unused-vars,是正常现象吗?
    22
    0

    已全局安装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:

    1. The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc).
    2. If ESLint is installed globally, then make sure 'eslint-plugin-html' is installed globally as well.
    3. 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",好像不出这个一大串了,但报变量的问题还是有的.

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 一只鹿ii 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    网站公告
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部