--- source: crates/rome_formatter_test/src/snapshot_builder.rs info: test_file: js/bind-expressions/unary.js --- # Input ```js !x::y; !(x::y /* foo */); !(/* foo */ x::y); !( /* foo */ x::y ); !( x::y /* foo */ ); !( x::y // foo ); ``` # Prettier differences ```diff --- Prettier +++ Rome @@ -1,14 +1,20 @@ -!x::y; -!(x::y /* foo */); -!(/* foo */ x::y); +!x; +::y +!(x +::y /* foo */) +!(/* foo */ x +::y) !( /* foo */ - x::y -); + x +::y +) !( - x::y + x +::y /* foo */ -); +) !( - x::y // foo -); + x +::y // foo +) ``` # Output ```js !x; ::y !(x ::y /* foo */) !(/* foo */ x ::y) !( /* foo */ x ::y ) !( x ::y /* foo */ ) !( x ::y // foo ) ``` # Errors ``` unary.js:1:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a semicolon or an implicit semicolon after a statement, but found none > 1 │ !x::y; │ ^ 2 │ !(x::y /* foo */); 3 │ !(/* foo */ x::y); i An explicit or implicit semicolon is expected here... > 1 │ !x::y; │ ^ 2 │ !(x::y /* foo */); 3 │ !(/* foo */ x::y); i ...Which is required to end this statement > 1 │ !x::y; │ ^^^ 2 │ !(x::y /* foo */); 3 │ !(/* foo */ x::y); unary.js:2:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `:` 1 │ !x::y; > 2 │ !(x::y /* foo */); │ ^ 3 │ !(/* foo */ x::y); 4 │ !( i Remove : unary.js:3:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `:` 1 │ !x::y; 2 │ !(x::y /* foo */); > 3 │ !(/* foo */ x::y); │ ^ 4 │ !( 5 │ /* foo */ i Remove : unary.js:6:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `:` 4 │ !( 5 │ /* foo */ > 6 │ x::y │ ^ 7 │ ); 8 │ !( i Remove : unary.js:9:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `:` 7 │ ); 8 │ !( > 9 │ x::y │ ^ 10 │ /* foo */ 11 │ ); i Remove : unary.js:13:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `:` 11 │ ); 12 │ !( > 13 │ x::y // foo │ ^ 14 │ ); 15 │ i Remove : ```