generated from paranext/paranext-multi-extension-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsconfig.json
69 lines (67 loc) · 3.05 KB
/
tsconfig.json
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
// ts-node needs this to load webpack.config.ts for some reason. Errs otherwise
// https://webpack.js.org/configuration/configuration-languages/#typescript
// Using a separate config file just for webpack.config.ts by using environment variable
// TS_NODE_PROJECT was making tsconfig-paths-webpack-plugin use the other config, not this
// original tsconfig.json, so these path aliases wouldn't work
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
// Platform.Bible requires modules to be CommonJS
// Running webpack.config.ts also requires CommonJS
// https://webpack.js.org/configuration/configuration-languages/#typescript
"module": "CommonJS",
"moduleResolution": "Node",
"resolveJsonModule": true,
"noEmit": true,
"jsx": "react-jsx",
"typeRoots": [
// Include default type declarations
"node_modules/@types",
// Include papi-dts type declarations (for papi.d.ts)
"../paranext-core/lib",
// Include these bundled extensions' type declarations
"./src",
/**
* Add extension repos' `src/types` folders here if you want to use local development type
* declarations. These will override the cached extension type declarations included in
* final entry in this array. Note that running extensions' local development type
* declaration files get copied into the cached extension type declarations while running
* Platform.Bible in development, but adding extension repos' `src/types` folders here means
* the local development type declarations will always be up-to-date instead of only when
* Platform.Bible is running in development.
*
* @example Adding `"../paranext-extension-word-list/src/types",` includes the local version
* of the Word List extension's type declarations. Then, your extension can use types from the
* local build of the Word List extension.
*/
// Include cached extension type declarations in case this extension needs to depend on them
// These are last, so any modules in the above typeRoots take precedence.
"../paranext-core/dev-appdata/cache/extension-types"
],
// Papi exposes decorators for use in classes
"experimentalDecorators": true,
// We want sourcemaps so we can bundle them with webpack
"sourceMap": true,
// We need a baseurl for webpack's tsconfig path aliases plugin
"baseUrl": "./",
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"exclude": ["node_modules"],
"ts-node": {
// This allows us to use path aliases in ts-node
"require": ["tsconfig-paths/register"],
// This allows us to run webpack even if there are type errors in the webpack configs. Optional
"transpileOnly": true
}
}