feat(valid-v-for): add allowEmptyAlias option#3011
Conversation
🦋 Changeset detectedLatest commit: a0079c7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
allowEmptyAlias optionallowEmptyAlias option
…ure/allow-empty-alias
There was a problem hiding this comment.
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
allowEmptyAliasboolean option tovalid-v-forrule (defaults tofalsefor 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.
FloEdelmann
left a comment
There was a problem hiding this comment.
Can you please change the error message for empty aliases?
resolve #2733.
Add an option to support this type of valid syntax.