Commit 75ac3f6
authored
When `output.docs` is enabled, orval boots TypeDoc with the generated `.ts` files as entry
points. TypeDoc, however, still auto-discovers the consumer's tsconfig and builds a single
`ts.Program` from it — which means it runs full TypeScript diagnostics over the whole consumer
project, not just the files orval emitted.
The two observable consequences on master:
1. Diagnostics from files orval has nothing to do with (e.g. an unused `React` default import
in a demo `App.tsx` under the React 17+ JSX transform) leak into orval's stdout — the
symptom originally reported in #3338.
2. Because `app.convert()` returns `undefined` whenever those diagnostics exist, the catch
path logs "TypeDoc not initialized" and the docs are silently dropped. The `docs` option
has effectively been broken for any project with a single unrelated TS error.
Type-checking the consumer's project is not orval's responsibility — that lives in the
consumer's own build. Pass `skipErrorChecking: true` to the TypeDoc bootstrap so docs
generation only depends on the entry points orval actually produced. The option is placed
before `...config`, so users who explicitly want strict checking can re-enable it via
`docs: { skipErrorChecking: false }`.
After the fix, `samples/react-app` generates the previously-silently-dropped docs and emits
no unrelated diagnostics.
1 parent aca8a07 commit 75ac3f6
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
466 | 472 | | |
467 | 473 | | |
468 | 474 | | |
| |||
0 commit comments