Skip to content
On this page

vue/padding-lines-in-component-definition

require or disallow padding lines in component definition

  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

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 ... Setting padding lines between options. default always
  • withinOption ... Setting padding lines within option
    • emits ... Setting padding between lines between emits and defineEmits. default always
    • props ... Setting padding between lines between props and defineProps. default always
    • ...
  • 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

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

🔍 Implementation