|
| 1 | +--- |
| 2 | +source: crates/oxc_formatter/tests/fixtures/mod.rs |
| 3 | +--- |
| 4 | +==================== Input ==================== |
| 5 | +// Issue #22273 - Should have a space after commas in import attributes |
| 6 | +import myEmbeddedDb from './my.db' with { type: 'sqlite', embed: 'true' } |
| 7 | +import myEmbeddedDb2 from './my.db' with {type: 'sqlite',embed: 'true'} |
| 8 | +import myEmbeddedDb3 from './my.db' with { embed: 'true', type: 'sqlite' } |
| 9 | + |
| 10 | +// Should be spread over multiple lines |
| 11 | +import myEmbeddedDb4 from './my.db' with { type: 'sqlite', embed: 'true', veryLongAttribute: 'true' } |
| 12 | +import myEmbeddedDb5 from './my.db' with { veryVeryVeryVeryVeryVeryVeryVeryVeryLongAttribute: 'true' } |
| 13 | + |
| 14 | +==================== Output ==================== |
| 15 | +------------------ |
| 16 | +{ printWidth: 80 } |
| 17 | +------------------ |
| 18 | +// Issue #22273 - Should have a space after commas in import attributes |
| 19 | +import myEmbeddedDb from "./my.db" with { type: "sqlite", embed: "true" }; |
| 20 | +import myEmbeddedDb2 from "./my.db" with { type: "sqlite", embed: "true" }; |
| 21 | +import myEmbeddedDb3 from "./my.db" with { embed: "true", type: "sqlite" }; |
| 22 | + |
| 23 | +// Should be spread over multiple lines |
| 24 | +import myEmbeddedDb4 from "./my.db" with { |
| 25 | + type: "sqlite", |
| 26 | + embed: "true", |
| 27 | + veryLongAttribute: "true", |
| 28 | +}; |
| 29 | +import myEmbeddedDb5 from "./my.db" with { |
| 30 | + veryVeryVeryVeryVeryVeryVeryVeryVeryLongAttribute: "true", |
| 31 | +}; |
| 32 | + |
| 33 | +------------------- |
| 34 | +{ printWidth: 100 } |
| 35 | +------------------- |
| 36 | +// Issue #22273 - Should have a space after commas in import attributes |
| 37 | +import myEmbeddedDb from "./my.db" with { type: "sqlite", embed: "true" }; |
| 38 | +import myEmbeddedDb2 from "./my.db" with { type: "sqlite", embed: "true" }; |
| 39 | +import myEmbeddedDb3 from "./my.db" with { embed: "true", type: "sqlite" }; |
| 40 | + |
| 41 | +// Should be spread over multiple lines |
| 42 | +import myEmbeddedDb4 from "./my.db" with { |
| 43 | + type: "sqlite", |
| 44 | + embed: "true", |
| 45 | + veryLongAttribute: "true", |
| 46 | +}; |
| 47 | +import myEmbeddedDb5 from "./my.db" with { |
| 48 | + veryVeryVeryVeryVeryVeryVeryVeryVeryLongAttribute: "true", |
| 49 | +}; |
| 50 | + |
| 51 | +===================== End ===================== |
0 commit comments