diff --git a/packages/knip/src/plugins/typedoc/index.ts b/packages/knip/src/plugins/typedoc/index.ts index 552bd186..6a2b2f8b 100644 --- a/packages/knip/src/plugins/typedoc/index.ts +++ b/packages/knip/src/plugins/typedoc/index.ts @@ -24,8 +24,14 @@ const config = [ ]; const resolveConfig: ResolveConfig = config => { - config = 'typedocOptions' in config ? config.typedocOptions : config; // exception for `tsconfig.json` - return (config?.plugin ?? []).map(toDeferResolve); + const cfg = 'typedocOptions' in config ? config.typedocOptions : config; // exception for `tsconfig.json` + const plugins = cfg?.plugin ?? []; + const themes = cfg?.theme ?? []; + return [...plugins, ...themes].map(toDeferResolve); +}; + +const args = { + resolve: ['plugin', 'theme'], }; export default { @@ -35,4 +41,5 @@ export default { packageJsonPath, config, resolveConfig, + args, } satisfies Plugin; diff --git a/packages/knip/src/plugins/typedoc/types.ts b/packages/knip/src/plugins/typedoc/types.ts index 3f867278..94d0311b 100644 --- a/packages/knip/src/plugins/typedoc/types.ts +++ b/packages/knip/src/plugins/typedoc/types.ts @@ -1,3 +1,4 @@ export type TypeDocConfig = { plugin?: string[]; + theme?: string[]; };