simonhaenisch/prettier-plugin-organize-imports

Imports get removed on save

jamal7887 opened this issue · 4 comments

The import organizer removes imports from Typescript files upon saving, but only does this in some files.

It's a feature not a bug 😅

intgr commented

Not sure what the OP meant, but I experienced a situation where all imports disappeared from one file, making it invalid. But it has not happened again.

Another data point. Just had to remove this plugin that was added to our project. In our case in a .vue file component imports were being removed from the script block even though those components are in use in the template tag.

Before save
Screenshot 2024-07-08 at 4 24 50 PM

After save
Screenshot 2024-07-08 at 4 24 54 PM

@andrew-boyd are you using the latest version 4.0.0 with the new vue tooling? Would you be able to open a pull request that adds this kind of code as a test case to this repo? You can put it here: https://github.com/simonhaenisch/prettier-plugin-organize-imports/blob/master/test/vue.js