Repository navigation
chore: tidy comments in src/ and fix typos in API error messages - #1714
Conversation
Trim, deduplicate and correct comments under src/:
- fix comments that referenced a removed fs/readFile override, wrong
files/functions, or stale type names
- keep detailed explanations in one place (function docs) with short
pointers from types.ts
- keep the Windows path / casing gotchas and upstream issue links
Also fix doubled wording in two error messages and an info log
("TypeScript TypeScript mode", "TypeScript typeScript API",
"typescript typeScript API").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Benchmark (Ubuntu)
PR branch = |
Benchmark (macOS)
PR branch = |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are limited to comments and message wording, with no unresolved correctness or maintainability issues identified.
No open issues 🎉
What changed in this PR
This PR tidies comments in ts-loader’s TypeScript API integration and corrects three user-facing messages without changing compilation logic.
Changes:
- Corrects stale comment references and descriptions of snapshot layering and cache lifetimes.
- Condenses duplicated explanations while preserving key performance and Windows compatibility details.
- Fixes wording in two error messages and one informational log.
| File | Description |
|---|---|
| src/typeScriptApi.ts | Updates API integration comments and fixes two error messages. |
| src/types.ts | Corrects type and cache documentation and removes duplication. |
| src/index.ts | Simplifies lifecycle comments and fixes informational log wording. |
| src/colors.ts | Condenses comments describing shared color instances. |
Review effort: Balanced
Benchmark (Windows)
PR branch = |
Summary
Comment-only tidy-up of
src/, plus three message typo fixes.Comments that were wrong, now fixed
recheckAllTransitiveDependants,findTransitiveDependants) explained behaviour via anfs/readFileoverride increateTypeScriptInstancethat no longer exists - rewritten to match the current layering approach.reportPendingTypeScriptDiagnostics"in index.ts" (it's indiagnostics.ts), "index.ts's postCompile hook" (it'saddPostCompileHooks),openPrimaryProject's listed callers.reportConfigFileParsingErrorsclaimed it throws; it returns the message.types.tsused stale names (FilePathKey,ResolvedPathCache), describeddirectImportsCacheas per-build (it persists across builds), and contained a mis-encoded×.Duplication / excess removed
types.tsduplicated the function docs; detail now lives once on the function, with a short pointer fromtypes.ts.Message fixes
TypeScript TypeScript mode could not resolve project for X.→TypeScript could not resolve a project for X.Could not load TypeScript typeScript API from …→Could not load the TypeScript API from …Using typescript typeScript API with …→Using typescript API with …None of these strings appear in any test snapshot.
Test plan
npm run buildnpm run lintnpm run comparison-tests- all pass🤖 Generated with Claude Code