Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing suggestions for named imports #16

Open
OliverJAsh opened this issue Apr 19, 2024 · 0 comments
Open

Missing suggestions for named imports #16

OliverJAsh opened this issue Apr 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@OliverJAsh
Copy link
Member

tsconfig.common.json:

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@unsplash/ts-namespace-import-plugin",
        "namespaces": {
          "AspectRatio": {
            "importPath": "app/types/AspectRatio"
          },
        }
      }
    ]
  }
}

app/client/index.tsx:

const x: AspectRatio = { width: 1, height: 1 }

app/types/AspectRatio.ts:

export type AspectRatio = { width: number; height: number };

Expected: auto import suggestions for both the namespace import and the named import.

Actual: auto import suggestions for the namespace import only. (Side note: why are there two namespace suggestions? This is likely another issue.)

Screen.Recording.2024-04-19.at.10.38.44.mov

It seems that the namespace import suggestion is overriding the named import suggestion.

For comparison, if we disable the TS plugin, the named import suggestion correctly appears:

image
@OliverJAsh OliverJAsh added the bug Something isn't working label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant