Skip to content

Commit e2dc003

Browse files
committed
Add another test
1 parent f5c2c7a commit e2dc003

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

crates/oxc_formatter/tests/fixtures/js/import-attributes/issue-22273.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ import myEmbeddedDb from './my.db' with { type: 'sqlite', embed: 'true' }
44
// Should be spread over multiple lines
55
import myEmbeddedDb from './my.db' with { type: 'sqlite', embed: 'true', veryLongAttribute: "true" }
66

7+
// Shouldn't have a comma for a single attribute
8+
import myEmbeddedDb from './my.db' with { type: 'sqlite' }
9+
10+

crates/oxc_formatter/tests/fixtures/js/import-attributes/issue-22273.mjs.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import myEmbeddedDb from './my.db' with { type: 'sqlite', embed: 'true' }
88
// Should be spread over multiple lines
99
import myEmbeddedDb from './my.db' with { type: 'sqlite', embed: 'true', veryLongAttribute: "true" }
1010

11+
// Shouldn't have a comma for a single attribute
12+
import myEmbeddedDb from './my.db' with { type: 'sqlite' }
13+
14+
1115

1216
==================== Output ====================
1317
------------------
@@ -23,6 +27,9 @@ import myEmbeddedDb from "./my.db" with {
2327
veryLongAttribute: "true",
2428
};
2529

30+
// Shouldn't have a comma for a single attribute
31+
import myEmbeddedDb from "./my.db" with { type: "sqlite" };
32+
2633
-------------------
2734
{ printWidth: 100 }
2835
-------------------
@@ -36,4 +43,7 @@ import myEmbeddedDb from "./my.db" with {
3643
veryLongAttribute: "true",
3744
};
3845

46+
// Shouldn't have a comma for a single attribute
47+
import myEmbeddedDb from "./my.db" with { type: "sqlite" };
48+
3949
===================== End =====================

0 commit comments

Comments
 (0)