import-js/eslint-plugin-import

Possible false positive import/namespace error on exported type

Open

#3.019 geöffnet am 22. Juni 2024

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.540 Forks)batch import
bughelp wantedtypescript

Repository-Metriken

Stars
 (4.946 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 138T 22h) (3 gemergte PRs in 30 T)

Beschreibung

I'm seeing the following ESLint error when trying to use a namespace import for React Aria Components. I'm unsure whether this could be related to the config in the default .eslintrc.cjs file of the Remix template or if it might be a false positive being reported. ButtonProps is being exported by the RAC module, so it's confusing why this error would be shown.

'ButtonProps' not found in imported namespace 'ReactAria'. eslint(import/namespace)
import * as ReactAria from "react-aria-components";

// ...

export interface ButtonProps
  extends ReactAria.ButtonProps,
    VariantProps<typeof buttonVariants> {}

// ...

The error is not reported when I use the namespace import for exports that aren't types:

<ReactAria.Button {...props} />

Running npm run lint in the example app will show the error mentioned above.

Any ideas what might be happening here and whether this is expected or not?

Contributor Guide