Skip to content
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: use .js and index.js in imports #974

Merged
merged 2 commits into from Feb 8, 2022
Merged

fix: use .js and index.js in imports #974

merged 2 commits into from Feb 8, 2022

Conversation

ehmicky
Copy link
Contributor

@ehmicky ehmicky commented Jan 28, 2022

Part of #749

Pure ES modules require file extensions to be specified in file imports. In TypeScript, this is done by using .js, i.e. the path to the transpiled file, not to the source file (.ts) (which might not seem intuitive).

Also, pure ES modules require index.js imports to be explicit.

This PR changes import file paths to match this.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code
    🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re
    fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

@ehmicky ehmicky added the type: chore work needed to keep the product and development running smoothly label Jan 28, 2022
@github-actions github-actions bot added the type: bug code to address defects in shipped code label Jan 28, 2022
.eslintrc.js Outdated
@@ -2,11 +2,18 @@ const { overrides } = require('@netlify/eslint-config-node')

module.exports = {
extends: '@netlify/eslint-config-node',
rules: {
'import/extensions': ['error', 'ignorePackages'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some new ESLint rules are needed with the new import patterns.

@ehmicky ehmicky removed the type: bug code to address defects in shipped code label Jan 28, 2022
@ehmicky ehmicky mentioned this pull request Jan 28, 2022
erezrokah
erezrokah previously approved these changes Feb 8, 2022
erezrokah
erezrokah previously approved these changes Feb 8, 2022
@kodiakhq kodiakhq bot removed the automerge label Feb 8, 2022
@kodiakhq
Copy link
Contributor

kodiakhq bot commented Feb 8, 2022

This PR currently has a merge conflict. Please resolve this and then re-add the automerge label.

@kodiakhq kodiakhq bot merged commit 96e9a95 into main Feb 8, 2022
@kodiakhq kodiakhq bot deleted the chore/full-paths branch February 8, 2022 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants