prettier-java-next-line 2.11.0 → 2.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -35,6 +35,24 @@ Set `braceStyle` only when a project needs the inherited same-line style:
35
35
  }
36
36
  ```
37
37
 
38
+ With next-line braces, array initializers put every element on its own line by default. Set `arrayInitializerLayout` to `fit` to keep an array initializer on one line when it fits, and break it into the next-line layout only when it doesn't. When it fits, `bracketSpacing` decides whether to print `{ 1, 2 }` or `{1, 2}`.
39
+
40
+ ```json
41
+ {
42
+ "plugins": ["prettier-java-next-line"],
43
+ "arrayInitializerLayout": "fit"
44
+ }
45
+ ```
46
+
47
+ Set `closingBracket` to `same-line` to keep the closing `)` or `>` of a wrapped list on its last line instead of on its own line. This matches Checkstyle's `SeparatorWrap` check on `RPAREN` with the `eol` option:
48
+
49
+ ```json
50
+ {
51
+ "plugins": ["prettier-java-next-line"],
52
+ "closingBracket": "same-line"
53
+ }
54
+ ```
55
+
38
56
  Set `importOrder` to group imports the way Spotless's `importOrder` step does. Groups separated by `,` get blank lines between them, prefixes joined by `|` share a group, `#` marks a static prefix, and an empty prefix catches everything else. Each import belongs to its longest matching prefix. Module imports (`import module`) always come first in their own group. When `importOrder` is empty, static imports follow them, then all others.
39
57
 
40
58
  ```json