-
-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Change imports to use .js
to make them compatible with eslint-plugin-import
(#1667)
#1667
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@DuckThom is attempting to deploy a commit to the next-intl Team on Vercel. A member of the Team first needs to authorize it. |
- Forces VSCode to import files following the "module" rule in tsconfig. For ESM emits .js must always be used in imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for your help here @DuckThom!
.js
to make them compatible with eslint-plugin-import
(#1667)
@DuckThom Just tried this in your reproduction: 👏👏👏 |
@amannn Following our conversation on X, these are the changes that I've made that appear to be fixing the imports when the
import/named
ESLint rule is used.As mentioned before, I also took the liberty of adding the ESLint rule
'import/extensions': 'error'
to ensure the right extensions are used in the import/export statements. For context, when compiling to ESM modules, TS copies over the import/export statements as-is, so during development, runtime compatible file extensions must be used.For local testing I ran a build and then manually copied over the
dist
folder intonode_modules/next-intl
in my other project.