You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Clarify bug replication in legacyMode with improved documentation
CHANGES:
- Updated sorting-proof.test.ts header documentation
* Changed from "BEHAVIOR OBSERVATION" to "Within-Group Sorting Bug Replication"
* Added EVIDENCE section proving this is a bug (not intentional design)
* Added WHY WE REPLICATE THIS BUG section explaining backward compatibility
* Added TECHNICAL IMPLEMENTATION section referencing source code
- Made legacyMode explicit in all test configs
* Added legacyMode: true to all test configs (was relying on defaults)
* Added inline comments: ✅ EXPLICIT and ❌ IGNORED for clarity
* Changed test names from "OBSERVATION" to "BUG" with clear descriptions
- Improved assertion messages
* Changed from "must produce observed behavior" to specific bug descriptions
* Changed from "must replicate observed behavior" to "replicates bug in legacy mode"
* Added explanatory comments about what SHOULD happen vs what DOES happen
- Enhanced README.md legacyMode documentation
* Changed "overrides certain settings" to "replicates ALL old behaviors (including bugs)"
* Changed "Disabled" to "IGNORED" for clarity (settings exist but are ignored)
* Added ⚠️ emoji to mark known bugs in legacy mode
* Added "Why replicate bugs?" and "Modern mode fixes these bugs" sections
* Added indentation behavior to the list (always spaces in legacy mode)
RATIONALE:
User asked "should we really replicate a bug?" - Answer: YES, for backward compatibility.
We DO replicate bugs in other tests (A2a, A6, TC2a, TC6) for the same reason:
migrated users depend on exact old output format. Any change would create massive
diffs across their codebase on first run, breaking trust.
The sorting bug is the "Level 2 sorting bug" mentioned in src/imports/import-manager.ts:948.
The old extension ALWAYS sorts within groups by library name, completely ignoring
both disableImportsSorting and organizeSortsByFirstSpecifier settings.
Legacy mode (legacyMode: true) replicates ALL bugs for backward compatibility.
Modern mode (legacyMode: false) FIXES all bugs and respects config settings.
TEST RESULTS:
✅ All 191 tests passing
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,15 +180,18 @@ Once your settings are migrated, you have two options:
180
180
181
181
If the old TypeScript Hero extension is still active, you'll see a reminder in the migration notification suggesting you can disable it.
182
182
183
-
**Legacy Mode:** For migrated users, `legacyMode` is automatically set to `true` to match the original TypeScript Hero behavior exactly. When enabled, legacy mode overrides certain settings to ensure 100% backward compatibility:
183
+
**Legacy Mode:** For migrated users, `legacyMode` is automatically set to `true` to match the original TypeScript Hero behavior exactly. When enabled, legacy mode replicates ALL old behaviors (including bugs) for 100% backward compatibility:
New users get `legacyMode: false` by default for modern best practices. You can toggle this setting anytime via the command palette or your configuration.
192
+
**Why replicate bugs?** Migrated users depend on exact old output. Any change would create massive diffs across their codebase on first run, breaking trust.
193
+
194
+
**Modern mode fixes these bugs:** New users get `legacyMode: false` by default for correct behavior. You can toggle this setting anytime via the command palette or your configuration.
0 commit comments