Use a consistent style for named vs. default exports
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
My proposal:
- No exported "namespace objects" (#6335) -- modules should export either classes or functions, with an occasional exception as needed for stubbing.
- If a module exports one thing, use a default export
- If a module exports multiple things, use named exports only
Whatever we decide, it should be backed up by lint rules.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named in the issue. First clarify the export convention, including the namespace-object exception, then identify the project's lint configuration; done means the decision is documented in enforceable lint rules across the relevant modules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100