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

chore: import sorting for test folder and e2e folder #10190

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

ematipico
Copy link
Member

Changes

This PR applies import sorting for the test folders and the e2e folders.

I will make a later PR to ignore the commit from git.

Testing

Current CI should pass

Docs

Copy link

changeset-bot bot commented Feb 22, 2024

⚠️ No Changeset found

Latest commit: cf18140

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions bot added pkg: vue Related to Vue (scope) pkg: react Related to React (scope) pkg: integration Related to any renderer integration (scope) pkg: create-astro Related to the `create-astro` package (scope) pkg: astro Related to the core `astro` package (scope) labels Feb 22, 2024
bluwy
bluwy approved these changes Feb 22, 2024
Comment on lines -1 to +2
import { defineConfig } from 'astro/config';
import preact from '@astrojs/preact'
import { defineConfig } from 'astro/config';
Copy link
Member

Choose a reason for hiding this comment

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

I think the only slightly odd part of the formatting is that defineConfig is now below, but I'm not sure if it's feasible to make a rule to fix this. I'm not too bummed by it but bringing this up in case others might think the same.

Copy link
Member Author

@ematipico ematipico Feb 22, 2024

Choose a reason for hiding this comment

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

Makes sense. Here's the algorithm: https://biomejs.dev/analyzer/#how-imports-are-sorted in case others want to read it.

Bjorn, what would you expect from the import sorting, other than being the same as TypeScript?

Copy link
Member

Choose a reason for hiding this comment

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

I think the sorting algorithm is fine, but if there's an option to tweak certain orderings, I think that's a great bonus.
e.g. https://github.com/IanVS/prettier-plugin-sort-imports?tab=readme-ov-file#1-put-specific-dependencies-at-the-top. I used to use this prettier plugin and it has a few options to configure the ordering.

@ematipico ematipico merged commit 1e638c4 into main Feb 22, 2024
13 checks passed
@ematipico ematipico deleted the chore/import-sorting-packages branch February 22, 2024 13:58
log101 pushed a commit to log101/astro that referenced this pull request Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: create-astro Related to the `create-astro` package (scope) pkg: integration Related to any renderer integration (scope) pkg: react Related to React (scope) pkg: vue Related to Vue (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants