You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug somewhere when builtin VSCode's source.organizeImports feature is used together with Prettier.
People sometimes prefer to use VSCode's built-in source.organizeImports feature ON SAVE which, among other things, places all imports on the same line. And this conflicts with Prettier when it formats imports at multiple lines: if there is an error in the code, the underlining of this error shifts towards beginning of the file.
Fix the bug somehow (I tried to find the root case, but failed unfortunately), so organizeImports + Prettier could work together.
Introduce an option which allows to turn off imports indentation in Prettier (a quick PR: Add option neverIndentImports to skip import statements formatting #5991) - it's a work-around in some sense, but at the same time, having all imports on the same line is VSCode's default they evangelize, and Prettier in some sense goes against this default.
Hi.
There is a bug somewhere when builtin VSCode's source.organizeImports feature is used together with Prettier.
People sometimes prefer to use VSCode's built-in source.organizeImports feature ON SAVE which, among other things, places all imports on the same line. And this conflicts with Prettier when it formats imports at multiple lines: if there is an error in the code, the underlining of this error shifts towards beginning of the file.
I recorded a video which shows the effect, pretty easy to reproduce:
https://www.dropbox.com/s/apj5znzlqy8pub6/vscode-prettier.mp4?dl=0
There are two possible ways I imagine: