Skip to content

Commit 22fdb77

Browse files
committed
Allow elluding imports if not necessary
1 parent 61ce78e commit 22fdb77

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

tsconfig.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
/* Modules */
1212
"rootDirs": [
13-
/* Specify the root folder within your source files. */ "src",
13+
/* Specify the root folder within your source files. */
14+
"src",
1415
"tests"
1516
],
1617

@@ -22,7 +23,7 @@
2223
"DOM.AsyncIterable",
2324
"ESNext",
2425
"WebWorker.ImportScripts",
25-
// Additional libs
26+
// Additional libs that should be supported by latest browsers separate from ESNext
2627
"ESNext.Array",
2728
"ESNext.AsyncIterable",
2829
"ESNext.Symbol",
@@ -33,14 +34,15 @@
3334
"baseUrl": ".",
3435
"paths": {
3536
"@App/*": ["src/*"],
36-
"@Mapping/*": ["src/mappings/*"]
37+
"@Mapping/*": ["src/lang/mappings/*"]
3738
},
3839

3940
// import json directly into output
40-
"resolveJsonModule": true /* Enable importing .json files. */,
41+
"resolveJsonModule": true,
4142

42-
// we are bundling the project
43+
// we are bundling the project js into single file for optimized loading
4344
"moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
45+
// we use esbuild so disable duplicate JS output
4446
"noEmit": true /* Disable emitting files from a compilation. */,
4547

4648
// strictness
@@ -49,7 +51,7 @@
4951

5052
/* Interop Constraints */
5153
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
52-
//"verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
54+
"verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
5355
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
5456
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
5557

@@ -62,11 +64,15 @@
6264
"noImplicitThis": true /* Enable error reporting when 'this' is given the type 'any'. */,
6365
"useUnknownInCatchVariables": true /* Default catch clause variables as 'unknown' instead of 'any'. */,
6466
"alwaysStrict": true /* Ensure 'use strict' is always emitted. */,
67+
68+
// allow unused vars for this project, because its more prototyping
6569
//"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
6670
//"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
6771
"exactOptionalPropertyTypes": true /* Interpret optional property types as written, rather than adding 'undefined'. */,
6872
"noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
6973
"noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
74+
75+
// this would require index checks for many well-known properties like os.ENV - here it feels too strict than to allow runtime errors
7076
//"noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
7177
"noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */,
7278
"noPropertyAccessFromIndexSignature": true /* Enforces using indexed accessors for keys declared using an indexed type. */,

0 commit comments

Comments
 (0)