-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtsconfig.json
More file actions
86 lines (68 loc) · 3.4 KB
/
tsconfig.json
File metadata and controls
86 lines (68 loc) · 3.4 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
76
77
78
79
80
81
82
83
84
85
86
{
"compilerOptions": {
////////////////////////////////////////////////////////////////////////////
// Language & Target Environment ///////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Target modern JavaScript without transpilation
// ESNEXT = latest JS features supported by TypeScript
// No transpilation occurs — we only emit .d.ts files
"target": "ESNEXT",
// Runtime environment libraries for type checking
// ESNext: Modern JavaScript features (Promise, Map, Set, etc.)
// DOM: Browser APIs (document, window, HTMLElement, etc.)
// DOM.Iterable: Iteration support for DOM collections
"lib": ["ESNext", "DOM", "DOM.Iterable"],
////////////////////////////////////////////////////////////////////////////
// Module System (No Bundler) //////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Use native ES modules (import/export) without transformation
// "NodeNext" = preserve modern import/export syntax as-is
// Supports both CJS and ESM with proper package.json "type" detection
"module": "NodeNext",
// Module resolution strategy for Node.js-style ESM
// "NodeNext" = supports package.json "exports", .js extensions required
// Aligns with Node.js native ESM behavior
"moduleResolution": "NodeNext",
"verbatimModuleSyntax": true,
////////////////////////////////////////////////////////////////////////////
// JSDoc Type Checking /////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Enable JavaScript files in the compilation
// Required for JSDoc type checking to work
"allowJs": true,
// Actually type-check JavaScript files using JSDoc annotations
// Without this, JSDoc comments are ignored!
"checkJs": true,
// Generate TypeScript declaration files (.d.ts) from JSDoc
// Enables IDE autocomplete and type hints for consumers
"declaration": true,
// Only emit .d.ts files, never transpile .js
// This ensures zero JavaScript transformation
"emitDeclarationOnly": true,
// Output directory for generated .d.ts declaration files
"outDir": "./types",
////////////////////////////////////////////////////////////////////////////
// Type Checking Rigor ////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Skip type checking of .d.ts files in node_modules
// Improves performance without sacrificing our code's type safety
"skipLibCheck": true,
// Enforce consistent file name casing across imports
// Prevents cross-platform issues (macOS case-insensitive vs Linux)
"forceConsistentCasingInFileNames": true
},
////////////////////////////////////////////////////////////////////////////
// File Selection //////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Type check all JavaScript source files
"include": [
"*.js"
],
// Exclude from type checking:
// - server.js: Node.js server with different environment
// - eslint.config.js: ESLint config with untyped dependencies
"exclude": [
"server.js",
"eslint.config.js",
]
}