Skip to content

Latest commit

 

History

History
95 lines (73 loc) · 2.06 KB

new-line-between-multi-line-property.md

File metadata and controls

95 lines (73 loc) · 2.06 KB
pageClass sidebarDepth title description
rule-details
0
vue/new-line-between-multi-line-property
enforce new lines between multi-line properties in Vue components

vue/new-line-between-multi-line-property

enforce new lines between multi-line properties in Vue components

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

📖 Rule Details

This rule aims at enforcing new lines between multi-line properties in Vue components to help readability

<script>
/* ✗ BAD */
export default {
  props: {
    value: {
      type: String,
      required: true
    },
    focused: {
      type: Boolean,
      default: false,
      required: true
    },

    label: String,
    icon: String
  },
  computed: {

  }
}
</script>
<script>
/* ✓ GOOD */
export default {
  props: {
    value: {
      type: String,
      required: true
    },

    focused: {
      type: Boolean,
      default: false,
      required: true
    },

    label: String,
    icon: String
  },

  computed: {
    
  }
}
</script>

🔧 Option

{
  "vue/new-line-between-multi-line-property": ["error", {
    "minLineOfMultilineProperty": 2
  }]
}
  • minLineOfMultilineProperty ... Define the minimum number of rows for a multi-line property. default 2

📚 Further Reading

🔍 Implementation