A clean and efficient VSCode extension for managing the module resolution in your Typescript projects.
When working with Typescript projects (React, Angular, etc), classes and other types are stored in separate files in the directory, to which we can then call on them by using import
.
Throughout this process, this can result in a large clutter amount of import statements per file(s) in the directory. As you keep developing, it can appear not pleasant when trying to show your code, or sharing it to other developers.
By generate a index.ts
file, we can follow the logic for module resolution and create a clean import scenario by having one file contain all the imports, to which we can then export them so that your file(s) only have one import
statement declared.
Once installed, all you simply have to do is right-click on the directory you would like, and hit the Simple Imports.
This will create a index.ts
in the directory, which will contain all the imports used by the .ts files.
Example
For example if there is a directory called sorting
, we could generate a index.ts file that will allow you to simply import in your files in the following format:
import { Users, Cohesion, SortingType } from './@sorting';
This extension requires you to just be working in a directory in your project that has Typescript files.
This extension contributes the following settings:
explorer/context
: Displays a option in the context menu.
- Currently this extension only takes from the directory you have right-clicked on, currently IP is being able to obtain the sub-directories as well.
Initial release of Simple Imports!
😁 Thank you for checking this extension out!