Auto-Import
Auto-Import copied to clipboard
Place imports after licence/comment headers
For the moment top comments (license headers) are not respected during auto-import. For example:
sample.ts
/*!
* @license
* Copyright 2016 Company.
*/
export class MyClass {}
During auto-import the line will be added to the top of the file:
sample.ts
import { Observable } from 'rxjs/Rx';
/*!
* @license
* Copyright 2016 Company.
*/
export class MyClass {}
Expected behaviour: it should put imports after top comment block (ideally to be configurable via some settings flag)
Working on this as we speak :)
cheers!
New imports should be placed at the bottom of the imports. And according to the Angular Style Guide, imports should be divided into 2 sections, leaving one empty line between third party imports and application imports.
Yeah, I agree - I am going to build some configuration into this.
+1
Please add them under both the "/*" and "//" types of comment, if they are before any existing import/declaration.
@soates Is there anything we can do to help you with this feature? If you already have something for this, maybe push it in a new branch so someone else can continue to work on it.
Perhaps this extension might help https://marketplace.visualstudio.com/items?itemName=peterjuras.sort-imports