feat(language-core): check required fallthrough attributes#6049
Merged
KazariEX merged 5 commits intoMay 17, 2026
Merged
Conversation
serkodev
reviewed
May 16, 2026
Member
There was a problem hiding this comment.
In child.vue, if some props such as bar are already passed directly to the inner component, should bar still be required again when using the child component from main.vue? I would expect props already supplied by the wrapper to be excluded from the required fallthrough attrs.
<!-- child.vue -->
<!-- @checkRequiredFallthroughAttributes true -->
<script setup lang="ts">
import basic from './basic.vue';
</script>
<template>
<basic bar="fixed" />
</template><!-- main.vue -->
<template>
<!-- should not require bar prop here? -->
<child />
</template>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolve #5882
Consider the following structure:
When the
fallthroughAttributesoption is enabled onComp,Compinherits all props fromBasic, allowing us to get prop completions forBasicwhen usingComp.By default, however, the props inherited from
Basicare all optional. This means we cannot enforce passing those required props when usingComp. At the same time, even if the required props fromBasicare passed toComp,Basicwill still report missing prop errors.After enabling the new
checkRequiredFallthroughAttributesoption onComp,Compwill inheritBasic's props exactly as they are, and the missing prop errors onBasicinsideCompwill disappear. This is because doing so is equivalent to promising that these required props should be passed when usingComp. Additionally, if some of the props required byBasichave already been passed directly toBasic, those props will be excluded from the inherited props.