vue/no-reserved-component-names
禁止在组件定义中使用保留名称
- ⚙️ 此规则包含在所有
"plugin:vue/vue3-essential"
、*.configs["flat/essential"]
、"plugin:vue/essential"
、*.configs["flat/vue2-essential"]
、"plugin:vue/vue3-strongly-recommended"
、*.configs["flat/strongly-recommended"]
、"plugin:vue/strongly-recommended"
、*.configs["flat/vue2-strongly-recommended"]
、"plugin:vue/vue3-recommended"
、*.configs["flat/recommended"]
、"plugin:vue/recommended"
和*.configs["flat/vue2-recommended"]
中。
📖 规则详情
此规则可防止 Vue 组件与标准 HTML 元素和内置组件之间的名称冲突。
🔧 选项
json
{
"vue/no-reserved-component-names": ["error", {
"disallowVueBuiltInComponents": false,
"disallowVue3BuiltInComponents": false
}]
}
disallowVueBuiltInComponents
(boolean
) ... 如果为true
,则禁止使用 Vue.js 2.x 内置组件名称。默认为false
。disallowVue3BuiltInComponents
(boolean
) ... 如果为true
,则禁止使用 Vue.js 3.x 内置组件名称。默认为false
。
"disallowVueBuiltInComponents": true
"disallowVue3BuiltInComponents": true
👫 相关规则
📚 延伸阅读
🚀 版本
此规则在 eslint-plugin-vue v6.1.0 中引入