Skip to content

TSConfig file

compiler options

option example or default Value what it does
target es6 JS version that TS will be compiled to
lib [dom, es6, ] available types definitions depending on the environment AND ES target(above), eg. browser or server
allowJS false allow JS files to exist in the root folder, and compile them to outDir
checkJS false check the syntax and errors in js file, but NOT compile and copy them to the outDir
jsx preserve support for jsx/tsx files
declaration true related to ship your code as public library, generates .d.ts files to be shipped with your dist library
declarationMap true related to ship your code as public library, generated source maps for your .d.ts files
sourceMap true make a source map from your js files to the corresponding ts files. in dev, will result in copying all your ts files to outDir
rootDir [“./src/**/*”] the root folder where all ts files exist, any files outside of rootDir will not be compiled
outDir ./dist the folder where the generated js files will be saved
removeComments true remove all comments from the generated js files
noEmit true check only, no js files will be generated
downLevelIteration false compile iterators one level down the current js target, to solve some issues with iterators not complied correctly
noEmitOnError false stop the compiler from emitting output (js files) if find any errors
strict false enable all strict type-checking options
noImplicitAny false prevent defining implicit any function parameters, force us to type any parameters that compiler can not infer
strictNullChecks false scan code for possible null/undefined values
strictFunctionTypes false strict function typing, parameters and return types
strictBindCallApply false prevent function.bind(this) on a null value
strictPropertyInitialization false important for working with classes
noImplicitThis false complier will warn if you used ‘this’ in a place where it is not clear which object it’s refers to
alwaysStrict false controls if generated js files will be in strict mode
noUnusedLocals false
noUnusedParameters false
noImplicitReturns false enforces that a function that returns, will always return
noFallthroughCasesInSwitch false enforce putting default case in switch statements
experimentalDecorators false enable experimental decorators support
outFile ./dist/app.js generated a single app.js file for the entire project, instead of compiling files individually