TypeScript Flags & Options
Typed superset of JavaScript and its compiler, tsc.All TypeScript pages
- tsc --outDir and --rootDir: control where compiled .js files gotsc --outDir and --rootDir control where compiled .js files go. Why output lands in dist/src, fixing TS6059 and TS5011, and the TypeScript 6 rootDir default.
- tsc --showConfig: print the final tsconfig after extends and defaultstsc --showConfig prints the final tsconfig after extends, command-line overrides and implied options, without compiling. How to read and debug the output.
- tsc --target: which JavaScript version TypeScript emits (es2017, es2020, esnext)tsc --target sets which JavaScript version TypeScript emits: what es2015, es2017, es2020 and esnext keep or downlevel, ES5 removal in TypeScript 7, lib.
- tsc -p (--project): compile with a specific tsconfig file or foldertsc -p (--project) compiles with a specific tsconfig file or folder. Extended configs, relative paths, and errors TS5058, TS5081, TS5112 and TS18003 explained.