microsoft / microsoft/TypeScript

[BUG] Docs say es6 modules can't export class objects, but that's not true.

Open
#13,627 12 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Docs Help Wanted
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

The docs say that

/*~ Note that ES6 modules cannot directly export class objects.

but modules can export classes, as in

export default
class Foo { /*...*/ }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked declaration-files/templates/module-class-d-ts.html documentation page and review the note stating that ES6 modules cannot directly export class objects. Update the inaccurate wording to account for the shown default-exported class example, then verify the rendered documentation and example remain correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.