notes/typescript/README.md
TypeScript compiler and checker behavior. TypeScript resolves files for type information; it is not a JavaScript runtime resolver.
Module resolution searches TypeScript, declaration, JavaScript, and, when enabled, JSON extensions independently of allowJs (resolver extension masks). The program builder later decides which discovered JavaScript files become program inputs (filtering).
The resolver replaces known emitted extensions before it adds extension candidates. An explicit ./value.js can resolve to value.ts, value.tsx, value.d.ts, then value.js (candidate table). In non-ESM modes, it can then append extensions to the original candidate (resolution flow).
For an explicit .json request without resolveJsonModule, TypeScript can progress to appended candidates such as asset.json.js. This is type-resolution behavior; the compiler trace fixture records the candidate order.
TypeScript searches all ancestor node_modules directories for TypeScript and declaration files before starting a JavaScript fallback pass (two-pass lookup). This enables type discovery; it is not a runtime package-selection algorithm.
erasableSyntaxOnly rejects TypeScript syntax that requires runtime transformation. verbatimModuleSyntax preserves runtime imports, module: nodenext models Node module classification, and allowImportingTsExtensions permits explicit TypeScript specifiers for type-check-only projects. TypeScript's Node runtime guidance documents the checker-side contract.