如何在 Prettier 中配置 Airbnb 的风格指南?我正在使用 VS 代码。 提前致谢!
最佳答案
eslint-config-prettier 将禁用所有格式规则。它提到 eslint-config-airbnb自述文件中有几次,但他们不保证它 100% 遵循 airbnb 规则。
我想如果你想确保它们一起正常工作,你必须自己检查规则。
更新:
我查看了eslint-config-prettier
的源文件。以下是可以覆盖的规则列表:
// 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,
根据他们的评论,其他格式规则不应该与 Prettier 一起使用。
关于javascript - 如何使用 Airbnb JavaScript 样式指南设置 Prettier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45683213/