--- source: crates/biome_formatter_test/src/snapshot_builder.rs info: js/babel-plugins/pipeline-operator-minimal.js --- # Input ```js // https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator // https://github.com/tc39/proposal-pipeline-operator/ let result = exclaim(capitalize(doubleSay("hello"))); result //=> "Hello, hello!" let result = "hello" |> doubleSay |> capitalize |> exclaim; result //=> "Hello, hello!" ``` # Prettier differences ```diff --- Prettier +++ Biome @@ -4,6 +4,9 @@ let result = exclaim(capitalize(doubleSay("hello"))); result; //=> "Hello, hello!" -let result = "hello" |> doubleSay |> capitalize |> exclaim; +let result = "hello" + |> doubleSay + |> capitalize + |> exclaim; result; //=> "Hello, hello!" ``` # Output ```js // https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator // https://github.com/tc39/proposal-pipeline-operator/ let result = exclaim(capitalize(doubleSay("hello"))); result; //=> "Hello, hello!" let result = "hello" |> doubleSay |> capitalize |> exclaim; result; //=> "Hello, hello!" ``` # Errors ``` pipeline-operator-minimal.js:8:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an expression for the left hand side of the `>` operator. 7 │ let result = "hello" > 8 │ |> doubleSay │ ^ 9 │ |> capitalize 10 │ |> exclaim; i This operator requires a left hand side value pipeline-operator-minimal.js:9:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an expression for the left hand side of the `>` operator. 7 │ let result = "hello" 8 │ |> doubleSay > 9 │ |> capitalize │ ^ 10 │ |> exclaim; 11 │ i This operator requires a left hand side value pipeline-operator-minimal.js:10:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an expression for the left hand side of the `>` operator. 8 │ |> doubleSay 9 │ |> capitalize > 10 │ |> exclaim; │ ^ 11 │ 12 │ result //=> "Hello, hello!" i This operator requires a left hand side value ```