Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 493
Jiovan Melendez Avatar asked Oct 20 '25 07:10

Jiovan Melendez


1 Answers

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.

like image 113
J.Wang Avatar answered Oct 21 '25 19:10

J.Wang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!