TypeScript
Config Commands
Configure TypeScript with tsconfig.json. Set compiler options, path aliases, strict mode settings, and project references for complex multi-package setups.
6 commands
Pro Tips
Use 'tsc --init' to generate a tsconfig.json with all options commented — great learning reference.
Enable 'strict: true' from the start. It's much harder to add strictness to an existing codebase.
Use 'paths' with 'baseUrl' for import aliases: '"@/*": ["./src/*"]' instead of '../../../'.
Common Mistakes
Path aliases in tsconfig only work for type resolution. You need bundler/runtime support (tsconfig-paths) for actual imports.
'skipLibCheck: true' speeds up compilation but may hide type errors in dependencies. Disable to catch issues early.