简体   繁体   中英

How do I set up Prettier with Airbnb JavaScript Style Guide

How can I configure Airbnb's Style Guide in Prettier? I'm using VS Code. Thanks in advance!

eslint-config-prettier will disable all rule on formatting. It mentions eslint-config-airbnb several times in the Readme file, but they didn't guarantee that it 100% follow airbnb rules.

I guess the if you want to make sure they work fine together, you have to check the rules yourself.

Update:

I have check the source file of eslint-config-prettier . Here is the list of rules can be override:

// The following rules can be used in some cases. See the README for more
// information. (These are marked with `0` instead of `"off"` so that a
// script can distinguish them.)

curly: 0,
"max-len": 0,
"no-confusing-arrow": 0,
"no-mixed-operators": 0,
"no-tabs": 0,
quotes: 0,

According to their comment, other format rules should never be used with Prettier.

您可以使用eslint-config-prettier来扩展Prettier配置。

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