-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtsconfig.json
More file actions
75 lines (70 loc) · 3.31 KB
/
Copy pathtsconfig.json
File metadata and controls
75 lines (70 loc) · 3.31 KB
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
70
71
72
73
74
75
{
// ---------------------------------------------------------------------------
// Root / solution tsconfig.
//
// This file is the SHARED, RUNTIME-NEUTRAL BASE for every package in the
// monorepo and the solution file for the emitting Node packages. Expo and MCP
// are checked by their package-local commands because they use different
// module-resolution and emit contracts.
//
// Design:
// * The root intentionally does NOT extend `expo/tsconfig.base`. The Expo
// base sets `customConditions: ["react-native"]`, which is only valid
// with bundler/node16/nodenext module resolution and therefore conflicts
// with the Node/CommonJS packages (backend, shared-types) that resolve
// with `moduleResolution: "node"`. Leaking it into every package caused
// `TS5098`. Instead, the Expo frontend extends BOTH this base AND
// `expo/tsconfig.base` (array `extends`), so the React-Native
// condition lands only where bundler resolution is in effect.
// * Each package's tsconfig `extends` this file and overrides ONLY what it
// genuinely needs (see per-package comments). The defaults below are the
// "type-check only" baseline (`noEmit: true`); packages that actually
// emit JS (backend, shared-types) deliberately flip
// `noEmit` and pick the module/target their runtime requires.
// ---------------------------------------------------------------------------
"compilerOptions": {
// Language target shared by every package. Backend (Node/Bun) and the
// Expo apps are all comfortable with ES2020.
"target": "ES2020",
"lib": ["ES2020"],
// Default module system for the type-check baseline. Emitting Node packages
// override this with the format their runtime requires (commonjs); Expo
// apps inherit `module: "preserve"` from the Expo base they also extend.
"module": "ES2020",
"moduleResolution": "bundler",
// Correctness / safety defaults applied everywhere.
"strict": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
// NOTE: `isolatedModules` is intentionally NOT set in this shared base.
// The `tsc`-emitting Node packages (backend, shared-types) historically
// compiled without it, and enabling it globally would retroactively enforce
// `export type` on existing re-exports (TS1205). The Expo apps already get
// single-file-transpile safety from Metro's bundler. Keep this an explicit,
// documented absence rather than an accidental on/off divergence.
// Project-reference defaults. `composite` is required for any project that
// is referenced; declaration + maps make cross-package type resolution and
// go-to-definition work without rebuilding sources.
"composite": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
// The root itself never emits — it only orchestrates references and is the
// default for editor/CLI type-checking. Emitting packages override this.
"noEmit": true
},
"references": [
{ "path": "./packages/shared-types" },
{ "path": "./packages/backend" }
],
"exclude": [
"node_modules",
"**/node_modules",
"**/dist",
"**/build",
"**/.expo"
]
}