---
url: /docs/guide/usage/linter/rules/vue/require-default-prop.md
---

### What it does

Requires default value to be set for props that are not marked as
`required`.

### Why is this bad?

A prop that is neither required nor given a default is implicitly
`undefined` when omitted. Forcing a default keeps the component's
behavior explicit and avoids `undefined` leaking into the template and
logic. `Boolean` props are exempt because they already default to
`false`.

### Examples

Examples of **incorrect** code for this rule:

```vue
<script>
export default {
  props: {
    name: String,
  },
};
</script>
```

Examples of **correct** code for this rule:

```vue
<script>
export default {
  props: {
    name: {
      type: String,
      default: "",
    },
  },
};
</script>
```

## How to use

## Version

This rule was added in v1.70.0.

## References
