--- source: crates/rome_formatter_test/src/snapshot_builder.rs info: test_file: js/destructuring-private-fields/async-arrow-params.js --- # Input ```js class C { #x = 1; #p = async ({ #x: x }) => {} } ``` # Prettier differences ```diff --- Prettier +++ Rome @@ -1,4 +1,6 @@ class C { #x = 1; - #p = async ({ #x: x }) => {}; + #p = async ({ #x: x }) + => { +} } ``` # Output ```js class C { #x = 1; #p = async ({ #x: x }) => { } } ``` # Errors ``` async-arrow-params.js:3:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected a property, a shorthand property, a getter, a setter, or a method but instead found '#x' 1 │ class C { 2 │ #x = 1; > 3 │ #p = async ({ #x: x }) => {} │ ^^ 4 │ } 5 │ i Expected a property, a shorthand property, a getter, a setter, or a method here 1 │ class C { 2 │ #x = 1; > 3 │ #p = async ({ #x: x }) => {} │ ^^ 4 │ } 5 │ async-arrow-params.js:3:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `:` 1 │ class C { 2 │ #x = 1; > 3 │ #p = async ({ #x: x }) => {} │ ^ 4 │ } 5 │ i Remove : async-arrow-params.js:3:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected a semicolon to end the class property, but found none 1 │ class C { 2 │ #x = 1; > 3 │ #p = async ({ #x: x }) => {} │ ^^^^^^^^^^^^^^^^^^^^^^ 4 │ } 5 │ async-arrow-params.js:3:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected an identifier, a string literal, a number literal, a private field name, or a computed name but instead found '=>' 1 │ class C { 2 │ #x = 1; > 3 │ #p = async ({ #x: x }) => {} │ ^^ 4 │ } 5 │ i Expected an identifier, a string literal, a number literal, a private field name, or a computed name here 1 │ class C { 2 │ #x = 1; > 3 │ #p = async ({ #x: x }) => {} │ ^^ 4 │ } 5 │ async-arrow-params.js:4:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected a statement but instead found '}' 2 │ #x = 1; 3 │ #p = async ({ #x: x }) => {} > 4 │ } │ ^ 5 │ i Expected a statement here 2 │ #x = 1; 3 │ #p = async ({ #x: x }) => {} > 4 │ } │ ^ 5 │ ```