简体   繁体   English

eslint规则不能与airbnb规则一起使用?

[英]eslint rules not working with airbnb rule?

I follow this guide 我遵循本指南

https://blog.echobind.com/integrating-prettier-eslint-airbnb-style-guide-in-vscode-47f07b5d7d6a https://blog.echobind.com/integrating-prettier-eslint-airbnb-style-guide-in-vscode-47f07b5d7d6a

to setup eslint with prettier in my project, but somehow the rules of no console doesn't work, eslint still throw warning when I use console.log, what's wrong here? 在我的项目中设置漂亮的eslint,但是某种程度上没有控制台的规则不起作用,当我使用console.log时,eslint仍然会发出警告,这是怎么了?

{
  "extends": ["airbnb", "prettier"],
  "plugins": ["prettier"],
  "rules": {
    "prettier/prettier": ["error"],
    "no-console": 0
  }
}

I have eslint and prettier installed in my vscode 我的vscode中安装了eslint和更漂亮

You must use 您必须使用

no-console: "error"

and within following to custom allows 在自定义允许范围内

no-console: ["error", { allow: ["warn", "error"] }]

reference: https://eslint.org/docs/rules/no-console 参考: https : //eslint.org/docs/rules/no-console

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

相关问题 如何处理 AirBNB 配置中冲突的 eslint 规则 - How to deal with conflicting eslint rules in AirBNB configuration 如何从eslint-config-airbnb有选择地启用eslint规则 - How to selectively enable eslint rules from eslint-config-airbnb 带有 Airbnb 风格指南的 ESLint 不适用于所有规则 - ESLint with Airbnb style guide does not work for all rules ESLint RC 规则不起作用,而规则注释起作用,其他规则起作用 - ESLint RC rule not working, while rule comment works and other rules do Airbnb样式指南:命名约定的规则不起作用 - Airbnb style guide:rules for naming conventions not working Eslint:禁用除 1 条规则以外的所有规则? - Eslint: disable all rules except 1 rule? ESLint 规则阻止用户禁用 ESLint 规则 - ESLint rule to block users from disabling ESLint rules 如何在 VS Code 编辑器中使用 ESLint + Airbnb 规则 + TypeScript + Stylelint 为 SCSS 配置 Vue CLI 4,并在保存时自动修复? - How to configure Vue CLI 4 with ESLint + Airbnb rules + TypeScript + Stylelint for SCSS, in VS Code editor with autofix on save? 如果div为空,则Eslint airbnb gets强制执行自我关闭div标签。 如何禁用此规则? - Eslint airbnb gets enforces self closing div tag if the div is empy. How can I disable this rule? Prettier + Airbnb 的 ESLint 配置 - Prettier + Airbnb's ESLint config
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM