daidodo / format-imports-vscode

Format imports and exports for JavaScript and TypeScript in VS Code.
https://marketplace.visualstudio.com/items?itemName=dozerg.tsimportsorter
MIT License
62 stars 5 forks source link

Change "tsImportSorter.configuration.autoFormat" default to "off" #59

Closed ZouYouShun closed 2 years ago

ZouYouShun commented 2 years ago

hi @daidodo !

awesome extension!

thanks a lot for that extension, I have some suggestions for you,

could we change that autoFormat to off

"tsImportSorter.configuration.autoFormat": "off",

I think that will be greater for users to config that if they want that auto format.

otherwise when user not config with prettier or eslint yet, they will meet that conflict issue.

daidodo commented 2 years ago

Thanks for the feedback!

Could you be more specific about your use case?

My assumption is if people install the extension, they expect it to work right away, instead of needing another step to enable it.

ZouYouShun commented 2 years ago

actually, I pack your package into my extension call index-generator and use your command directly🤣 https://github.com/ZouYouShun/vscode-index-generator/blob/master/src/handlers/fixFileOnce.handler.ts#L72

so that make users meet that default save format issue,

maybe turning that off will be friendly,

users will not meet any confusion when they don't want that format and just use that command to sort when that want.

daidodo commented 2 years ago

Thanks for sharing!

Have you checked https://github.com/daidodo/format-imports on which this extension is built? You can use either the CLI or APIs in your extension and customize configs as you want.