-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFix AvailableA PR has been opened for this issueA PR has been opened for this issueSuggestionAn idea for TypeScriptAn idea for TypeScriptVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestoneCritical issues that VS Code needs fixed in the current TypeScript milestone
Milestone
Description
Search Terms
auto-import; import; auto import
Suggestion
Support auto-import with alphabetized order by default
Use Cases
Currently, Typescript auto-import by adding the new module at the end. But it does not obey tslint rule: ordered-imports It will be better if typescript can auto-import with alphabetized order by default :)
Examples
import { B } from 'moduleB';
...
const a = new A(); // Ctrl+. -> Do you want to import A?
then
import { A, B } from 'moduleB'; // A is auto-imported in front of B
...
const a = new a();
...
classs ModuleA implements IModuleA { // Ctrl+. -> Do you want to import IModuleA?
...
then
import { IModuleA } from 'moduleA'; // moduleA is auto-imported above moduleB
import { A, B } from 'moduleB';
...
const a = new a();
...
class ModuleA implements IModuleA {
...
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
Metadata
Metadata
Assignees
Labels
Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFix AvailableA PR has been opened for this issueA PR has been opened for this issueSuggestionAn idea for TypeScriptAn idea for TypeScriptVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestoneCritical issues that VS Code needs fixed in the current TypeScript milestone