[英]How do I set up Prettier with Airbnb JavaScript Style Guide
How can I configure Airbnb's Style Guide in Prettier?如何在 Prettier 中配置 Airbnb 的风格指南? I'm using VS Code.
我正在使用 VS 代码。 Thanks in advance!
提前致谢!
eslint-config-prettier will disable all rule on formatting. eslint-config-prettier将禁用所有格式规则。 It mentions eslint-config-airbnb several times in the Readme file, but they didn't guarantee that it 100% follow airbnb rules.
它在自述文件中多次提到eslint-config-airbnb ,但他们并不能保证它 100% 遵循 airbnb 规则。
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
.我检查了
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.根据他们的评论,其他格式规则不应与 Prettier 一起使用。
您可以使用eslint-config-prettier来扩展Prettier配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.