Skip to content

Commit 4fb6756

Browse files
committed
Rewrote tsconfig.json
1 parent bc0158d commit 4fb6756

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

tsconfig.json

+31-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
11
{
22
"compilerOptions": {
3-
"noImplicitAny": true,
4-
"target": "es6",
5-
"moduleResolution": "node"
3+
// project options
4+
//"lib": [ "ESNext", "dom" ], // specifies which default set of type definitions to use ("DOM", "ES6", etc)
5+
"outDir": "dist", // .js (as well as .d.ts, .js.map, etc.) files will be emitted into this directory.,
6+
"removeComments": true, // Strips all comments from TypeScript files when converting into JavaScript- you rarely read compiled code so this saves space
7+
"target": "ES6", // Target environment. Most modern browsers support ES6, but you may want to set it to newer or older. (defaults to ES3)
8+
9+
// Module resolution
10+
"baseUrl": "./", // Lets you set a base directory to resolve non-absolute module names.
11+
"esModuleInterop": true, // fixes some issues TS originally had with the ES6 spec where TypeScript treats CommonJS/AMD/UMD modules similar to ES6 module
12+
"moduleResolution": "node", // Pretty much always node for modern JS. Other option is "classic"
13+
"paths": {}, // A series of entries which re-map imports to lookup locations relative to the baseUrl
14+
15+
// Source Map
16+
"sourceMap": true, // enables the use of source maps for debuggers and error reporting etc
17+
"sourceRoot": "/", // Specify the location where a debugger should locate TypeScript files instead of relative source locations.
18+
19+
// Strict Checks
20+
"alwaysStrict": true, // Ensures that your files are parsed in the ECMAScript strict mode, and emit “use strict” for each source file.
21+
"allowUnreachableCode": false, // pick up dead code paths
22+
"noImplicitAny": true, // In some cases where no type annotations are present, TypeScript will fall back to a type of any for a variable when it cannot infer the type.
23+
"strictNullChecks": true, // When strictNullChecks is true, null and undefined have their own distinct types and you’ll get a type error if you try to use them where a concrete value is expected.
24+
25+
// Linter Checks
26+
"noImplicitReturns": true,
27+
"noUncheckedIndexedAccess": true, // accessing index must always check for undefined
28+
"noUnusedLocals": true, // Report errors on unused local variables.
29+
"noUnusedParameters": true // Report errors on unused parameters in functions
630
},
7-
"include": ["src/**/*"]
31+
"include": ["./src/index.ts"],
32+
"exclude": [
33+
"node_modules/**/*"
34+
]
835
}

0 commit comments

Comments
 (0)