-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.json
More file actions
39 lines (33 loc) · 2.01 KB
/
tsconfig.json
File metadata and controls
39 lines (33 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
"compilerOptions": {
/* Base Options: */
"esModuleInterop": true, // Enables compatibility with CommonJS modules
"skipLibCheck": true, // Skip type checking of declaration files
"target": "ES2016", // Target modern JavaScript features but ensure compatibility
"allowJs": true, // Allow JavaScript files to be compiled (optional, but can be helpful)
"resolveJsonModule": true, // Allow importing JSON files
"moduleDetection": "force", // Treat files as modules even without imports/exports
"isolatedModules": true, // Ensure modules are processed independently (needed for some bundlers/transpilers)
/* Strictness */
"strict": true, // Enable all strict type-checking options
"noUncheckedIndexedAccess": true, // Add 'undefined' to types derived from index signatures
"noImplicitAny": true, // Raise error on expressions and declarations with an implied 'any' type.
/* If transpiling with TypeScript: */
"module": "CommonJS", // Output module format (Webpack/ts-loader might override this)
"outDir": "./dist", // Redirect output structure to the directory
"sourceMap": true, // Generate corresponding '.map' file.
/* If NOT transpiling with TypeScript: */
// "module": "preserve", // Let Babel/Webpack handle module transformation
// "noEmit": true, // Do not emit output (use Babel/Webpack for actual JS generation)
/* Declaration Files */
"declaration": true, // Generate corresponding '.d.ts' file.
"declarationMap": true, // Generate source maps for declaration files.
"declarationDir": "./dist", // Output directory for generated declaration files.
/* Project Structure */
"rootDir": "./src", // Specify the root directory of input files
// "baseUrl": "./", // Base directory to resolve non-absolute module names (optional)
// "paths": {} // Module path aliases (optional)
},
"include": ["src/**/*.ts"], // Compile only files in the src directory
"exclude": ["node_modules", "dist", "__test__"] // Exclude these directories
}