[英]Where can I find the list of Prettier's default rules?
Suppose that the following code is given as input假设以下代码作为输入给出
message='Hello, '+"World";
console.log( message );
Prettier generates following code Prettier 生成以下代码
message = "Hello, " + "World";
console.log(message);
Spaces are inserted before and after +
operator.在
+
运算符之前和之后插入空格。 But I can't find a document that mentions this behavior.但我找不到提到这种行为的文件。
Is there a complete list of Prettier's default rules (especially about non-configurable ones)?是否有 Prettier 的默认规则的完整列表(尤其是关于不可配置的规则)?
The well-documented rules happen to be the configurable ones, which you can find here .有据可查的规则恰好是可配置的规则,您可以在此处找到。 However, if you're looking to explore everything prettier does, it may be worthwhile looking at the unit tests .
然而,如果你想探索所有更漂亮的东西,那么看看单元测试可能是值得的。 Specifically, each folder has a
__snapshots__
folder inside that contains a config, input, and output.具体来说,每个文件夹都有一个
__snapshots__
文件夹,其中包含配置、输入和 output。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.