DefinitelyTyped / DefinitelyTyped/DefinitelyTyped

[dtslint] npm-naming NeedsExportEquals rule erroneously fails

Open
#62,444 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
51.4k
Forks
30.4k
Avg merge
3d 21h
Merged PRs (30d)
108

Description

Discord Thread

Creating this matching issue to capture this on GitHub.

When creating a type definition for a package which has no export = syntax in its dist, and running npm run test packageName, I'm getting:

Instead of `export =`-ing a namespace, use the body of the namespace as the module body  export-just-namespace

As can be verified in the dist, the package is using the following syntax in its dist for CJS / ESM:

CJS:

exports.parse = parse$3;
exports.build = build;

ESM:

export { parse$3 as parse, build };

See the PR and package dist for reference.

Contributor guide

No contributing guide indexed for this repository

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

Start with the dtslint npm-naming NeedsExportEquals rule and reproduce the failure using npm run test packageName. Compare the rule's result with the package dist syntax linked in the issue; done when a package without export = passes without the export-just-namespace failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.