Appearance
vue/require-emit-validator
要求 emits 中有类型定义
- 💡 此规则报告的某些问题可由编辑器 suggestions 手动修复。
📖 规则详情
此规则强制 emits
语句包含类型定义。
¥This rule enforces that a emits
statement contains type definition.
使用类型声明 emits
可以带来更好的维护。即使与 TypeScript 一起使用,这也可以在使用类型注释参数时提供更好的类型推断。
¥Declaring emits
with types can bring better maintenance. Even if using with TypeScript, this can provide better type inference when annotating parameters with types.
🔧选项
¥🔧 Options
无。
¥Nothing.
📚扩展阅读
¥📚 Further Reading
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue 中引入 v7.10.0
¥This rule was introduced in eslint-plugin-vue v7.10.0
🔍代码实现
¥🔍 Implementation