Skip to content

vue/padding-lines-in-component-definition

要求或禁止组件定义中的填充行

  • 🔧 command line 上的 --fix 选项可以自动修复此规则报告的一些问题。

📖 规则详情

此规则要求或禁止在组件定义中出现空行。适当的空行有助于开发者提高代码的可读性和代码样式灵活性。

¥This rule requires or disallows blank lines in the component definition. Properly blank lines help developers improve code readability and code style flexibility.

Now loading...
Now loading...

🔧选项

¥🔧 Options

json
{
  "vue/padding-lines-in-component-definition": ["error", {
    "betweenOptions": "always" | "never",

    "withinOption": {
      "props": {
        "betweenItems": "always" | "never" | "ignore",
        "withinEach": "always" | "never" | "ignore",
      } | "always" | "never" | "ignore", // shortcut to set both

      "data": {
        "betweenItems": "always" | "never" | "ignore",
        "withinEach": "always" | "never" | "ignore",
      } | "always" | "never" | "ignore" // shortcut to set both

      // ... all options
    } | "always" | "never" | "ignore",

    "groupSingleLineProperties": true | false
  }]
}
  • betweenOptions ...设置选项之间的填充行。默认 always

    ¥betweenOptions ... Setting padding lines between options. default always

  • withinOption ...设置选项内的填充行

    ¥withinOption ... Setting padding lines within option

    • emits ...设置 emitsdefineEmits 之间行之间的填充。默认 always

      ¥emits ... Setting padding between lines between emits and defineEmits. default always

    • props ...设置 propsdefineProps 之间行之间的填充。默认 always

      ¥props ... Setting padding between lines between props and defineProps. default always

    • ...

  • groupSingleLineProperties ...设置多个连续单行属性的分组(例如 nameinheritAttrs),默认 true

    ¥groupSingleLineProperties ... Setting groupings of multiple consecutive single-line properties (e.g. name, inheritAttrs), default true

分组单行属性

¥Group single-line properties

Now loading...

使用自定义选项

¥With custom options

Now loading...

🚀版本

¥🚀 Version

此规则在 eslint-plugin-vue v9.9.0 中引入

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

🔍代码实现

¥🔍 Implementation

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