Skip to content

Object-level comments not rendered when referenced as properties #2999

@ritz078

Description

@ritz078

TypeDoc fails to render TSDoc comments for local objects that are referenced as properties within exported objects.

/**
 * A test object with property a.
 */
const LocalObject = { 
  /**
   * A numeric value representing the first property.
   * @defaultValue 1
   */
  a: 1 
}

export const Options = { LocalObject } // LocalObject's documentation is lost

Search terms

property object, object, documentation lost

Expected Behavior

LocalObject should appear as a documented export with its TSDoc comment visible. The string A test object with property a. should be present in documentation.

Actual Behavior

LocalObject only appears as an undocumented nested property within Options. The documentation for properties of LocalObject is correctly present.

Steps to reproduce the bug

The above code should cause the issue. TypeDoc configuration

{
  "$schema": "https://typedoc.org/schema.json",
  "entryPoints": ["src/index.ts"],
  "out": "docs-typedoc",
  "excludePrivate": true,
  "excludeProtected": true,
  "excludeExternals": true,
  "theme": "default",
  "name": "API Extractor Example - TypeDoc",
  "includeVersion": true,
  "categorizeByGroup": true,
  "categoryOrder": ["Classes", "Interfaces", "Functions", "Types", "*"],
  "defaultCategory": "Other",
  "includeHierarchySummary": false,
  "disableSources": true,
  "customCss": "./custom-typedoc.css",
  "excludeInternal": true,
}

Environment

  • Typedoc version: 0.28.10
  • TypeScript version: 5.9.2
  • Node.js version: 22.11.0
  • OS: MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions