ts-namespace-import-plugin
ts-namespace-import-plugin copied to clipboard
Auto import code fix missing when namespace matches global
tsconfig.common.json
:
{
"compilerOptions": {
"plugins": [
{
"name": "@unsplash/ts-namespace-import-plugin",
"namespaces": {
"URL": {
"importPath": "shared/facades/URL"
},
}
}
]
}
}
playground/src/main.ts
:
import { pipe } from 'shared/facades/function';
URL.unsafeParse(import.meta.url);
pipe(import.meta.url, URL.unsafeParse).pathname;
Expected: import suggestion for URL
Actual: no import suggestion for URL