eslint

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"

    }

  }

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容