Auto import in Visual Studio Code only offering absolute path with Lerna subpackages in TypeScript
In Visual Studio Code, menu File → Preferences → Settings → User Settings,
"typescript.preferences.importModuleSpecifier": "relative"
It works fine for me. It imports
import { RegistrationComponent } from '../../abc-modules/registration/registration.component';
in place of
import { RegistrationComponent } from 'app/abc-modules/registration/registration.component';
I landed here from Google and had the opposite problem. My Visual Studio Code instance always imported the relative path even though it was from a different Lerna package.
It turns out that I simply forgot to add the package that it was wrongly importing to my consuming package’s package.json
file.
Now, everything works as expected.