Skip to content

@enum incorrectly handles type declared before value #2719

Closed
@Gerrit0

Description

@Gerrit0

My warnings look slightly different:

[warning] Failed to resolve link to "searchValue" in comment for __type.replaceValue
[warning] Failed to resolve link to "replaceValue" in comment for __type
[warning] Failed to resolve link to "searchValue" in comment for __type

Nowhere in my codebase is anything named searchValue or replaceValue.

Repro is on this branch: https://github.com/electrovir/date-vir/tree/broken-docs. Repro steps are as follows:

  1. npm i in root
  2. cd packages/date-vir && npm run docs

I'm also getting a project warning which I don't understand because I've never gotten it before and I use the same config in all my repos.

[warning] date-vir (Project), defined in ./src/index.ts, does not have any documentation

I've narrowed the issue down to this line: https://github.com/electrovir/date-vir/blob/broken-docs/packages/date-vir/src/timezone/timezones.ts#L10 (notice Timezone is both a type and a const).

When I remove line 10, TypeDoc doesn't error out. It appears that TypeDoc is unable to handle this situation where an object is made to behave like a TypeScript enum.

I haven't found a workaround yet; adding @ignore doesn't work.

Originally posted by @electrovir in #2715 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions