Skip to content

Commit

Permalink
Use standard TypeScript configuration (#27)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gudahtt authored Jul 13, 2021
1 parent 2148e0a commit af369d9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}

0 comments on commit af369d9

Please sign in to comment.