eslint

作者: 孙雄鹰 | 来源:发表于2020-04-21 23:54 被阅读0次

eslint 报错

Error: .eslintrc:

        Configuration for rule "quotes" is invalid:

        Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '"1"').

配置修改成以下rules 即可

{

  "root": true,

  "env": {

    "node": true,

    "browser": true,

    "es6": true,

  },

  "parserOptions": {

    "sourceType": "module",

    "ecmaVersion": 2020

  },

  "parser": "vue-eslint-parser",

  "extends": [

    // "plugin:vue/essential",

    // "@vue/airbnb",

    // "@vue/typescript/recommended"

  ],

  "rules": {

    "quotes": [1, "single"]

  }

}

报错:Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style

eslint 里面 rule里面加

"linebreak-style": ["off", "windows"]

目标:vscode 自动把双引号变成单引号   version:1.44.2

报错

error Missing semicolon semi

error Missing trailing comma comma-dangle

file-perferences-settings 

"vetur.format.defaultFormatterOptions": {

    "prettier": {

      "singleQuote": true,

      "trailingComma": "es5"

    }

  }

相关文章

网友评论

      本文标题:eslint

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