Skip to content

Missing support for namespaces in JSDoc types #3842

@remcohaszing

Description

@remcohaszing

Steps to reproduce

Example code taken from CHANGES.md:

/** @typedef {1} NS.T */

Practical example: simplematter

Behavior with typescript@6.0

Nested typedef names are supported and translate to a type-only namespace.

Behavior with tsgo

This is explicitly no longer supported.

I like type-only namespaces. I also like being able to use them in JSDoc. It appears to be a deliberate choice to no longer support that, so I wanted to provide some feedback that some people actually like this feature.

The proposed substitute is to translate it to a .d.ts file. This is not a substitute however.

  • This means the types and implementation can no longer live in the same file.
  • This conflicts with the use of "rootDir" and "outDir", because declaration files are not compiled.
  • This conflicts with tsc --init, which now emits skipLibCheck: true by default. This means declaration files are not type checked.

So really, there’s no substitute for this syntax.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions