ts-format-imports
v0.1.1
Published
Typescript import formatter
Downloads
8
Readme
ts-format-imports
TypeScript import formatter powered by TypeScript Compiler API.
Installation
npm install -g ts-format-imports
Usage
$ ts-format-imports file1.ts file2.ts file3.ts
The command above will reformat import declarations and remove duplicate imports from the specified files.
For example, this:
import {foo, bar} from 'modules/foo';
import {bar} from 'modules/foo';
import * as ts from 'typescript';
import {doSomething} from 'modues/boo';
after reformatting would look like
import * as ts from 'typescript';
import {doSomething} from 'modues/boo';
import {bar} from 'modules/foo';
import {foo} from 'modules/foo';