今天在 调试vue项目时,启运服务:

yarn serve


突然报如下错误信息:

  14:1  error  This line has a length of 103. Maximum allowed is 100  max-len
  26:1  error  This line has a length of 107. Maximum allowed is 100  max-len
  38:1  error  This line has a length of 108. Maximum allowed is 100  max-len
  44:1  error  This line has a length of 101. Maximum allowed is 100  max-len

原来是ecslint语法检测时报的错,后来在eclintConfig的rules规则里加上max-len 规则就可以了

原配置规则:
 

"eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/vue3-essential",
      "@vue/airbnb",
      "@vue/typescript/recommended"
    ],
    "parserOptions": {
      "ecmaVersion": 2020
    },
    "rules": {}
  },

改成:

"eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/vue3-essential",
      "@vue/airbnb",
      "@vue/typescript/recommended"
    ],
    "parserOptions": {
      "ecmaVersion": 2020
    },
    "rules": {
      "max-len": ["error", {"code": 300}  ]
    }
  },

Logo

前往低代码交流专区

更多推荐