From 7446e128e0af6d0f23248dd98ead520be4c4d583 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Sun, 16 Apr 2023 18:48:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=F0=9F=90=9B=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/rome_json_parser/src/syntax.rs | 19 +++++- .../err/array_comma_and_number.json | 1 - .../err/array_extra_comma.json | 1 - .../err/array_extra_comma.json.snap | 7 +-- .../err/array_just_comma.json.snap | 12 ---- .../err/array_number_and_comma.json | 1 - .../err/array_number_and_comma.json.snap | 7 +-- .../err/object_trailing_comma.json | 1 - .../err/object_trailing_comma.json.snap | 7 +-- .../ok/array_number_and_comma.json | 1 + .../ok/array_number_and_comma.json.snap | 49 +++++++++++++++ .../ok/array_with_extra_one_comma.json | 1 + .../ok/array_with_extra_one_comma.json.snap | 49 +++++++++++++++ .../ok/object_trailing_comma.json | 1 + .../ok/object_trailing_comma.json.snap | 59 +++++++++++++++++++ 15 files changed, 179 insertions(+), 37 deletions(-) delete mode 100755 crates/rome_json_parser/tests/json_test_suite/err/array_comma_and_number.json delete mode 100644 crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json delete mode 100755 crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json delete mode 100755 crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json create mode 100755 crates/rome_json_parser/tests/json_test_suite/ok/array_number_and_comma.json create mode 100644 crates/rome_json_parser/tests/json_test_suite/ok/array_number_and_comma.json.snap create mode 100755 crates/rome_json_parser/tests/json_test_suite/ok/array_with_extra_one_comma.json create mode 100644 crates/rome_json_parser/tests/json_test_suite/ok/array_with_extra_one_comma.json.snap create mode 100755 crates/rome_json_parser/tests/json_test_suite/ok/object_trailing_comma.json create mode 100644 crates/rome_json_parser/tests/json_test_suite/ok/object_trailing_comma.json.snap diff --git a/crates/rome_json_parser/src/syntax.rs b/crates/rome_json_parser/src/syntax.rs index 18f2b7e0935..c70d4ace7b9 100644 --- a/crates/rome_json_parser/src/syntax.rs +++ b/crates/rome_json_parser/src/syntax.rs @@ -1,7 +1,8 @@ use crate::prelude::*; +use rome_diagnostics::DiagnosticExt; use rome_json_syntax::JsonSyntaxKind; use rome_json_syntax::JsonSyntaxKind::*; -use rome_parser::diagnostic::{expected_any, expected_node}; +use rome_parser::diagnostic::{expected_any, expected_node, expected_token}; use rome_parser::parse_recovery::ParseRecovery; use rome_parser::parsed_syntax::ParsedSyntax::Absent; use rome_parser::prelude::ParsedSyntax::Present; @@ -171,10 +172,19 @@ fn parse_sequence(p: &mut JsonParser, root_kind: SequenceKind) -> ParsedSyntax { let mut progress = ParserProgress::default(); while !p.at(EOF) && !p.at(current.kind.close_paren()) { - if first { + let last_token = if first { first = false; + Some(current.kind.open_paren()) } else { - p.expect(T![,]); + let last_token = p.last(); + p.expect(T![,]); + last_token + }; + + if p.at(current.kind.close_paren()) && !matches!(last_token, Some(T![,]) | None) { + // SAFETY: we know that previous should not be none + // let builder = p.err_builder("Trailing comma is not allowed in json", p.cur_range()).with_severity(rome_diagnostics::Severity::Warning); + break; } progress.assert_progressing(p); @@ -214,6 +224,9 @@ fn parse_sequence(p: &mut JsonParser, root_kind: SequenceKind) -> ParsedSyntax { } } + // while p.at(T![,]) { + // p.bump_any(); + // } current.list.complete(p, current.kind.list_kind()); p.expect(current.kind.close_paren()); let node = current.node.complete(p, current.kind.node_kind()); diff --git a/crates/rome_json_parser/tests/json_test_suite/err/array_comma_and_number.json b/crates/rome_json_parser/tests/json_test_suite/err/array_comma_and_number.json deleted file mode 100755 index d2c84e374a2..00000000000 --- a/crates/rome_json_parser/tests/json_test_suite/err/array_comma_and_number.json +++ /dev/null @@ -1 +0,0 @@ -[,1] \ No newline at end of file diff --git a/crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json b/crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json deleted file mode 100644 index 5f8ce18e4b2..00000000000 --- a/crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json +++ /dev/null @@ -1 +0,0 @@ -["",] \ No newline at end of file diff --git a/crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json.snap index f2cfb2ea5e0..c9aeb6b49c4 100644 --- a/crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json.snap +++ b/crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json.snap @@ -50,12 +50,7 @@ JsonRoot { ``` array_extra_comma.json:1:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected an array, an object, or a literal but instead found ']' - - > 1 │ ["",] - │ ^ - - i Expected an array, an object, or a literal here + × Trailing comma is not allowed in json > 1 │ ["",] │ ^ diff --git a/crates/rome_json_parser/tests/json_test_suite/err/array_just_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/err/array_just_comma.json.snap index 50ddacad8eb..7c81353d50e 100644 --- a/crates/rome_json_parser/tests/json_test_suite/err/array_just_comma.json.snap +++ b/crates/rome_json_parser/tests/json_test_suite/err/array_just_comma.json.snap @@ -57,18 +57,6 @@ array_just_comma.json:1:2 parse ━━━━━━━━━━━━━━━━ > 1 │ [,] │ ^ -array_just_comma.json:1:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected an array, an object, or a literal but instead found ']' - - > 1 │ [,] - │ ^ - - i Expected an array, an object, or a literal here - - > 1 │ [,] - │ ^ - ``` diff --git a/crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json b/crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json deleted file mode 100755 index 13f6f1d18a4..00000000000 --- a/crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json +++ /dev/null @@ -1 +0,0 @@ -[1,] \ No newline at end of file diff --git a/crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json.snap index c3e412f706f..19c58f2fc7e 100644 --- a/crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json.snap +++ b/crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json.snap @@ -50,12 +50,7 @@ JsonRoot { ``` array_number_and_comma.json:1:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected an array, an object, or a literal but instead found ']' - - > 1 │ [1,] - │ ^ - - i Expected an array, an object, or a literal here + × Trailing comma is not allowed in json > 1 │ [1,] │ ^ diff --git a/crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json b/crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json deleted file mode 100755 index a4b02509459..00000000000 --- a/crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json +++ /dev/null @@ -1 +0,0 @@ -{"id":0,} \ No newline at end of file diff --git a/crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json.snap index 697dbd1495b..be5e4750b8d 100644 --- a/crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json.snap +++ b/crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json.snap @@ -60,12 +60,7 @@ JsonRoot { ``` object_trailing_comma.json:1:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a property but instead found '}' - - > 1 │ {"id":0,} - │ ^ - - i Expected a property here + × Trailing comma is not allowed in json > 1 │ {"id":0,} │ ^ diff --git a/crates/rome_json_parser/tests/json_test_suite/ok/array_number_and_comma.json b/crates/rome_json_parser/tests/json_test_suite/ok/array_number_and_comma.json new file mode 100755 index 00000000000..e8b1a170fd0 --- /dev/null +++ b/crates/rome_json_parser/tests/json_test_suite/ok/array_number_and_comma.json @@ -0,0 +1 @@ +[1,] diff --git a/crates/rome_json_parser/tests/json_test_suite/ok/array_number_and_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/ok/array_number_and_comma.json.snap new file mode 100644 index 00000000000..dc52393960e --- /dev/null +++ b/crates/rome_json_parser/tests/json_test_suite/ok/array_number_and_comma.json.snap @@ -0,0 +1,49 @@ +--- +source: crates/rome_json_parser/tests/spec_test.rs +expression: snapshot +--- + +## Input + +```json +[1,] + +``` + + +## AST + +``` +JsonRoot { + value: JsonArrayValue { + l_brack_token: L_BRACK@0..1 "[" [] [], + elements: JsonArrayElementList [ + JsonNumberValue { + value_token: JSON_NUMBER_LITERAL@1..2 "1" [] [], + }, + COMMA@2..3 "," [] [], + missing element, + ], + r_brack_token: R_BRACK@3..4 "]" [] [], + }, + eof_token: EOF@4..5 "" [Newline("\n")] [], +} +``` + +## CST + +``` +0: JSON_ROOT@0..5 + 0: JSON_ARRAY_VALUE@0..4 + 0: L_BRACK@0..1 "[" [] [] + 1: JSON_ARRAY_ELEMENT_LIST@1..3 + 0: JSON_NUMBER_VALUE@1..2 + 0: JSON_NUMBER_LITERAL@1..2 "1" [] [] + 1: COMMA@2..3 "," [] [] + 2: (empty) + 2: R_BRACK@3..4 "]" [] [] + 1: EOF@4..5 "" [Newline("\n")] [] + +``` + + diff --git a/crates/rome_json_parser/tests/json_test_suite/ok/array_with_extra_one_comma.json b/crates/rome_json_parser/tests/json_test_suite/ok/array_with_extra_one_comma.json new file mode 100755 index 00000000000..e8b1a170fd0 --- /dev/null +++ b/crates/rome_json_parser/tests/json_test_suite/ok/array_with_extra_one_comma.json @@ -0,0 +1 @@ +[1,] diff --git a/crates/rome_json_parser/tests/json_test_suite/ok/array_with_extra_one_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/ok/array_with_extra_one_comma.json.snap new file mode 100644 index 00000000000..dc52393960e --- /dev/null +++ b/crates/rome_json_parser/tests/json_test_suite/ok/array_with_extra_one_comma.json.snap @@ -0,0 +1,49 @@ +--- +source: crates/rome_json_parser/tests/spec_test.rs +expression: snapshot +--- + +## Input + +```json +[1,] + +``` + + +## AST + +``` +JsonRoot { + value: JsonArrayValue { + l_brack_token: L_BRACK@0..1 "[" [] [], + elements: JsonArrayElementList [ + JsonNumberValue { + value_token: JSON_NUMBER_LITERAL@1..2 "1" [] [], + }, + COMMA@2..3 "," [] [], + missing element, + ], + r_brack_token: R_BRACK@3..4 "]" [] [], + }, + eof_token: EOF@4..5 "" [Newline("\n")] [], +} +``` + +## CST + +``` +0: JSON_ROOT@0..5 + 0: JSON_ARRAY_VALUE@0..4 + 0: L_BRACK@0..1 "[" [] [] + 1: JSON_ARRAY_ELEMENT_LIST@1..3 + 0: JSON_NUMBER_VALUE@1..2 + 0: JSON_NUMBER_LITERAL@1..2 "1" [] [] + 1: COMMA@2..3 "," [] [] + 2: (empty) + 2: R_BRACK@3..4 "]" [] [] + 1: EOF@4..5 "" [Newline("\n")] [] + +``` + + diff --git a/crates/rome_json_parser/tests/json_test_suite/ok/object_trailing_comma.json b/crates/rome_json_parser/tests/json_test_suite/ok/object_trailing_comma.json new file mode 100755 index 00000000000..28074759440 --- /dev/null +++ b/crates/rome_json_parser/tests/json_test_suite/ok/object_trailing_comma.json @@ -0,0 +1 @@ +{"id":0,} diff --git a/crates/rome_json_parser/tests/json_test_suite/ok/object_trailing_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/ok/object_trailing_comma.json.snap new file mode 100644 index 00000000000..bdecd707270 --- /dev/null +++ b/crates/rome_json_parser/tests/json_test_suite/ok/object_trailing_comma.json.snap @@ -0,0 +1,59 @@ +--- +source: crates/rome_json_parser/tests/spec_test.rs +expression: snapshot +--- + +## Input + +```json +{"id":0,} + +``` + + +## AST + +``` +JsonRoot { + value: JsonObjectValue { + l_curly_token: L_CURLY@0..1 "{" [] [], + json_member_list: JsonMemberList [ + JsonMember { + name: JsonMemberName { + value_token: JSON_STRING_LITERAL@1..5 "\"id\"" [] [], + }, + colon_token: COLON@5..6 ":" [] [], + value: JsonNumberValue { + value_token: JSON_NUMBER_LITERAL@6..7 "0" [] [], + }, + }, + COMMA@7..8 "," [] [], + missing element, + ], + r_curly_token: R_CURLY@8..9 "}" [] [], + }, + eof_token: EOF@9..10 "" [Newline("\n")] [], +} +``` + +## CST + +``` +0: JSON_ROOT@0..10 + 0: JSON_OBJECT_VALUE@0..9 + 0: L_CURLY@0..1 "{" [] [] + 1: JSON_MEMBER_LIST@1..8 + 0: JSON_MEMBER@1..7 + 0: JSON_MEMBER_NAME@1..5 + 0: JSON_STRING_LITERAL@1..5 "\"id\"" [] [] + 1: COLON@5..6 ":" [] [] + 2: JSON_NUMBER_VALUE@6..7 + 0: JSON_NUMBER_LITERAL@6..7 "0" [] [] + 1: COMMA@7..8 "," [] [] + 2: (empty) + 2: R_CURLY@8..9 "}" [] [] + 1: EOF@9..10 "" [Newline("\n")] [] + +``` + + From 9bc3f898340f10511f2b9ebb452acd5d4fa5cebe Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Sun, 16 Apr 2023 18:51:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=F0=9F=A4=96=20remove=20redundant?= =?UTF-8?q?=20snapshot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../err/array_extra_comma.json.snap | 60 ---------------- .../err/array_just_comma.json.snap | 62 ---------------- .../err/array_number_and_comma.json.snap | 60 ---------------- .../err/object_trailing_comma.json.snap | 70 ------------------- 4 files changed, 252 deletions(-) delete mode 100644 crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json.snap delete mode 100644 crates/rome_json_parser/tests/json_test_suite/err/array_just_comma.json.snap delete mode 100644 crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json.snap delete mode 100644 crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json.snap diff --git a/crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json.snap deleted file mode 100644 index c9aeb6b49c4..00000000000 --- a/crates/rome_json_parser/tests/json_test_suite/err/array_extra_comma.json.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: crates/rome_json_parser/tests/spec_test.rs -expression: snapshot ---- - -## Input - -```json -["",] -``` - - -## AST - -``` -JsonRoot { - value: JsonArrayValue { - l_brack_token: L_BRACK@0..1 "[" [] [], - elements: JsonArrayElementList [ - JsonStringValue { - value_token: JSON_STRING_LITERAL@1..3 "\"\"" [] [], - }, - COMMA@3..4 "," [] [], - missing element, - ], - r_brack_token: R_BRACK@4..5 "]" [] [], - }, - eof_token: EOF@5..5 "" [] [], -} -``` - -## CST - -``` -0: JSON_ROOT@0..5 - 0: JSON_ARRAY_VALUE@0..5 - 0: L_BRACK@0..1 "[" [] [] - 1: JSON_ARRAY_ELEMENT_LIST@1..4 - 0: JSON_STRING_VALUE@1..3 - 0: JSON_STRING_LITERAL@1..3 "\"\"" [] [] - 1: COMMA@3..4 "," [] [] - 2: (empty) - 2: R_BRACK@4..5 "]" [] [] - 1: EOF@5..5 "" [] [] - -``` - -## Diagnostics - -``` -array_extra_comma.json:1:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Trailing comma is not allowed in json - - > 1 │ ["",] - │ ^ - -``` - - diff --git a/crates/rome_json_parser/tests/json_test_suite/err/array_just_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/err/array_just_comma.json.snap deleted file mode 100644 index 7c81353d50e..00000000000 --- a/crates/rome_json_parser/tests/json_test_suite/err/array_just_comma.json.snap +++ /dev/null @@ -1,62 +0,0 @@ ---- -source: crates/rome_json_parser/tests/spec_test.rs -expression: snapshot ---- - -## Input - -```json -[,] -``` - - -## AST - -``` -JsonRoot { - value: JsonArrayValue { - l_brack_token: L_BRACK@0..1 "[" [] [], - elements: JsonArrayElementList [ - missing element, - COMMA@1..2 "," [] [], - missing element, - ], - r_brack_token: R_BRACK@2..3 "]" [] [], - }, - eof_token: EOF@3..3 "" [] [], -} -``` - -## CST - -``` -0: JSON_ROOT@0..3 - 0: JSON_ARRAY_VALUE@0..3 - 0: L_BRACK@0..1 "[" [] [] - 1: JSON_ARRAY_ELEMENT_LIST@1..2 - 0: (empty) - 1: COMMA@1..2 "," [] [] - 2: (empty) - 2: R_BRACK@2..3 "]" [] [] - 1: EOF@3..3 "" [] [] - -``` - -## Diagnostics - -``` -array_just_comma.json:1:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected an array, an object, or a literal but instead found ',' - - > 1 │ [,] - │ ^ - - i Expected an array, an object, or a literal here - - > 1 │ [,] - │ ^ - -``` - - diff --git a/crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json.snap deleted file mode 100644 index 19c58f2fc7e..00000000000 --- a/crates/rome_json_parser/tests/json_test_suite/err/array_number_and_comma.json.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: crates/rome_json_parser/tests/spec_test.rs -expression: snapshot ---- - -## Input - -```json -[1,] -``` - - -## AST - -``` -JsonRoot { - value: JsonArrayValue { - l_brack_token: L_BRACK@0..1 "[" [] [], - elements: JsonArrayElementList [ - JsonNumberValue { - value_token: JSON_NUMBER_LITERAL@1..2 "1" [] [], - }, - COMMA@2..3 "," [] [], - missing element, - ], - r_brack_token: R_BRACK@3..4 "]" [] [], - }, - eof_token: EOF@4..4 "" [] [], -} -``` - -## CST - -``` -0: JSON_ROOT@0..4 - 0: JSON_ARRAY_VALUE@0..4 - 0: L_BRACK@0..1 "[" [] [] - 1: JSON_ARRAY_ELEMENT_LIST@1..3 - 0: JSON_NUMBER_VALUE@1..2 - 0: JSON_NUMBER_LITERAL@1..2 "1" [] [] - 1: COMMA@2..3 "," [] [] - 2: (empty) - 2: R_BRACK@3..4 "]" [] [] - 1: EOF@4..4 "" [] [] - -``` - -## Diagnostics - -``` -array_number_and_comma.json:1:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Trailing comma is not allowed in json - - > 1 │ [1,] - │ ^ - -``` - - diff --git a/crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json.snap b/crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json.snap deleted file mode 100644 index be5e4750b8d..00000000000 --- a/crates/rome_json_parser/tests/json_test_suite/err/object_trailing_comma.json.snap +++ /dev/null @@ -1,70 +0,0 @@ ---- -source: crates/rome_json_parser/tests/spec_test.rs -expression: snapshot ---- - -## Input - -```json -{"id":0,} -``` - - -## AST - -``` -JsonRoot { - value: JsonObjectValue { - l_curly_token: L_CURLY@0..1 "{" [] [], - json_member_list: JsonMemberList [ - JsonMember { - name: JsonMemberName { - value_token: JSON_STRING_LITERAL@1..5 "\"id\"" [] [], - }, - colon_token: COLON@5..6 ":" [] [], - value: JsonNumberValue { - value_token: JSON_NUMBER_LITERAL@6..7 "0" [] [], - }, - }, - COMMA@7..8 "," [] [], - missing element, - ], - r_curly_token: R_CURLY@8..9 "}" [] [], - }, - eof_token: EOF@9..9 "" [] [], -} -``` - -## CST - -``` -0: JSON_ROOT@0..9 - 0: JSON_OBJECT_VALUE@0..9 - 0: L_CURLY@0..1 "{" [] [] - 1: JSON_MEMBER_LIST@1..8 - 0: JSON_MEMBER@1..7 - 0: JSON_MEMBER_NAME@1..5 - 0: JSON_STRING_LITERAL@1..5 "\"id\"" [] [] - 1: COLON@5..6 ":" [] [] - 2: JSON_NUMBER_VALUE@6..7 - 0: JSON_NUMBER_LITERAL@6..7 "0" [] [] - 1: COMMA@7..8 "," [] [] - 2: (empty) - 2: R_CURLY@8..9 "}" [] [] - 1: EOF@9..9 "" [] [] - -``` - -## Diagnostics - -``` -object_trailing_comma.json:1:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Trailing comma is not allowed in json - - > 1 │ {"id":0,} - │ ^ - -``` - -