This configurable extension allows you to sort all the imports in a *.ts or *.tsx file.
Tip: You can access this functionality either from the context menu, or simply pressing 'F10'
typescript.extension.sortImports.bracketWhitespace: If set to false whitespace will not be included in single line imports. Default: true
typescript.extension.sortImports.forceTrailingCommas: Add the ability to use trailing commas in named import lists.
never - never add any trailing commas.
always - always add trailing commas.
singleLineOnly - only add trailing commas to single line lists.
multiLineOnly - only add trailing commas to muti-line lists.
typescript.extension.sortImports.maxLineLength: The max character count allowed in a single line named import statement. Can override maxNamedImportsInSingleLine. (This rule has precedence) Please Note: this only applies to single line named imports, it does not check line length on multi-line import statements or default imports.
Default: 0 (no max length)
typescript.extension.sortImports.maxNamedImportsInSingleLine: The number of named imports to allow on a single line. If a single import has more than this number, they will be broken up onto separate lines.
Default: 0 (ignore rule)
typescript.extension.sortImports.multilineIndention: Control when to add indentation to multi-line imports.
none - do not add indentation to multi-line imports.
namesOnly - only add indentation to the lines with named imports.
namesAndPath - add indentation to both the lines with named imports and the final line with the closing bracket and path.
typescript.extension.sortImports.omitSemicolon: If set to true, the trailing semicolon will be omitted. Default: false
typescript.extension.sortImports.pathSortOrder: An array describing the order in which imports should be sorted by paths. Only applicable if sortMethod is set to path.