@wasm-fmt/mago_fmt 0.9.0 → 0.10.1

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/jsr.jsonc CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://jsr.io/schema/config-file.v1.json",
3
3
  "name": "@fmt/mago-fmt",
4
- "version": "0.9.0",
4
+ "version": "0.10.1",
5
5
  "exports": {
6
6
  ".": "./mago_fmt.js",
7
7
  "./esm": "./mago_fmt_esm.js",
package/mago_fmt_bg.wasm CHANGED
Binary file
@@ -51,7 +51,7 @@ export interface Settings {
51
51
 
52
52
  /**
53
53
  * End-of-line characters to use.
54
- * @default "lf"
54
+ * @default "auto"
55
55
  */
56
56
  "end-of-line"?: "auto" | "lf" | "crlf" | "cr";
57
57
 
@@ -438,6 +438,31 @@ export interface Settings {
438
438
  */
439
439
  "preserve-breaking-member-access-chain"?: boolean;
440
440
 
441
+ /**
442
+ * When preserving a broken object method chain, keep the first method call on the same line as the receiver.
443
+ *
444
+ * This only affects already-broken chains preserved by
445
+ * `"preserve-breaking-member-access-chain"`, and does not change the default
446
+ * breaking style for newly broken chains.
447
+ * @default false
448
+ *
449
+ * @example true
450
+ * ```php
451
+ * $object->method1()
452
+ * ->method2()
453
+ * ->method3();
454
+ * ```
455
+ *
456
+ * @example false
457
+ * ```php
458
+ * $object
459
+ * ->method1()
460
+ * ->method2()
461
+ * ->method3();
462
+ * ```
463
+ */
464
+ "preserve-breaking-member-access-chain-first-method-on-same-line"?: boolean;
465
+
441
466
  /**
442
467
  * Whether to preserve line breaks in argument lists, even if they could fit on a single line.
443
468
  * @default false
@@ -567,6 +592,61 @@ export interface Settings {
567
592
  */
568
593
  "indent-binary-expression-continuation"?: boolean;
569
594
 
595
+ /**
596
+ * Whether to omit redundant parentheses around arithmetic binary expressions under comparison and null coalesce expressions.
597
+ * @default false
598
+ *
599
+ * @example true
600
+ * ```php
601
+ * if ($i === $retries - 1) {
602
+ * }
603
+ * ```
604
+ *
605
+ * @example false
606
+ * ```php
607
+ * if ($i === ($retries - 1)) {
608
+ * }
609
+ * ```
610
+ */
611
+ "omit-redundant-arithmetic-binary-expression-parentheses"?: boolean;
612
+
613
+ /**
614
+ * Whether to omit redundant parentheses around bitwise binary child expressions.
615
+ * @default false
616
+ *
617
+ * @example true
618
+ * ```php
619
+ * if ($mask === $flags << 1) {
620
+ * }
621
+ * ```
622
+ *
623
+ * @example false
624
+ * ```php
625
+ * if ($mask === ($flags << 1)) {
626
+ * }
627
+ * ```
628
+ */
629
+ "omit-redundant-bitwise-binary-expression-parentheses"?: boolean;
630
+
631
+ /**
632
+ * Whether to preserve author-written parentheses around logical binary sub-expressions
633
+ * even when PHP's operator precedence makes them redundant.
634
+ * @default false
635
+ *
636
+ * @example true
637
+ * ```php
638
+ * if (($var1 > 200 && $var2 < 1) || ($var1 <= 200 && $var2 < 3)) {
639
+ * }
640
+ * ```
641
+ *
642
+ * @example false
643
+ * ```php
644
+ * if ($var1 > 200 && $var2 < 1 || $var1 <= 200 && $var2 < 3) {
645
+ * }
646
+ * ```
647
+ */
648
+ "preserve-redundant-logical-binary-expression-parentheses"?: boolean;
649
+
570
650
  /**
571
651
  * Whether to always break named argument lists into multiple lines.
572
652
  * @default false
@@ -596,6 +676,29 @@ export interface Settings {
596
676
  */
597
677
  "always-break-attribute-named-argument-lists"?: boolean;
598
678
 
679
+ /**
680
+ * Whether to align named arguments in multiline argument lists.
681
+ * @default false
682
+ *
683
+ * @example true
684
+ * ```php
685
+ * some_function(
686
+ * short: 1,
687
+ * longerName: 2,
688
+ * longestName: 3,
689
+ * );
690
+ * ```
691
+ */
692
+ "align-named-arguments"?: boolean;
693
+
694
+ /**
695
+ * Whether to align multiline function and method parameter lists by the variable column.
696
+ *
697
+ * This is especially useful for promoted constructor properties with visibility modifiers.
698
+ * @default false
699
+ */
700
+ "align-parameters"?: boolean;
701
+
599
702
  /**
600
703
  * Whether to use table-style alignment for arrays.
601
704
  * @default true
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "magic-akari <akari.ccino@gmail.com>"
6
6
  ],
7
7
  "description": "A WASM based PHP Formatter",
8
- "version": "0.9.0",
8
+ "version": "0.10.1",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",