简体   繁体   English

如何忽略标准中的 eslint 规则

[英]How to ignore eslint rules in standard

I have standardjs installed and this is my configs in package.json我已经安装了standardjs ,这是我在package.json配置

"standard": {
    "parser": "babel-eslint",
    "ignore": [
      "dist/",
      "*env*"
    ],
    "rules": {
      "eqeqeq": "off"
    }
  }

How do I ignore some of the eslint rules in this config file?如何忽略此配置文件中的某些 eslint 规则?

It looks like you're already adding one ESLint rule to ignore ('eqeqeq').看起来您已经添加了一个 ESLint 规则来忽略 ('eqeqeq')。 You just need to add the rules you want to ignore in the "rules" object in your config file, with the value "off".您只需要在配置文件的“规则”对象中添加要忽略的规则,值为“off”。

"rules": {
    "eqeqeq": "off",
    "no-console": "off"
}

See: https://eslint.org/docs/user-guide/configuring#using-configuration-files请参阅: https : //eslint.org/docs/user-guide/configuring#using-configuration-files

伙计们,答案是standardx x 带有自定义调整的标准。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM