Function
normalizeCompilerOptions
(raw: ts.CompilerOptions | undefined)
Source from the content-addressed store, hash-verified
| 22 | // TS 6.0 rejects raw JSON compiler options (e.g. `target: "ESNext"`) in createProgram. |
| 23 | // They must be normalized to numeric enum values via TypeScript's own parser API first. |
| 24 | const normalizeCompilerOptions = (raw: ts.CompilerOptions | undefined): ts.CompilerOptions => { |
| 25 | if (!raw) return {} |
| 26 | const { options } = ts.convertCompilerOptionsFromJson(raw, process.cwd()) |
| 27 | return options |
| 28 | } |
| 29 | |
| 30 | const createTsProject = (options: Partial<TsProjectOptions>) => |
| 31 | new TsProject({ |
Tested by
no test coverage detected