angulartypescripttypedocangular-package-format

Running Typedoc on Project includes files from node_modules?


I have this project setup with typedoc and the npm script (npm run d) used to work:

"d": "typedoc --out doc --exclude **/*.spec.ts ./projects/fs-is/src/lib"

I upgraded the project to Angular 12 (It uses the Angular Package Format) and now when typedoc is run it includes files from node_modules and fails:

Error: node_modules/@types/eslint/index.d.ts:474:43 - error TS2694: Namespace '"/Users/oleersoy/Github/is/node_modules/@types/estree/index"' has no exported member 'ImportExpression'.

474         ImportExpression?: ((node: ESTree.ImportExpression & NodeParentExtension) => void) | undefined;             ~~~~~~~~~~~~~~~

Any ideas?


Solution

  • From one of the Typedoc Collaborators:

    You see that error because the eslint and estree (parser that eslint relies on) have mismatched versions. I'd recommend making the versions match if possible, or turning on skipLibCheck.

    I ended up adding skipLibCheck to the tsconfig.json compiler options, and that fixed it.

    2023-Jul

    In order to get it to work now (July 2023) I also needed to add typedoc.json .... specifically the "entryPointStrategy": "expand" part ...

    {
      "entryPointStrategy": "expand",
      "out": "docs"
    }