-
Notifications
You must be signed in to change notification settings - Fork 130
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
BED-5112: use prettier to organize imports #1026
Conversation
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.
LGTM, tested locally did in fact organize my imports automagically 🪄
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.
🚀
I like the idea but I am seeing one issue. After updating my dependencies and running
|
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.
Please see my above comment!
@elikmiller thats sus! Ill check it out. Thanks! |
@elikmiller found the problem! But its super weird. Its not directly related to this prettier plugin, but a side-effect from formatting the imports. In
|
@benwaples It looks like if we delete this module declaration in I don't exactly remember why we needed this declaration in the first place, might have been a missed cleanup when we moved from MUI 4 to 5.
|
@elikmiller from what I can tell it was part of the migration from 4 -> 5 so I was hesitant to delete it. Sounds like their reasoning for the augmentation is if we use If TS and the build is happy, Im happy to remove. Are you still comfortable with that? |
@benwaples Yes and it looks like we can remove it from |
@elikmiller discussed offline, but to summarize, we are keeping the module augmentation in |
@elikmiller came across more import ordering errors in |
Description
Adds a plugin to prettier that sorts, combines and removes unused imports using the organizeImports feature of the TS language server.
Motivation and Context
This PR addresses: BED-5112
Organized imports helps devs parse where code is coming from. This is particularly helpful as we replace MUI with DoodleUI and many of the components will have similar, if not the same, names to help migrate to the new component library.
Additionally, this plugin will remove unused imports, so one less thing to review for.
The npm documentation is very helpful, feel free to give it a review!
How Has This Been Tested?
confirmed that prettier will automatically update imports.
Screenshots (optional):
n/a
Types of changes
Checklist: