Skip to content

TypeScript config no longer validates after upgrading to typedoc 0.28.0 #2901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kaiyoma opened this issue Mar 17, 2025 · 4 comments
Closed
Labels
no bug This is expected behavior
Milestone

Comments

@kaiyoma
Copy link

kaiyoma commented Mar 17, 2025

Search terms

TypeScript

Expected Behavior

Config should continue to validate.

Actual Behavior

typedoc.config.js:4:7 - error TS2322: Type '{ classPropertiesFormat: "table"; entryFileName: string; entryPoints: string[]; entryPointStrategy: "packages"; enumMembersFormat: "table"; hideBreadcrumbs: true; hidePageHeader: true; ignoredHighlightLanguages: string[]; ... 10 more ...; useHTMLEncodedBrackets: true; }' is not assignable to type 'TypeDocOptions & PluginOptions'.
  Type '{ classPropertiesFormat: "table"; entryFileName: string; entryPoints: string[]; entryPointStrategy: "packages"; enumMembersFormat: "table"; hideBreadcrumbs: true; hidePageHeader: true; ignoredHighlightLanguages: string[]; ... 10 more ...; useHTMLEncodedBrackets: true; }' is missing the following properties from type 'TypeDocOptions': options, tsconfig, compilerOptions, lang, and 97 more.

4 const config = {
        ~~~~~~


Found 1 error in typedoc.config.js:4

Steps to reproduce the bug

Write a config and validate it against TypeDocOptions.

Environment

  • Typedoc version: 0.28.0
  • TypeScript version: 5.8.2
  • Node.js version: 22.14.0
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 17, 2025

It sounds like you have declared the type to be TypeDocOptions, where you want Partial<TypeDocOptions>, this is a mistake in your config file, not a problem with typedoc.

@Gerrit0 Gerrit0 added the no bug This is expected behavior label Mar 17, 2025
@kaiyoma
Copy link
Author

kaiyoma commented Mar 17, 2025

Did this behavior change? This wasn't the case in the previous version. Shouldn't TypeDocOptions already be declaring all properties as optional? That seems more user-friendly than forcing everyone to add Partial to their configs.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 17, 2025

This behavior has not changed. I suspect your PluginOptions interface might have resolved to any before, resulting in the entire type being any.

As for everything being optional, it looks like that's doable, most places in TypeDoc's source already wrap it in Partial, PR welcome

@Gerrit0 Gerrit0 added this to the v0.28.1 milestone Mar 18, 2025
@kaiyoma
Copy link
Author

kaiyoma commented Mar 18, 2025

Thanks for the fix. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no bug This is expected behavior
Projects
None yet
Development

No branches or pull requests

2 participants