Skip to content

feat(valid-v-for): add allowEmptyAlias option#3011

Merged
FloEdelmann merged 8 commits intomasterfrom
feature/allow-empty-alias
Feb 13, 2026
Merged

feat(valid-v-for): add allowEmptyAlias option#3011
FloEdelmann merged 8 commits intomasterfrom
feature/allow-empty-alias

Conversation

@waynzh
Copy link
Copy Markdown
Member

@waynzh waynzh commented Jan 22, 2026

resolve #2733.
Add an option to support this type of valid syntax.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 22, 2026

🦋 Changeset detected

Latest commit: a0079c7

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

@waynzh waynzh changed the title feat: add allowEmptyAlias option feat(valid-v-for): add allowEmptyAlias option Jan 22, 2026
@waynzh waynzh requested a review from Copilot January 22, 2026 09:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new allowEmptyAlias option to the vue/valid-v-for rule, addressing issue #2733. The feature allows developers to use empty aliases in v-for expressions, which is useful when iterating over objects where only certain parameters (like keys) are needed without the value.

Changes:

  • Added allowEmptyAlias boolean option to valid-v-for rule (defaults to false for backward compatibility)
  • Updated rule logic to conditionally allow null/empty aliases based on the option
  • Added test coverage for the new option with both valid and invalid scenarios
  • Documented the new option with configuration examples

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
lib/rules/valid-v-for.js Implements the allowEmptyAlias option with schema definition and validation logic
tests/lib/rules/valid-v-for.js Adds test cases for valid and invalid scenarios with the new option
docs/rules/valid-v-for.md Documents the new option with configuration examples and code samples
.changeset/giant-cars-open.md Changeset entry for the minor version bump

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change the error message for empty aliases?

@FloEdelmann FloEdelmann merged commit 8bfb795 into master Feb 13, 2026
37 of 40 checks passed
@FloEdelmann FloEdelmann deleted the feature/allow-empty-alias branch February 13, 2026 17:25
@github-actions github-actions bot mentioned this pull request Feb 13, 2026
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.

vue/valid-v-for should not trigger on looping through only keys of an object

3 participants