Commit d0d5156
committed
docs(imports): record why ESM value imports are sorted
Sorting value imports is not semantically free — ESM evaluates modules in
first-requested order, so reordering two imports of side-effecting modules
changes initialization order, demonstrably (a fixture printing ZA before
organize prints AZ after).
It stays anyway, and the site now says why: Biome with organizeImports
enabled reorders the identical fixture, so this is an accepted ecosystem
tradeoff rather than an AFT defect, and pinning value imports would make
us the only organizer that silently declines to organize a JS file.
Code that genuinely depends on evaluation order has the language's own
escape hatch — a bare side-effect import, which this organizer already
treats as a hard barrier.
Written down because the next reader will find the reordering, recognise
the hazard, and otherwise 'fix' it into a behavior change.1 parent 4270d66 commit d0d5156
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
692 | 710 | | |
693 | 711 | | |
694 | 712 | | |
| |||
0 commit comments