title: Enable Fallthrough Attributes Type Checking impact: MEDIUM impactDescription: enables IDE autocomplete for fallthrough attributes in wrapper components type: capability
Impact: MEDIUM - enables type-aware attribute forwarding in component libraries
When building component libraries with wrapper components, enable fallthroughAttributes to get IDE autocomplete for attributes that will be forwarded to child elements.
Wrapper components that pass attributes to child elements can benefit from type-aware completion:
<!-- MyButton.vue - wrapper around native button -->
<template>
<button v-bind="$attrs">
<slot />
</button>
</template>
Enable fallthroughAttributes in your tsconfig:
// tsconfig.json or tsconfig.app.json
{
"vueCompilerOptions": {
"fallthroughAttributes": true
}
}
When fallthroughAttributes: true:
$attrsNote: This primarily enables IDE autocomplete for valid fallthrough attributes. It does NOT reject invalid attributes as type errors - arbitrary attributes are still allowed.
Combine with strictTemplates for comprehensive checking:
{
"vueCompilerOptions": {
"strictTemplates": true,
"fallthroughAttributes": true
}
}