Open georgekrax opened 2 years ago
@georgekrax Thanks for your feedback!
There was a similar issue before (https://github.com/daidodo/format-imports-vscode/issues/43):
Details about how exports are formatted can be found https://github.com/daidodo/format-imports-vscode/issues/6#issuecomment-619386911. And sorting exports by paths is not supported yet because the requirement isn't clear.
But still, I'm open to suggestions and ideas.
@daidodo Oh okay, thanks for the update!
Do you plan to support a "sorting exports" feature?
Depends on how clear the requirements are.
Exports can be at the front, middle or end of the file. There is no standard about how they should be organised, AFAIK.
Well, that is a reasonable question from your side.
I would use this feature (sorting exports) only on index.ts
files, where I export only a chunk of various components/variables/types. Only in that case I would find it useful, as in the pictures above that I have attached. Otherwise, I believe it wouldn't matter to sort them.
settings.json
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
If I enable the default/automatic sorting imports functionality of VS Code, then it also sorts the exports!
Describe the bug When I run the extension in any file of my project, the extension does not sort the
export
statements! I have enabled the"configuration.formatExports": true
, but still nothing changes.However, it sorts the
import
statements very well!To Reproduce
settings.json
"tsImportSorter.configuration.formatExports": true
index.ts
file of yours that exports lots of components or variables, and through theCommand Palette
runSort Imports/Exports
export
statements remain in the same order, and don't change alphabeticallyExpected behavior I would expect that the
export
statements are sorted too, by theirpaths
names.Screenshots
Actual behavior
Expected behavior
OS (please complete the following information):
VS Code (please complete the following information):
package.json
tsconfig.json (if any)
.prettierrc/.prettierrc.js/prettier.config.js/.prettierrc.toml (if any) filename: .prettierrc