Skip to content

vue/no-duplicate-attr-inheritance

enforce inheritAttrs to be set to false when using v-bind="$attrs"

📖 Rule Details

This rule aims to prevent duplicate attribute inheritance.
This rule suggests applying inheritAttrs: false when it detects v-bind="$attrs" being used.

Now loading...
Now loading...

🔧 Options

json
{
  "vue/no-duplicate-attr-inheritance": ["error", {
    "checkMultiRootNodes": false,
  }]
}
  • "checkMultiRootNodes": If set to true, also suggest applying inheritAttrs: false to components with multiple root nodes (where inheritAttrs: false is the implicit default, see attribute inheritance on multiple root nodes), whenever it detects v-bind="$attrs" being used. Default is false, which will ignore components with multiple root nodes.

"checkMultiRootNodes": true

Now loading...

📚 Further Reading

🚀 Version

This rule was introduced in eslint-plugin-vue v7.0.0

🔍 Implementation