generated from ProverCoderAI/effect-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.json
More file actions
97 lines (86 loc) · 6.71 KB
/
tsconfig.json
File metadata and controls
97 lines (86 loc) · 6.71 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
87
88
89
90
91
92
93
94
95
96
97
{
// CHANGE: Complete rewrite of TypeScript configuration for maximum type safety and Effect compatibility
// WHY: Remove redundancy (strict flag includes many explicit options), add missing strict checks,
// modernize module system for Effect (NodeNext vs CommonJS), enable full verification
// QUOTE(ТЗ): "Давать проверяемые решения через формализацию и строгую типизацию в функциональной парадигме"
// REF: REQ-TS-MAX-VERIFICATION
// SOURCE: TypeScript 5.x documentation - Compiler Options Reference
// https://www.typescriptlang.org/tsconfig
// RATIONALE: strict:true already includes noImplicitAny, strictNullChecks, strictFunctionTypes,
// strictBindCallApply, strictPropertyInitialization, noImplicitThis, alwaysStrict,
// useUnknownInCatchVariables - explicit duplication removed for clarity
"compilerOptions": {
// ═══════════════════════════════════════════════════════════════════════════
// STRICTNESS CORE (single flag enables 8 checks)
// ═══════════════════════════════════════════════════════════════════════════
"strict": true,
"alwaysStrict": true,
// Automatically enables:
// - noImplicitAny: reject implicit any types
// - strictNullChecks: null/undefined not assignable to other types
// - strictFunctionTypes: contravariant function parameter checking
// - strictBindCallApply: strict checking of bind/call/apply
// - strictPropertyInitialization: class properties must be initialized
// - noImplicitThis: this must have explicit type
// - alwaysStrict: emit "use strict" in JS output
// - useUnknownInCatchVariables: catch clause variables are unknown not any
// ═══════════════════════════════════════════════════════════════════════════
// ADDITIONAL STRICT CHECKS (not included in strict)
// ═══════════════════════════════════════════════════════════════════════════
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"exactOptionalPropertyTypes": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
// CHANGE: Add verbatimModuleSyntax for explicit import control
// WHY: Require explicit type keyword for type-only imports, better bundler compatibility
"verbatimModuleSyntax": true,
// ═══════════════════════════════════════════════════════════════════════════
// MODULE SYSTEM (modernized for Effect and ESM)
// ═══════════════════════════════════════════════════════════════════════════
// CHANGE: Switch from CommonJS to NodeNext
// WHY: Effect library designed for modern ESM, NodeNext provides best compatibility
// with both ESM and CJS, enables package.json "exports" field support
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": ["ES2022"],
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
// CHANGE: Keep isolatedModules for esbuild/swc compatibility
// WHY: Each file must be compilable independently, critical for fast build tools
"isolatedModules": true,
// ═══════════════════════════════════════════════════════════════════════════
// TYPE CHECKING CONTROL
// ═══════════════════════════════════════════════════════════════════════════
// CHANGE: Set skipLibCheck to false for maximum verification
// WHY: Full type checking of declaration files ensures library type correctness
// TRADEOFF: Increases compilation time 2-3x, but ensures complete type safety
// NOTE: For development speed, can temporarily set to true, but CI must use false
"skipLibCheck": false,
"forceConsistentCasingInFileNames": true,
// ═══════════════════════════════════════════════════════════════════════════
// OUTPUT CONFIGURATION
// ═══════════════════════════════════════════════════════════════════════════
// NOTE: Moved emission-related options to project configs (tsconfig.src.json, tsconfig.test.json)
// WHY: Root (solution) tsconfig must not define outDir/tsBuildInfoFile to avoid TS6377 collisions
// ═══════════════════════════════════════════════════════════════════════════
// PATH RESOLUTION
// ═══════════════════════════════════════════════════════════════════════════
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
// ═══════════════════════════════════════════════════════════════════════════
// PROJECT STRUCTURE
// ═══════════════════════════════════════════════════════════════════════════
"include": ["src/**/*", "test/**/*"],
"exclude": ["node_modules", "dist"]
}