@gitlab/eslint-plugin
Version:
GitLab package for our custom eslint rules
40 lines (28 loc) • 689 B
Markdown
Ensure required key is explicitly set for Vue props.
When writing prop declaration one should make an explicit decision whether the prop is required or not.
Having this key consistently set reduces cognitive load when reading prop declarations.
```js
props: {
foo: {
type: String,
}
}
```
```js
props: {
foo: {
type: String,
required: false,
default: 'bar'
}
}
```
Nothing
This rule is purely for readability.
Vue marks props as `required: false` if this option is not set.