Closed tjx666 closed 1 year ago
When you set:
tsImportSorter.configuration.wrappingStyle": "prettier"
The plugin will mimic prettier's result which doesn't wrap unless line limit is met.
So the question is why you have it in vscode user settings?
I add that setting because I want to ensure the wrappingStyle using prettier style
The key probelem is when I using first setting, will cause code falsh like in video.
Seems to avoid flash, only need add:
{
"tsImportSorter.configuration.autoFormat": "off",
}
Now I understand your problem. The "flash" you see is due to twice formations by prettier and this plugin. It's gone when you turn either off.
I understand it's unpleasant but there's not much I can do (or I don't know what to do).
Happy to take advices!
For anyone with the same question, my advice is to disable auto format and just using the codeActionOnSave:
{
"editor.codeActionsOnSave": {
// others...
"source.organizeImports.sortImport": true,
"tsImportSorter.configuration.autoFormat": "off",
},
}
https://user-images.githubusercontent.com/41773861/209470032-fe12287a-c9d3-4555-a677-b8e4945055c2.mov
With following user settings:
The solution is add following settings:
https://user-images.githubusercontent.com/41773861/209470161-74bf3be5-efc0-4ba7-9072-61f17e69d767.mov
That's why my format result is differen't with you in pr: https://github.com/daidodo/format-imports/pull/18