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

Add ESLint rule to ensure .ts extensions on imports #4409

Merged

Conversation

Johennes
Copy link
Contributor

@Johennes Johennes commented Sep 17, 2024

When importing without an extension

import { MemoryCryptoStore } from "./crypto/store/memory-crypto-store";

this rule throws an error

/Users/jm/Code/matrix-js-sdk/src/matrix.ts
  19:35  error  require file extension '.ts'  node/file-extension-in-import

Sadly, it does not throw an error when the file is imported with a .js extension. I'm not sure why but I suppose forgetting the extension entirely is the most common case anyway.

Relates to: #4392

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Sep 17, 2024
@richvdh richvdh added the T-Task Tasks for the team like planning label Sep 17, 2024
@Johennes Johennes marked this pull request as ready for review September 17, 2024 13:48
@Johennes Johennes requested review from a team as code owners September 17, 2024 13:48
Copy link
Contributor

@florianduros florianduros left a comment

Choose a reason for hiding this comment

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

Thank you perfect

@florianduros florianduros added this pull request to the merge queue Sep 18, 2024
Merged via the queue into matrix-org:develop with commit 30058a4 Sep 18, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants