Solvedtypedoc typedoc.js Stops Working after Writing Configuration in tsconfig.js is Supported.

I recently started to use typedoc for my new project. But when trying to config the tool via typedoc.js, I can't find good example of how this file should be defined. After some research in the source code, PRs and Issues. It looks like the typedoc.js doesn't support simple exported json object well (It won't understand most of the options listed in the, though an exported function in the file will receive the tool instance. However, in the tsconfig.json, I can define all exposed config options in a typedocOptions property. It looks like the tsconfig.json can be used to replace typedoc.js, if calling the tool instance in an exported function is not that much important to most users.

21 Answers

✔️Accepted Answer

@Laroosta I didn't read @ZheyangSong issue in the detail but you can add your json in a typedocOptions key of your tsconfig.json

In my case

  "compilerOptions": {
  "typedocOptions": {
    "mode": "modules",
    "out": "docs",
    "exclude": "test",
    "theme": "default",
    "ignoreCompilerErrors": true,
    "excludePrivate": true,
    "excludeNotExported": true,
    "target": "ES5",
    "moduleResolution": "node",
    "preserveConstEnums": true,
    "stripInternal": true,
    "suppressExcessPropertyErrors": true,
    "suppressImplicitAnyIndexErrors": true,
    "module": "commonjs"

Your command become

typedoc index.ts

I'm not a big fan of it as tsconfig is used by a lot of third party libraries for their config and often not very well documented... But it works for me.

Other Answers:

I'm in favor of fixing typedoc.json support and dropping typedoc.js support. If people need dynamic control of typedoc, they can require the application directly.

Related Issues:

typedoc typedoc.js Stops Working after Writing Configuration in tsconfig.js is Supported.
@Laroosta I didn't read @ZheyangSong issue in the detail but you can add your json in a typedocOptio...
typedoc Support for ignoreCompilerErrors
I cannot make my mono repo (with ./apps and ./libs) work with multiple tsconfig.json I will be stuck...
typedoc Generating class diagrams
I just wanted to update this thread Both the typedoc-plantuml and typedoc-plantuml-extended packages...
storybook Webpack 4 support?
I'm getting the below error when running Storybook with a project using Webpack 4; This is preventin...
electron vue this.$store.dispatch('someAsyncTask'), action not run
Same here and I've wasted just 2h debugging this crap until I realized the issue is in fact in elect...
react styleguidist Support for the experimental syntax 'dynamicImport' isn't currently enabled
For what it's worth Current behavior To reproduce Demo is not based on template but I guess this doe...
121 how to change the state of parent component from child Component if parent state is maintained using useStateHook
Hi! There's no difference in this scenario between function and class components In both cases you w...
storybook babelHelpers is not defined using Rollup [Solved]
@alejandronanez you can remove external-helpers from your .babelrc file and enable it back only on y...
zeal Content rendering error in MDN (HTML, JS, CSS) docsets
I find it can fix temporary by remove the CSS.docset\Contents\Resources\Documents\developer.mozilla....
storybook Storybook doesn't work with the newest version 10.0.1 of PostCSS Autoprefixer plugin
I also get the same issue as @matamatanot (also with tailwind 2.0.2) I might have missed something f...
storybook Storybook build fails in Node 13 (cannot find module @babel/compat-data/corejs3-shipped-proposals)
Removing node_modules and yarn.lock and using node 13.13 has been helped for me. ...
storybook Storybook 5.0.0 emotion-themeing and React loader bug
Worked for us to add @storybook/theming as an explicit dependency Describe the bug When starting up ...
storybook [Angular] How to render a component that has <ng-content> in the template
That couldn't be the solution Why I should write the HTML manually again? It already in the componen...
storybook build-storybook doesn't respect tsconfig.json baseUrl config (Module not found: Error: Can't resolve 'components')
@jwm0 your solution worked for me Here's my main.js for reference: Bug or support request summary I'...
storybook TypeError: Cannot read property 'createSnapshot' of undefined
@shilman @jimmyandrade @ckwong90 For this issue in particular When I start storybook I got TypeError...
storybook Doc code preview "No display name"
What happens if you use {Story()} instead of <Story />? Describe the bug The Doc code preview does n...
storybook Feature: custom proxy settings
@ndelangen just when I saw your message I was able to find a solution to my problem using the awesom...
storybook TS1086: An accessor cannot be declared in an ambient context
Try skipLibCheck: true inside tsconfig.json eg Hope it will help you !! Describe the bug Upgraded to...
storybook Webpack Building Constantly
Having the same issue after upgrading to 6.2.1 Changing my main.js file to only load stories from th...
storybook Cant add aliases in storybook config
I think the problem may be trailing slashes Try using ~ and ../src/ exactly It seems to work for me ...
storybook TypeError: Cannot read property 'module' of undefined
Logging the three variables in the line (baseConfig env config) => { shows that the latter two are u...
storybook Error: Invariant failed: You should not use <Link> outside a <Router>
This is not an issue with storybook the error comes from react-router as is evidenced by the screens...
storybook Async/Await
I'm using a vanilla setup of StoryBook with no tweaks to babel ...
storybook Storysource is giving me linting errors
I ran into this same Import in body of module; reorder to top import/first error in SB 5.0.x ...
storybook Storybook is not able to resolve path with Next js absolute import
Its because thats not an absolute import from root your path is using an alias Describe the bug Stor...
compodoc [BUG] Angular 9.0.5 compodoc not considering module and its component
After switching from -p to -p tsconfig.json it worked We have both files ...
storybook [webpack5] DefinePlugin cannot read property 'get' of undefined
If someone is still looking around for a solution Describe the bug I cannot build storybook using we...
storybook Uncaught Error: Target container is not a DOM element.
If there is someone who hasn't fix the problem jet check the order of your tag elements in html ...
L5 Swagger oauth2 + passport = Bearer <token>
Sharing my solution in case it might help This is I how made it to work with Passport using password...
storybook Story source code shows "MDXCreateElement" instead of actual source code
It seems to only occur when using an intermediate variable (including the template/bind pattern): ☝️...
37 Old documentations (3.8)
for other who try to get v3 documentation running locally instruction are: note should be start not ...
storybook CSS modules
For webpack 2 I'm using this in .storybook/webpack.config.js and it's working fine: ...
storybook Error: exports is not defined
I'm getting this error without using TypeScript just vanilla JS I'm trying to use storybook for the ...
storybook [question] How to order top-level sections?
In the same boat as everyone else just sharing because it was such a headache. We've just upgraded t...
storybook Knobs not working with v5.2.0-beta.30
I am pretty sure it was caused by the wrong import: instead of Describe the bug When enabling the Kn...
mkdocs material Error: Unrecognised theme 'material'
SOLVED! @JerryC8080 thank you so much for your help I had at some point installed mkdocs via Homebre...
storybook [Bug] "Invalid hook call" error after upgrading to Storybook 6
It's caused by multiple versions of React being loaded - @storybook/ui most likely contains its own ...
storybook Sorting stories
For reference here's the recommended setup for v5.2 onwards: This will sort your story kinds (files)...
storybook "Singleton client API not yet initialized"
The solution for vite builder — force dedupe (see
storybook Can't get props for addon-info when using decorator (higher order component) on my component
Here is a workaround I used in my project And now my story will look like Hello I wanted to use addo...
storybook Getting 404 Registry returned when trying to run `npm install`
Yea I was using sinopia Doing a npm set registry solved the problem. ...
storybook Decorator Children Displayed In Story Source
Place withInfo decorator before other decorator works for me. Describe the bug If a decorator itself...
storybook A working example with PostCSS for Storybook v5
Ok for those playing along at home this works perfectly. Is your feature request related to a proble...
BookStack Permission denied ".../storage/logs/laravel.log could not be opened"
chmod -R 777 storage worked for me Project Maintainer Edit - For Laravel Developers Gaining an under...
storybook Cannot assign to read only property 'exports' of object '#<Object>'
For anyone stumbling across this I faced the same problem after importing a NPM package to a Vue com...
27 API - Document When a Plugin Should Call `doResolve()`
Hi all -- I'm someone who has also been spelunking through a lot of Webpack's code Specifically Webp...
docz v1.0.0-rc.* Compiled with errors: Module parse failed: Unexpected token
Also instead of installing webpack@4.28.2 you can specify it in resolutions in package.json ...
storybook babel-loader devDependency causes error in Create-React-App
Hello @ajrussellaudio thanks for your work Unfortunately Describe the bug Installing Storybook in a ...
electron vue Milestone Minimize, Project Update
🎉 It's Here! 🎉 Milestone Minimize is officially in the master branch of this repo and can be used ...
docz Uncaught TypeError: Cannot read property 'close' of undefined
I've noticed that the problem appears when using docz with react-scripts and the reason is a differe...