amatiasq / vsc-sort-imports

Sort ES6 imports automatically.
ISC License
58 stars 24 forks source link

Extension doesn't work with error: Unexpected token, expected "}" #61

Open shenj opened 4 years ago

shenj commented 4 years ago

The extension doesn't work if the codes contains the type cast. For example:

props.filterProps= <IDropdownGroupProps>{ onSelectedItemChanged: (period) => this.loadItems(period) };

But if I use as to cast type, the extension will work, for example:

props.filterProps= { onSelectedItemChanged: (period) => this.loadItems(period) } as IDropdownGroupProps;

jerome-benoit commented 3 years ago

Since we are relying on an external tool https://github.com/renke/import-sort that do the tokenization, you should report that issue also there.