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 prettier plugin to sort imports in a consistent way #5109

Merged
merged 2 commits into from
Feb 27, 2023
Merged

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Feb 24, 2023

This adds @trivago/prettier-plugin-sort-imports to the project, so that we can ensure a consistent and automated imports sorting on front-end components via prettier.

This was already introduced in client. See hypothesis/client#5237 and hypothesis/client#5279

@@ -1,17 +1,17 @@
// Register the same set of icons that is available in the app.
Copy link
Member

Choose a reason for hiding this comment

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

This comment belongs with the registerIcons call below.

.prettierrc Outdated
"importOrder": [
"^[./]"
],
"importOrderSeparation": true
}
Copy link
Member

Choose a reason for hiding this comment

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

In the client we have this configuration in package.json. We might want to do the same here to cut down on the proliferation of config files. In general we can do the same for other tools where a) the tool supports reading config from package.json and b) the config is small and obvious, so doesn't need comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In frontend-shared it is also part of package.json. I have moved it there here as well.

@acelaya acelaya merged commit 4890a34 into main Feb 27, 2023
@acelaya acelaya deleted the sort-imports branch February 27, 2023 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants