ant +design+vue中You may use special comments to disable some warnings. Use // eslint-disable-next-li

在ant design+vue项目中一直提示

You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file.

错误类型,每次报错的时候显示你的代码中出现很多个不符合规范代码的写法,多空格,或者少空格的问题,虽然是warning,但是看着很不舒服。

630 errors and 140 warnings found. 628 errors and 140 warnings potentially fixable with the `--fix` option.

本来想着是把格式都按照提示要求改一下,但是改了半小时,报错数目基本上没有改变,这可不行啊,干脆去掉吧,
解决方法:
把代码规范器关掉:

关闭 Eslint (不推荐) 移除 package.jsoneslintConfig 整个节点代码, vue.config.js 下的 lintOnSave 值改为 false

希望能力在提升很多,完全会使用代码规范器eslint,或者某一天有个大神看到我的博客说,你这虽然省事,但是培养不了好的代码规范的习惯,我教你一种快捷更改这些warning的方法,期待期待期待,放码过来啊!!!

我先把我在package.json文件中删掉的部分报错起来吧

"eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/strongly-recommended",
      "@vue/standard"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {
      "generator-star-spacing": "off",
      "no-mixed-operators": 0,
      "vue/max-attributes-per-line": [
        2,
        {
          "singleline": 5,
          "multiline": {
            "max": 1,
            "allowFirstLine": false
          }
        }
      ],
      "vue/attribute-hyphenation": 0,
      "vue/html-self-closing": 0,
      "vue/component-name-in-template-casing": 0,
      "vue/html-closing-bracket-spacing": 0,
      "vue/singleline-html-element-content-newline": 0,
      "vue/no-unused-components": 0,
      "vue/multiline-html-element-content-newline": 0,
      "vue/no-use-v-if-with-v-for": 0,
      "vue/html-closing-bracket-newline": 0,
      "vue/no-parsing-error": 0,
      "no-console": 0,
      "no-tabs": 0,
      "quotes": [
        2,
        "single",
        {
          "avoidEscape": true,
          "allowTemplateLiterals": true
        }
      ],
      "semi": [
        2,
        "never",
        {
          "beforeStatementContinuationChars": "never"
        }
      ],
      "no-delete-var": 2,
      "prefer-const": [
        2,
        {
          "ignoreReadBeforeAssign": false
        }
      ]
    }
  },
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值