Skip to content

vue/require-prop-comment

要求 props 有注释

¥require props to have a comment

📖 规则详情

此规则强制每个 prop 都有一个注释来记录它。

¥This rule enforces that every prop has a comment that documents it.

Now loading...

🔧选项

¥🔧 Options

json
{
  "vue/require-prop-comment": ["error", {
    "type": "JSDoc"
  }]
}
  • type ...注释类型。默认值为 "JSDoc"

    ¥type ... Type of comment. Default is "JSDoc"

    • "JSDoc" ...仅允许 JSDoc 注释。

      ¥"JSDoc" ... Only JSDoc comment are allowed.

    • "line" ...仅允许行注释。

      ¥"line" ... Only line comment are allowed.

    • "block" ...仅允许块注释。

      ¥"block" ... Only block comment are allowed.

    • "any" ...允许所有注释类型。

      ¥"any" ... All comment types are allowed.

"type": "block"

Now loading...

"type": "line"

Now loading...

"type": "any"

Now loading...

🚀版本

¥🚀 Version

此规则是在 eslint-plugin-vue 中引入的 v9.8.0

¥This rule was introduced in eslint-plugin-vue v9.8.0

🔍代码实现

¥🔍 Implementation

eslint-plugin-vue v10.0 中文网 - 粤ICP备13048890号