Skip to content

Commit 387c258

Browse files
committed
docs: Fix audit findings and add 12 true compatibility tests
Fixes all remaining audit findings from third review: - Documentation updated to remove 'legacy' enum value for blankLinesAfterImports - Clarified that legacyMode controls legacy behavior, not a separate enum value - Migration section now accurately describes legacyMode: true for migrated users - Verified no alias command registration (only miniTypescriptHero.imports.organize) - Verified package.json properly registers command with title and keybinding Added 12 true compatibility tests (Task A from audit): - TC1: Side-effect + named from same module (old crashes, new handles) - TC2a/b: removeTrailingIndex vs merging order (legacy vs modern modes) - TC3a/b: Idempotency tests (TypeScript and TSX files, run twice) - TC4: Regex group precedence over keyword groups - TC5: ignoredFromRemoval still sorts specifiers - TC6: Within-group sorting in legacy mode (even with disableImportsSorting) - TC7a/b: Type-only nuanced merges (legacy strips, modern preserves) - TC8: CRLF line ending preservation - TC9: Multiple groups with blank line separators Test results: - Main extension tests: 226 passing ✅ - Comparison harness tests: 159 passing ✅ (+12 new) - Total: 385 tests passing All critical audit findings resolved. Task B (20 edge case tests) remains for comprehensive coverage but all core functionality is validated.
1 parent 1c50a41 commit 387c258

2 files changed

Lines changed: 389 additions & 6 deletions

File tree

README-how-we-handle-blank-lines.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,18 +361,18 @@ import { A } from './a';
361361
export class Test {}
362362
```
363363

364-
**Mode `"legacy"`:**
365-
See test matrix for exact behavior (complex formula based on blanks before and after).
364+
**Legacy Mode (`legacyMode: true`):**
365+
Uses `'preserve'` behavior automatically. See test matrix for exact behavior (complex formula based on blanks before and after).
366366

367367
### Migration Strategy
368368

369369
**For migrated users** (detected by settings migration):
370-
- Auto-set `blankLinesAfterImports` to `"legacy"`
371-
- Maintains exact old behavior
372-
- Can manually change to `"one"` anytime
370+
- Auto-set `legacyMode: true`
371+
- Maintains exact old behavior (uses `'preserve'` mode for blank lines)
372+
- Can manually change to `legacyMode: false` and `blankLinesAfterImports: "one"` anytime
373373

374374
**For new users:**
375-
- Default `"one"` (industry standard)
375+
- Default `legacyMode: false` with `blankLinesAfterImports: "one"` (industry standard)
376376
- Clean, consistent, predictable
377377

378378
---

0 commit comments

Comments
 (0)