Skip to content

Conversation

@EzraBrooks
Copy link
Contributor

Fixes another one of the issues reported by "Are The Types Wrong?":

Before:

Screenshot 2025-11-19 at 1 27 37 PM

After:
Screenshot 2025-11-19 at 1 27 17 PM

@EzraBrooks
Copy link
Contributor Author

The closer I look at this, the more I don't understand what the tool is upset about, frankly. I don't know that we should merge this just to satisfy the tool if the tool is potentially wrong.

@EzraBrooks EzraBrooks marked this pull request as draft November 19, 2025 20:35
@EzraBrooks
Copy link
Contributor Author

ok I figured it out. index.d.ts was not aligned with the structure of index.js and there was no corresponding .mts file that aligned with the structure of index.mjs.

Fixed and now we're all green:
image

@EzraBrooks EzraBrooks marked this pull request as ready for review November 19, 2025 21:01
"description": "EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface.",
"exports": {
".": {
"types": "./index.d.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this allows TypeScript to resolve the types file automagically based on extension substitution from the chosen entrypoint, apparently.

@EzraBrooks
Copy link
Contributor Author

as it turns out, the issues reported by this tool actually have nothing to do with #277, lol.

@lpinca
Copy link
Member

lpinca commented Nov 19, 2025

Does this work with old versions of TypeScript?

@EzraBrooks
Copy link
Contributor Author

Looks like support for .d.mts was added in TypeScript 4.7 in May 2022

@lpinca lpinca merged commit b64d6b7 into primus:master Nov 19, 2025
5 of 6 checks passed
@lpinca
Copy link
Member

lpinca commented Nov 19, 2025

Thank you.

@cyfung1031
Copy link

Thank you.

Good to see that this repo is still being maintained by someone.
(The previous commit was 2 years ago)

@TiMESPLiNTER
Copy link

TiMESPLiNTER commented Jan 16, 2026

Any chance we can get a release including this merged fix @lpinca ?

Without I'm currently forced to either install it from master branch or

import type {EventEmitter as EventEmitter} from "eventemitter3";

@lpinca lpinca mentioned this pull request Jan 19, 2026
lpinca added a commit that referenced this pull request Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants