-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.json
More file actions
47 lines (47 loc) · 2.42 KB
/
tsconfig.json
File metadata and controls
47 lines (47 loc) · 2.42 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
// TypeScript configuration for this Office Scripts project and its tests.
//
// - We set "strictNullChecks" to false because Office Scripts APIs return 'undefined' in many cases
// where TypeScript would expect 'null', and enabling strict null checks would cause excessive
// type errors or force verbose code without practical benefit in this context.
//
// - "mocks" and "wrappers" directories are included for testability and local development:
// * "mocks" provides stand-ins for Office Scripts APIs, enabling unit testing outside Excel online.
// * "wrappers" adapt Office Scripts APIs to be more test-friendly and to allow dependency injection.
//
// - All strict type checks except strictNullChecks are enabled for code quality.
// - Side comments explain individual settings inline.
// - This config includes all code folders for full IntelliSense in VS Code. For a production-only build, use a separate config if needed.
//
// - "typeRoots" specifies directories where TypeScript should look for type definition files (*.d.ts).
// * "./types" is included to provide Office Scripts and custom global type definitions for this project.
// * "./node_modules/@types" is included for compatibility with community and built-in type packages (e.g., for Node.js or testing frameworks).
// * Only .d.ts files in these folders will be included for global types, so make sure all necessary type definitions are placed accordingly.
//
{
"compilerOptions": {
"emitDeclarationOnly": true, // Only output .d.ts files, not .js
"declaration": true, // Generate type declaration files
"outDir": "dist", // Output directory for build artifacts
"rootDir": ".", // Project root as rootDir to capture all code
"module": "commonjs", // Module system for output
"target": "es2019", // Set JS target (irrelevant here, but required)
"strict": true, // Enable all strict type-checking options
"strictNullChecks": false, // Disable strict null/undefined checks (see note above)
"esModuleInterop": true, // Enable compatibility for ES modules/CommonJS imports
"typeRoots": [
"./types", // Look for custom and Office Scripts type definitions here
"./node_modules/@types" // Standard location for community-provided type definitions
]
},
"include": [
"src/**/*",
"test/**/*",
"mocks/**/*",
"wrappers/**/*",
"types/**/*.d.ts"
],
"exclude": [
"dist",
"node_modules"
]
}