For some reason, very recently my Visual Studio Code changed and started only offering absolute imports from the sub-package level with my Lerna packages, for example:
As you can see, the auto import is suggesting the @package/server/src/database
path to the file when it should just be ../database
as the file being edited is within the same package and is just one folder below the file containing the database variable I'm trying to use.
Is this a bug or configuration issue?
I've set my Import Module Specifier
setting for TypeScript in Visual Studio Code to all three options (auto, relative, and absolute) and none of them seem to make any difference.
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';