Skip to content

Commit 6ee9a1e

Browse files
committed
fix: #24 - Comma missing on object property when using ignore statement.
Makes sense.
1 parent 015dc7e commit 6ee9a1e

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/parsing/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn parse_node_with_inner_parse<'a>(node: Node<'a>, context: &mut Context<'a>, in
8282
// parse the node
8383
if has_ignore_comment {
8484
items.push_str(""); // force the current line indentation
85-
items.extend(parser_helpers::parse_raw_string(&node.text(context)));
85+
items.extend(inner_parse(parser_helpers::parse_raw_string(&node.text(context)), context));
8686

8787
// mark any previous comments as handled
8888
for comment in context.comments.trailing_comments_with_previous(node_hi) {

tests/specs/issues/issue0024.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
~~ deno: true ~~
2+
== should format as-is with a comma at the end of the object property ==
3+
const files = [{
4+
// deno-fmt-ignore
5+
content: new Uint8Array([137,80,78,71,13,10,26,10, 137, 1, 25]),
6+
type: "image/png",
7+
name: "image",
8+
fileName: "some-image.png",
9+
}];
10+
11+
[expect]
12+
const files = [{
13+
// deno-fmt-ignore
14+
content: new Uint8Array([137,80,78,71,13,10,26,10, 137, 1, 25]),
15+
type: "image/png",
16+
name: "image",
17+
fileName: "some-image.png",
18+
}];

0 commit comments

Comments
 (0)