--- source: crates/biome_formatter_test/src/snapshot_builder.rs info: js/arrays/tuple-and-record.js --- # Input ```js a = [ [1,2], [1,2], ] a = [ #[1,2], #[1,2], ] a = [ {a, b}, {a, b}, ] a = [ #{a, b}, #{a, b}, ] ``` # Prettier differences ```diff --- Prettier +++ Biome @@ -4,9 +4,9 @@ ]; a = [ - #[1, 2], - #[1, 2], -]; + #[1,2], + #[1,2], +] a = [ { a, b }, @@ -14,6 +14,6 @@ ]; a = [ - #{ a, b }, - #{ a, b }, -]; + #{a, b}, + #{a, b}, +] ``` # Output ```js a = [ [1, 2], [1, 2], ]; a = [ #[1,2], #[1,2], ] a = [ { a, b }, { a, b }, ]; a = [ #{a, b}, #{a, b}, ] ``` # Errors ``` tuple-and-record.js:7:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier but instead found '['. 6 │ a = [ > 7 │ #[1,2], │ ^ 8 │ #[1,2], 9 │ ] i Expected an identifier here. 6 │ a = [ > 7 │ #[1,2], │ ^ 8 │ #[1,2], 9 │ ] tuple-and-record.js:7:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Private names are only allowed on the left side of a 'in' expression 6 │ a = [ > 7 │ #[1,2], │ ^ 8 │ #[1,2], 9 │ ] tuple-and-record.js:7:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `[` 6 │ a = [ > 7 │ #[1,2], │ ^ 8 │ #[1,2], 9 │ ] i Remove [ tuple-and-record.js:8:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier but instead found '['. 6 │ a = [ 7 │ #[1,2], > 8 │ #[1,2], │ ^ 9 │ ] 10 │ i Expected an identifier here. 6 │ a = [ 7 │ #[1,2], > 8 │ #[1,2], │ ^ 9 │ ] 10 │ tuple-and-record.js:8:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Private names are only allowed on the left side of a 'in' expression 6 │ a = [ 7 │ #[1,2], > 8 │ #[1,2], │ ^ 9 │ ] 10 │ tuple-and-record.js:8:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `[` 6 │ a = [ 7 │ #[1,2], > 8 │ #[1,2], │ ^ 9 │ ] 10 │ i Remove [ tuple-and-record.js:17:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier but instead found '{'. 16 │ a = [ > 17 │ #{a, b}, │ ^ 18 │ #{a, b}, 19 │ ] i Expected an identifier here. 16 │ a = [ > 17 │ #{a, b}, │ ^ 18 │ #{a, b}, 19 │ ] tuple-and-record.js:17:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Private names are only allowed on the left side of a 'in' expression 16 │ a = [ > 17 │ #{a, b}, │ ^ 18 │ #{a, b}, 19 │ ] tuple-and-record.js:17:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `{` 16 │ a = [ > 17 │ #{a, b}, │ ^ 18 │ #{a, b}, 19 │ ] i Remove { tuple-and-record.js:18:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier but instead found '{'. 16 │ a = [ 17 │ #{a, b}, > 18 │ #{a, b}, │ ^ 19 │ ] 20 │ i Expected an identifier here. 16 │ a = [ 17 │ #{a, b}, > 18 │ #{a, b}, │ ^ 19 │ ] 20 │ tuple-and-record.js:18:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Private names are only allowed on the left side of a 'in' expression 16 │ a = [ 17 │ #{a, b}, > 18 │ #{a, b}, │ ^ 19 │ ] 20 │ tuple-and-record.js:18:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `{` 16 │ a = [ 17 │ #{a, b}, > 18 │ #{a, b}, │ ^ 19 │ ] 20 │ i Remove { ```