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

Sort modules #72

Merged
merged 5 commits into from
Oct 19, 2021
Merged

Sort modules #72

merged 5 commits into from
Oct 19, 2021

Conversation

ratierd
Copy link
Contributor

@ratierd ratierd commented Aug 19, 2021

Add an option to sort imports module declarations so that :

import DefaultModule, { moduleB, moduleC, moduleA };

Will be transformed into :

import DefaultModule, { moduleA, moduleB, moduleC };

The option is disabled by default

Closes #40

Fixes #67 default module issue -> #44 (comment)

@ayusharma ayusharma changed the base branch from master to v3.x August 26, 2021 14:47
@ayusharma
Copy link
Collaborator

Hi @ratierd , I just changed the base of your PR to v3.x. Could you please resolve the conflicts? Thank you. 😃

Use an option object composed from prettier configuration as parameter
for getSortedModules method. Add sortModules option to enable sorting
modules in import statements
@ratierd
Copy link
Contributor Author

ratierd commented Aug 26, 2021

Hi @ratierd , I just changed the base of your PR to v3.x. Could you please resolve the conflicts? Thank you.

Sure thing 🙂

Copy link
Collaborator

@byara byara left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. Could you please update it? Otherwise it looks good to me 👍
I left a note regarding a remaining debugger in the code.

src/utils/get-sorted-nodes.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@ayusharma ayusharma left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@ayusharma ayusharma merged commit 53d9789 into trivago:v3.x Oct 19, 2021
@ratierd ratierd deleted the sort_modules branch October 19, 2021 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sort import specifiers sort imported items, too
4 participants