-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Ensure imports are above other statements #13132
Conversation
🦋 Changeset detectedLatest commit: 6f81a98 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
(cc @benmccann) |
That work is already done (#13075), so I need the more sophisticated fix now 😄 I can work on that now as it doesn't seem like it'd take too long. I expect there are at least a couple of ways at least we could fix this:
Any preference? |
Third option: const imports = [], hoisted = [], body = [];
for (... iterate over stuff) {
..sort into right bucket
}
module = [...imports, ..etc] |
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.
Implementing my proposal and gonna merge to a) fix the regression we reintroduced b) unblock #13075
awesome! thanks @dummdidumm! I've updated #13075 to build on top of this PR |
See #13082 and #13131 for context. We can worry about a more sophisticated fix when we get round to the work that #13048 was designed to enable.
Fixes #13135
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint