Is there a way of tweaking TypeScript Auto import feature in Visual Studio Code?
As an example, observe the following attempt:
The added line by the Auto import was the following:
import { Pins } from '../types/index';
I would like it to be added straight away without the comma, in respect to TSLint, and without the /index
path, due to my subject sense of aesthetics, like the following:
import { Pins } from '../types'
Is there a way of saving those few "extra" keyboard hits?
Automatically optimize imports on savePress Ctrl+Alt+S to open the IDE settings and select Tools | Actions on Save. Enable the Optimize imports option. Additionally, from the All file types list, select the types of files in which you want to optimize imports. Apply the changes and close the dialog.
While refactoring your javascript/typescript code it's easy to remove things but forget to get rid of the unused imports. In VSCode, you can easily remove these with the shortcut : Shift + Alt + O.
Download TypeScript Hero extension.
Go to settings (Ctrl
+ ,
).
In settings go to User
(selected default) >> Extensions
>> TypeScript Hero
TypeScript Hero > Imports: Insert Semicolons
[x] Defines if there should be a semicolon at the end of the statement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With