Skip to content

fix(api-client): add explicit extensions to relative imports#6609

Open
creeperkatze wants to merge 4 commits into
modrinth:mainfrom
creeperkatze:fix-api-client-dts-extensions
Open

fix(api-client): add explicit extensions to relative imports#6609
creeperkatze wants to merge 4 commits into
modrinth:mainfrom
creeperkatze:fix-api-client-dts-extensions

Conversation

@creeperkatze

Copy link
Copy Markdown
Contributor

The packages .d.ts files re-export each other via extensionless relative specifiers. That works under moduleResolution: bundler, but fails under Node's strict ESM resolution (nodenext), making namespaces like Labrinth unresolvable for plain Node.js consumers.

This PR adds explicit .js extensions to all relative imports, which works for both modes.

@modrinth-bot

Copy link
Copy Markdown
Member

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

@Prospector

Copy link
Copy Markdown
Member

ideally this should be enforced by the linter, i imagine it's not currently right?

@creeperkatze

Copy link
Copy Markdown
Contributor Author

ideally this should be enforced by the linter, i imagine it's not currently right?

I added a linting rule, though this plugin was required: https://www.npmjs.com/package/eslint-plugin-n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants