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 for consistent type imports #10852

Merged
merged 6 commits into from
May 15, 2023

Conversation

phryneas
Copy link
Member

@phryneas phryneas commented May 9, 2023

This will split up our import statements into import and import type statements, which will hopefully make it easier for bundlers to work with our files, and might remove some accidental runtime import cross-dependencies that might have creeped into our packages.

What do you think - should we do this?

Checklist:

  • If this PR contains changes to the library itself (not necessary for e.g. docs updates), please include a changeset (see CONTRIBUTING.md)
  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

@changeset-bot
Copy link

changeset-bot bot commented May 9, 2023

🦋 Changeset detected

Latest commit: d56f26c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@apollo/client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@phryneas phryneas requested review from jerelmiller, alessbell and benjamn and removed request for alessbell May 9, 2023 14:55
Copy link
Contributor

@alessbell alessbell left a comment

Choose a reason for hiding this comment

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

I'm in favor of this change: there are the benefits you've mentioned, and the type imports also make the code easier to grok at a glance 🎉

@phryneas phryneas marked this pull request as ready for review May 12, 2023 09:25
@phryneas
Copy link
Member Author

I talked to Ben yesterday, he's also on board with this. Waiting for input from Jerel on this, and I guess then I'll get this updated & merged :)

Copy link
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

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

I dig it. Thank you!!

@phryneas phryneas merged commit 27fbdb3 into release-3.8 May 15, 2023
@alessbell
Copy link
Contributor

We're only linting **/__tests__/**/*.[jt]sx files on CI right now - we should expand that to include files in src too.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2023
@jerelmiller jerelmiller deleted the pr/@typescript-eslint/consistent-type-imports branch August 8, 2023 15:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants