From af369d904c0cca07904fc8d46afcd140cf289492 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 13 Jul 2021 14:23:47 -0230 Subject: [PATCH] Use standard TypeScript configuration (#27) The TypeScript configuration has been updated to use the same settings we use in the MetaMask module template. The changes are: * Enable inline source maps. * Target ES2017 rather than ES5. * Allow the use of ES2020 syntax/APIs and DOM APIs in the TypeScript source. * Explicitly declare the root directory, to prevent it from changing accidentally. * Remove unnecessary type roots and excludes (both included the non- existent `types` directory, and were set to default aside from that). * Enable `esModuleInterop` for better CommonJS compatibility. --- tsconfig.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index f0b7025..044412b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,16 @@ { "compilerOptions": { - "moduleResolution": "Node", "declaration": true, + "esModuleInterop": true, + "inlineSources": true, + "lib": ["DOM", "ES2020"], "module": "CommonJS", + "moduleResolution": "Node", + "outDir": "dist", + "rootDir": "src", "sourceMap": true, "strict": true, - "target": "es5", - "typeRoots": ["./types", "./node_modules/@types"], - "outDir": "dist" + "target": "ES2017" }, - "include": ["src/**/*.ts"], - "exclude": ["node_modules", "types"] + "include": ["src/**/*.ts"] }