You can find all the Compiler options in the TypeScript docs. The new TS docs also has per-flag annotations of what each does. This is the setup I roll with for APPS (not libraries - for libraries you may wish to see the settings we use in
You can find more recommended TS config here.
Please open an issue and discuss if there are better recommended choices for React.
Selected flags and why we like them:
esModuleInterop: disables namespace imports (
import * as foo from "foo") and enables CJS/AMD/UMD style imports (
import fs from "fs")
strictPropertyInitializationforces you to initialize class properties or explicitly declare that they can be undefined. You can opt out of this with a definite assignment assertion.
"typeRoots": ["./typings", "./node_modules/@types"]: By default, TypeScript looks in
node_modules/@typesand parent folders for third party type declarations. You may wish to override this default resolution so you can put all your global type declarations in a special