Vue-Cli,如何禁用骆驼案警告

问题描述 投票:0回答:1

我正在通过在我的package.json文件中将Eslint camelcase规则设置为“ off”或0来禁用它。知道为什么它不起作用吗?

  "eslintConfig": {
"root": true,
"env": {
  "node": true
},
"extends": [
  "plugin:vue/essential",
  "eslint:recommended",
  "@vue/typescript/recommended"
],
"parserOptions": {
  "ecmaVersion": 2020
},
"rules": {
  "camelcase": "off"
},
"overrides": [
  {
    "files": [
      "**/__tests__/*.{j,t}s?(x)",
      "**/tests/unit/**/*.spec.{j,t}s?(x)"
    ],
    "env": {
      "mocha": true
    }
  }
]

}

vue.js eslint
1个回答
0
投票

您可以根据需要保留设置:

"rules": {
  "properties": "never",
  "ignoreDestructuring": true,
  "ignoreImports": false
},

这是默认设置和描述:

  1. “ properties”:“始终”(默认)对属性名称强制使用驼峰样式
  2. “” ignoreDestructuring“:false(默认)对已解构的标识符强制采用驼峰样式]
  3. “” ignoreImports“:false(默认)为ES2015导入强制使用驼峰样式]

此处有更多信息:https://eslint.org/docs/rules/camelcase

© www.soinside.com 2019 - 2024. All rights reserved.