Skip to content

Vue Language Tool assumes every component is imported globally #7978

@NicolaiHorlacher

Description

@NicolaiHorlacher

Describe the bug

The Vue language tool picks up every GlobalComponents definition in the entire project directory, including those in node_modules. This causes type pollution for all users, even if they are not globally importing components or are using a global name prefix for their global imports.

Installing the primevue package by it self, registers all PrimeVue components as GlobalComponents.

Pull Request Link

More context in the PR description:
#7977

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-at51ahpu?file=src%2FApp.vue

Environment

Vue version

3.5.18

PrimeVue version

4.3.7

Steps to reproduce the behavior

  • Install the Official Vue Extension in VSCode
  • Create a Vue project and install the primevue package.
  • Even without adding PrimeVue to the Vue application the Vue Language Server assumes that every PrimeVue Component is added globally.

Expected behavior

Like with any other vue component library, only components that the user is explicitly importing globally should be added to global type definitions.
unplugin-vue-components can do this for example.

Metadata

Metadata

Labels

Status: Pending ReviewIssue or pull request is being reviewed by Core Team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions