美文网首页
使用ESlint警告:Require self-closing

使用ESlint警告:Require self-closing

作者: kevinXiao | 来源:发表于2022-06-15 11:54 被阅读0次

    报错信息: Require self-closing on HTML elements (<div>)
    Require self-closing on HTML elements (<span>)

    解决方式:配置eslintrc.js;添加配置内容如下

     rules: {
       'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
       'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
       'generator-star-spacing': 'off',
       "vue/html-self-closing": ["error",{
         "html": {
           "void": "never",
           "normal": "any",
           "component": "any"
         },
         "svg": "always",
         "math": "always"
       }],
    }
    

    相关文章

      网友评论

          本文标题:使用ESlint警告:Require self-closing

          本文链接:https://www.haomeiwen.com/subject/kckxvrtx.html