arethetypeswrong / arethetypeswrong/arethetypeswrong.github.io

Report invalid `module` field in `package.json`

Open
#68 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.6k
Forks
65
PR merge metrics
No merged PRs in 30d

Description

Some packages define the top-level `module` field in `package.json`. Although it’s non-standard, bundlers use it. This can lead to differences between usage in the browser and Node.js, but it is not possible to add type definitions for it.

I think it would be useful to report the `module` field if it does not match the `import` condition in the `package.json` `exports` field nor the `main` field.

For example:

- [`monaco-editor`](https://github.com/microsoft/monaco-editor/blob/main/package.json#L34)
- [`vscode-json-languageservice`](https://github.com/microsoft/vscode-json-languageservice/blob/main/package.json#L7)
- [`vscode-uri`](https://github.com/microsoft/vscode-uri/blob/main/package.json#L8)
- [`whatwg-fetch`](https://github.com/JakeChampion/fetch/blob/master/package.json#L6)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how package.json metadata is analyzed, focusing on the module, exports import condition, and main fields described here. Done means packages where module disagrees with those fields are reported, with the listed example packages useful for checking the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.