Skip to content

Rule Proposal: vue/require-default-prop #122

Closed
@armano2

Description

@armano2

Please describe what the rule should do:

This rule aims to ensure that any non-required prop declaration of a component has a corresponding default value.

What category of rule is this? (place an "X" next to just one item)

[ ] Enforces code style
[x] Warns about a potential error
[ ] Suggests an alternate way of doing something
[ ] Other (please specify:)

Provide 2-3 code examples that this rule will warn about:

export default {
  props: {
     foo: {
         type: String
     }
  }
}
export default {
  props: {
     foo: {
         type: Array,
         required: false
     }
  }
}

based on conversation from: #117 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions