mapbox / mapbox/mapbox-gl-js

Use a consistent style for named vs. default exports

Open
#6,336 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactoring :building_construction:
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.