--- source: crates/rome_formatter_test/src/snapshot_builder.rs info: test_file: js/module-blocks/range.js --- # Input ```js let moduleBlock = module { export let y = 1; }; foo(module { export let foo = "foo"; }) ``` # Prettier differences ```diff --- Prettier +++ Rome @@ -1,7 +1,5 @@ let moduleBlock = module { export let y = 1; -}; +} -foo(module { - export let foo = "foo"; -}); +foo(module { export let foo = "foo"; }) ``` # Output ```js let moduleBlock = module { export let y = 1; } foo(module { export let foo = "foo"; }) ``` # Errors ``` range.js:1:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a semicolon or an implicit semicolon after a statement, but found none > 1 │ let moduleBlock = module { export let y = 1; │ ^ 2 │ }; 3 │ i An explicit or implicit semicolon is expected here... > 1 │ let moduleBlock = module { export let y = 1; │ ^ 2 │ }; 3 │ i ...Which is required to end this statement > 1 │ let moduleBlock = module { export let y = 1; │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 2 │ }; 3 │ range.js:1:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Illegal use of an export declaration not at the top level > 1 │ let moduleBlock = module { export let y = 1; │ ^^^^^^^^^^^^^^^^^ 2 │ }; 3 │ i move this declaration to the top level range.js:4:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `{` 2 │ }; 3 │ > 4 │ foo(module { export let foo = "foo"; }) │ ^ 5 │ i Remove { range.js:4:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `:` but instead found `let` 2 │ }; 3 │ > 4 │ foo(module { export let foo = "foo"; }) │ ^^^ 5 │ i Remove let range.js:4:25 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `foo` 2 │ }; 3 │ > 4 │ foo(module { export let foo = "foo"; }) │ ^^^ 5 │ i Remove foo range.js:4:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Did you mean to use a `:`? An `=` can only follow a property name when the containing object literal is part of a destructuring pattern. 2 │ }; 3 │ > 4 │ foo(module { export let foo = "foo"; }) │ ^ 5 │ range.js:4:36 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `;` 2 │ }; 3 │ > 4 │ foo(module { export let foo = "foo"; }) │ ^ 5 │ i Remove ; range.js:4:38 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected a statement but instead found '})' 2 │ }; 3 │ > 4 │ foo(module { export let foo = "foo"; }) │ ^^ 5 │ i Expected a statement here 2 │ }; 3 │ > 4 │ foo(module { export let foo = "foo"; }) │ ^^ 5 │ ```