Auto remove and sort JS imports (VS code)
Say you have a few unused imports in your JS file:
import charlie from "@library/charlie";
import alpha from "@library/alpha";
import beta from "@library/beta"; #UNUSED
import echo from "@library/echo";
import delta from "@library/delta"; #UNUSED
If you're using Visual Studio Code (or a forked version like Cursor) you can press Option/Alt
+Shift
+O
to remove all unused imports.
import alpha from "@library/alpha";
import charlie from "@library/charlie";
import echo from "@library/echo";
TweetNote: this also sorts your current imports