/vscode-mono-repo-import-fixer

A vscode extension that fixes imports of TypeScript files from sibling packages in a mono repo (e.g. Lerna)

Primary LanguageTypeScript

Typescript Mono Repo Import Helper

If you have a Lerna mono-repo, then vs-code may auto-generate imports for you that look like this:

import { doSomething } from "../../package2/src/doSomething.ts";

doSomething();

When you really want the import to look like this:

import { doSomething } from "@my-app/package2";

doSomething();

This extension automatically converts any imports of the first format to the second format when you save the file.

It runs on any .ts .tsx or .js files that are nested inside a 'packages' directory.

Usage

Install the extension, and it'll fix the imports whenever you hit save.