Skip to Content
FrontendStructureFilestsconfig.json

tsconfig.json

Note: These are the default settings we use, but other options/settings : https://www.typescriptlang.org/docs/handbook/tsconfig-json.html .

compilerOptions

"sourceMap": true

Generates .map files that map the compiled JavaScript back to the original TypeScript for debugging.

"sourceMap": true
  • true → Enables source maps for debugging.
  • false → No source maps (smaller build, harder debugging).

"noImplicitAny": false

Allows implicit any type inference.

"noImplicitAny": false
  • true → Errors if any is inferred.
  • false → Allows implicit any.

"lib": ["esnext", "dom", "dom.iterable"]

Specifies standard libraries to include.

"lib": ["esnext", "dom", "dom.iterable"]
  • "esnext" → Includes latest JavaScript features.
  • "dom" → Enables browser APIs.
  • "dom.iterable" → Supports iteration over DOM collections.
  • Other options: "ES6", "ES2017", "WebWorker", etc.

"declaration": true

Generates .d.ts files for type definitions.

"declaration": true
  • true → Generates declaration files.
  • false → Skips .d.ts files.

"declarationMap": true

Enables .d.ts.map files for better debugging.

"declarationMap": true
  • true → Creates .d.ts.map files.
  • false → Skips .d.ts.map.

"removeComments": true

Removes comments from compiled JavaScript.

"removeComments": true
  • true → Removes comments.
  • false → Keeps comments.

"allowJs": true

Allows JavaScript (.js) files in TypeScript.

"allowJs": true
  • true → Allows JS files in the project.
  • false → TypeScript-only mode.

"baseUrl": "./src"

Sets the base directory for module resolution.

"baseUrl": "./src"
  • Enables absolute imports.
  • Without this, imports must use relative paths.

"esModuleInterop": true

Improves compatibility between CommonJS and ES modules.

"esModuleInterop": true
  • true → Allows default imports from CommonJS.
  • false → Requires import * as.

"resolveJsonModule": true

Allows importing JSON files.

"resolveJsonModule": true
  • true → Allows JSON imports.
  • false → Disables JSON imports.

"module": "ESNext"

Specifies the module system.

"module": "ESNext"
  • "CommonJS" → Uses require().
  • "ESNext" → Uses import/export.
  • Other options: "AMD", "UMD", "System".

"target": "ESNext"

Defines the ECMAScript version for compiled code.

"target": "ESNext"
  • "ES5" → For old browsers (IE11).
  • "ES6" → Modern browsers.
  • "ESNext" → Latest JavaScript features.

"moduleResolution": "bundler"

Defines module resolution strategy.

"moduleResolution": "bundler"
  • "node" → Standard Node.js resolution.
  • "bundler" → Optimized for modern bundlers.

"outDir": "./dist"

Sets the output folder for compiled JavaScript.

"outDir": "./dist"

"jsx": "preserve"

Controls JSX transformation.

"jsx": "preserve"
  • "preserve" → Keeps JSX syntax (for Babel).
  • "react" → Converts JSX to React.createElement.
  • "react-jsx" → Uses the new React JSX runtime.

"skipLibCheck": true

Skips type checking for libraries.

"skipLibCheck": true
  • true → Faster builds, may skip type errors.
  • false → Strict type checking.

📂 include & exclude

** "include": ["./src"]**

Specifies which files to compile.

"include": ["./src"]

"exclude": ["node_modules", "dist"]

Specifies which files to ignore.

"exclude": ["node_modules", "dist"]

ts-node Settings

"ts-node": { "transpileOnly": true }

Speeds up ts-node execution by skipping type checking.

"ts-node": { "transpileOnly": true }
Last updated on