Skip to content

feat(match-component-import-name): add ignoreConflictingNames option - #3218

Open
ValentinYoushkevich wants to merge 2 commits into
vuejs:masterfrom
ValentinYoushkevich:feat/match-component-import-name-ignore-conflicting
Open

ValentinYoushkevich wants to merge 2 commits into
vuejs:masterfrom
ValentinYoushkevich:feat/match-component-import-name-ignore-conflicting

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

vue/match-component-import-name wants the registered name to equal the import name, which can't work when that name is already taken in the file. A common case is a component that shares its name with a TypeScript interface or a model class: the import has to be renamed, so you end up with FooBar: FooBarComponent, and the rule reports it. Registering it as FooBarComponent just to please the rule isn't what anyone wants in the template. Playground

As proposed in the issue, the new ignoreConflictingNames option (default false) skips a registration whose name, or the PascalCase form of a kebab-case key, is declared in the file, type-only imports and interfaces included. Implicit globals don't count, and other mismatches are still reported.

Fixes #2011

@changeset-bot

changeset-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8d067ff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-vue Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…ent-import-name-ignore-conflicting

# Conflicts:
#	lib/rules/match-component-import-name.ts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

match-component-import-name: ignore if there is a conflicting type definition

1 participant