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

Enable @typescript-eslint/consistent-type-imports lint rule #4611

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

hughns
Copy link
Member

@hughns hughns commented Jan 10, 2025

This is a speculative PR after encountering an unexpected (and unnecessary) circular dependency in some unit tests.

Some background on this rule: https://typescript-eslint.io/blog/consistent-type-imports-and-exports-why-and-how/

We already have the equivalent of this for exports from https://github.com/matrix-org/eslint-plugin-matrix-org/blob/a1ce5fbb7d425b932c504ae2bb7f985e3c07d9fd/typescript.js#L99

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).

Some background on this rule: https://typescript-eslint.io/blog/consistent-type-imports-and-exports-why-and-how/

We already have the equivalent of this for exports from https://github.com/matrix-org/eslint-plugin-matrix-org/blob/a1ce5fbb7d425b932c504ae2bb7f985e3c07d9fd/typescript.js#L99

Revert "Enable @typescript-eslint/consistent-type-imports lint rule"

This reverts commit 41a02493d0f30d74b5f76ee076b6574c7835e236.

.
Revert "Fix resulting violations"

This reverts commit 9aea668.

Fix violations
@@ -139,6 +139,8 @@ module.exports = {
},
],
"no-extra-boolean-cast": "error",
// to avoid unnecessary runtime dependencies between files
"@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

That would make sense to me, assuming agreeable that this is generally a Good Thing.

If so I can make the necessary PRs.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants