Typescript Configuration

Examples

Relative Paths / Jared Palmer method

Uses webpack paths (see: https://gist.github.com/whoisryosuke/54a13d41797c9d69295c1bbaf41ed7cc). Config from https://github.com/jaredpalmer/thinkaboutthis.fm/blob/master/tsconfig.json

tsconfig.json:

{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"module": "commonjs",
"target": "esnext",
"jsx": "react",
"lib": ["dom", "es2015", "es2017"],
"baseUrl": "./",
"paths": {
"@components/*": ["src/components/*"],
"@forms/*": ["src/forms/*"],
"@api/*": ["src/api/*"],
"@lib/*": ["src/lib/*"],
"@utils/*": ["src/utils/*"],
"@screens/*": ["src/screens/*"],
"@theme": ["src/theme"]
}
},
"include": ["./src/**/*"]
}