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

Prettier: Use prettier-plugin-organize-imports #899

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

baltpeter
Copy link
Member

As we discussed, inconsistent import ordering and having to think about stuff like that are way too annoying. In #898, I didn't agree with where you put the type imports and that finally pushed me over the edge and I went looking for a solution. :D

I personally would have sorted the imports differently than this plugin but it uses the official TypeScript language service API and I much prefer not having to think about the imports at all.

If we actually do care about controlling the sort order (I don't think I do), there's also https://github.com/trivago/prettier-plugin-sort-imports.

@cypress
Copy link

cypress bot commented May 31, 2022



Test summary

67 0 8 0Flakiness 0


Run details

Project datenanfragen/website
Status Passed
Commit 88f876a
Started May 31, 2022 9:23 PM
Ended May 31, 2022 9:26 PM
Duration 03:10 💡
OS Linux Debian - 10.9
Browser Electron 91

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Member

@zner0L zner0L left a comment

Choose a reason for hiding this comment

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

When I try this, it deletes imports if I paste them in:

Screen.Recording.2022-06-01.at.20.00.58.mov

@baltpeter
Copy link
Member Author

Do you have "format on save" enabled? See: simonhaenisch/prettier-plugin-organize-imports#37

I'm a bit torn on that. I very much enjoy that it deletes unused imports (though I guess, ESLint would complain about that anyway?) but having that triggered on paste is a bit annoying.

@zner0L
Copy link
Member

zner0L commented Jun 13, 2022

The way I see it, this is clearly a bug. None of the imports were supposed to be deleted, but it deletes them anyhow. I do have "format on save" enabled, but I also want to keep it that way. An yes, ESLint already takes care of unused imports. If you care a lot about those, we can compromise on increasing the severity of unused imports in ESLint so that the commit test fails for them. But this plugin is counterintuitve and, frankly, buggy.

@baltpeter
Copy link
Member Author

@mal-tee mal-tee added the stale PR has been lying around without action for a while label Jun 10, 2023
@christian-weiss
Copy link
Contributor

This PR is 1.5 years old and 0.5 years stale. I vote for it to be CLOSED.

You may want to experiment with latest version (4.3.0), as this PR was done with 2.3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup stale PR has been lying around without action for a while
Development

Successfully merging this pull request may close these issues.

None yet

4 participants