--- source: crates/biome_formatter_test/src/snapshot_builder.rs info: js/arrows/tuple-and-record.js --- # Input ```js const fn12 = (a) => (b) => (c) => (d) => (e) => ({ foo: bar, bar: baz, baz: foo }); const fn12 = (a) => (b) => (c) => (d) => (e) => (#{ foo: bar, bar: baz, baz: foo }); map(() => ([ // comment foo ])); map(() => (#[ // comment foo ])); map(() => ({ // comment foo })); map(() => (#{ // comment foo })); ``` # Prettier differences ```diff --- Prettier +++ Biome @@ -4,28 +4,32 @@ baz: foo, }); -const fn12 = (a) => (b) => (c) => (d) => (e) => #{ - foo: bar, - bar: baz, - baz: foo, -}; +const fn12 = (a) => (b) => (c) => (d) => (e) => + (# +{ + foo: bar, bar; + : baz, baz: foo +} +) map(() => [ // comment foo, ]); -map(() => #[ +map(() => (#[ // comment - foo, -]); + foo +]) +) map(() => ({ // comment foo, })); -map(() => #{ +map(() => (#{ // comment - foo, -}); + foo +}) +) ``` # Output ```js const fn12 = (a) => (b) => (c) => (d) => (e) => ({ foo: bar, bar: baz, baz: foo, }); const fn12 = (a) => (b) => (c) => (d) => (e) => (# { foo: bar, bar; : baz, baz: foo } ) map(() => [ // comment foo, ]); map(() => (#[ // comment foo ]) ) map(() => ({ // comment foo, })); map(() => (#{ // comment foo }) ) ``` # Errors ``` tuple-and-record.js:5:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier but instead found '{'. 4 │ const fn12 = (a) => (b) => (c) => (d) => (e) => > 5 │ (#{ foo: bar, bar: baz, baz: foo }); │ ^ 6 │ 7 │ map(() => ([ i Expected an identifier here. 4 │ const fn12 = (a) => (b) => (c) => (d) => (e) => > 5 │ (#{ foo: bar, bar: baz, baz: foo }); │ ^ 6 │ 7 │ map(() => ([ tuple-and-record.js:5:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Private names are only allowed on the left side of a 'in' expression 4 │ const fn12 = (a) => (b) => (c) => (d) => (e) => > 5 │ (#{ foo: bar, bar: baz, baz: foo }); │ ^ 6 │ 7 │ map(() => ([ tuple-and-record.js:5:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `{` 4 │ const fn12 = (a) => (b) => (c) => (d) => (e) => > 5 │ (#{ foo: bar, bar: baz, baz: foo }); │ ^ 6 │ 7 │ map(() => ([ i Remove { tuple-and-record.js:5:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a semicolon or an implicit semicolon after a statement, but found none 4 │ const fn12 = (a) => (b) => (c) => (d) => (e) => > 5 │ (#{ foo: bar, bar: baz, baz: foo }); │ ^ 6 │ 7 │ map(() => ([ i An explicit or implicit semicolon is expected here... 4 │ const fn12 = (a) => (b) => (c) => (d) => (e) => > 5 │ (#{ foo: bar, bar: baz, baz: foo }); │ ^ 6 │ 7 │ map(() => ([ i ...Which is required to end this statement 4 │ const fn12 = (a) => (b) => (c) => (d) => (e) => > 5 │ (#{ foo: bar, bar: baz, baz: foo }); │ ^^^^^^^^^ 6 │ 7 │ map(() => ([ tuple-and-record.js:5:37 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a statement but instead found ')'. 4 │ const fn12 = (a) => (b) => (c) => (d) => (e) => > 5 │ (#{ foo: bar, bar: baz, baz: foo }); │ ^ 6 │ 7 │ map(() => ([ i Expected a statement here. 4 │ const fn12 = (a) => (b) => (c) => (d) => (e) => > 5 │ (#{ foo: bar, bar: baz, baz: foo }); │ ^ 6 │ 7 │ map(() => ([ tuple-and-record.js:12:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier but instead found '['. 10 │ ])); 11 │ > 12 │ map(() => (#[ │ ^ 13 │ // comment 14 │ foo i Expected an identifier here. 10 │ ])); 11 │ > 12 │ map(() => (#[ │ ^ 13 │ // comment 14 │ foo tuple-and-record.js:12:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Private names are only allowed on the left side of a 'in' expression 10 │ ])); 11 │ > 12 │ map(() => (#[ │ ^ 13 │ // comment 14 │ foo tuple-and-record.js:12:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `[` 10 │ ])); 11 │ > 12 │ map(() => (#[ │ ^ 13 │ // comment 14 │ foo i Remove [ tuple-and-record.js:15:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a semicolon or an implicit semicolon after a statement, but found none 13 │ // comment 14 │ foo > 15 │ ])); │ ^ 16 │ 17 │ map(() => ({ i An explicit or implicit semicolon is expected here... 13 │ // comment 14 │ foo > 15 │ ])); │ ^ 16 │ 17 │ map(() => ({ i ...Which is required to end this statement 10 │ ])); 11 │ > 12 │ map(() => (#[ │ ^^^^^^^^^^^^^ > 13 │ // comment > 14 │ foo > 15 │ ])); │ ^^^ 16 │ 17 │ map(() => ({ tuple-and-record.js:22:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier but instead found '{'. 20 │ })); 21 │ > 22 │ map(() => (#{ │ ^ 23 │ // comment 24 │ foo i Expected an identifier here. 20 │ })); 21 │ > 22 │ map(() => (#{ │ ^ 23 │ // comment 24 │ foo tuple-and-record.js:22:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Private names are only allowed on the left side of a 'in' expression 20 │ })); 21 │ > 22 │ map(() => (#{ │ ^ 23 │ // comment 24 │ foo tuple-and-record.js:22:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `{` 20 │ })); 21 │ > 22 │ map(() => (#{ │ ^ 23 │ // comment 24 │ foo i Remove { tuple-and-record.js:25:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a semicolon or an implicit semicolon after a statement, but found none 23 │ // comment 24 │ foo > 25 │ })); │ ^ 26 │ i An explicit or implicit semicolon is expected here... 23 │ // comment 24 │ foo > 25 │ })); │ ^ 26 │ i ...Which is required to end this statement 20 │ })); 21 │ > 22 │ map(() => (#{ │ ^^^^^^^^^^^^^ > 23 │ // comment > 24 │ foo > 25 │ })); │ ^^^ 26 │ ```