Skip to content

parameter type emitted as object instead of inline type #745

Closed
@techfg

Description

@techfg

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

In certain scenarios, the type emitted for a function parameter that is a type is emitted as object instead of the inline type.

A few notes:

  1. This is very similar to the issues mentioned in property emits object for its type instead of inlined typed #733 & Unioned type for function param emits object instead of inline type for type that is based on a typedef #720.
  2. None of the issues occur when generating html (typedoc-plugin-markdown is not used)
  3. There are three scenarios outlined in the repro:
    1. type based on typedef - all doesNotWork* functions emit object for the opts param type
    2. explicit type - No issues, everything works as expected
    3. explicit type with @inline tag - all doesNotWork* functions emit object for the opts param type
  4. Adding strict=true to tsconfig.json changes the behavior:
    1. type based on typedef - doesNotWorkDefault and doesNotWork2 emit correctly but doesNotWork1 does not
    2. explicit type - No change, everything still works
    3. explicit type with @inline tag - doesNotWorkDefault and doesNotWork2 emit correctly but doesNotWork1 does not

Repro: https://stackblitz.com/edit/vitejs-vite-cwwnqznq

npm run docs:md && npm run docs:html

image

TypeDoc configuration

    "typedoc": "^0.27.5",
    "typedoc-plugin-markdown": "^4.3.3",
    "typescript": "^5.7.2",

Expected behavior

full type should emit inline in all cases for scenario 1 & 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue raised as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions