简体   繁体   中英

eslint rules not working with airbnb rule?

I follow this guide

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?

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

I have eslint and prettier installed in my vscode

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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