# no-required-prop-with-default

Rule `vue/no-required-prop-with-default`. Enforce props with default values to be optional

- Source: vue
- Technologies: Vue
- Kind: suspicious
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 42.4M weekly downloads of presets that enable it
- Trend: +88.4% last quarter
- Rank: #398 by reach, #390 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/no-required-prop-with-default` | yes | safe | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/no-required-prop-with-default.html) |
| Oxlint | `vue/no-required-prop-with-default` | no | safe | plugin `vue`, category suspicious | [docs](https://oxc.rs/docs/guide/usage/linter/rules/vue/no-required-prop-with-default.html) |
| Biome | `nursery/noVueRequiredPropWithDefault` | yes | unsafe | group nursery, since 2.6.0 | [docs](https://biomejs.dev/linter/rules/no-vue-required-prop-with-default/) |

## Code examples

### Incorrect: the rule reports this

```vue
<script setup lang="ts">
const props = withDefaults(
  defineProps<{
    name: string | number
    age?: number
  }>(),
  {
    name: 'Foo',
  }
);
</script>
```

### Correct: the rule accepts this

```vue
<script setup lang="ts">
const props = withDefaults(
  defineProps<{
    name?: string | number
    age?: number
  }>(),
  {
    name: 'Foo',
  }
);
</script>
```

Examples from the Oxlint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/no-required-prop-with-default": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "vue"
  ],
  "rules": {
    "vue/no-required-prop-with-default": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noVueRequiredPropWithDefault": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Vue recommended](https://lintradar.dev/presets/vue-recommended.md) | ESLint | `eslint-plugin-vue` | 118 | 9.5M | +46.6% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Nuxt](https://lintradar.dev/presets/nuxt.md) | ESLint | `@nuxt/eslint-config` | 188 | 1.5M | +72.8% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |

## Related rules

- [vue/no-multiple-slot-args](https://lintradar.dev/rules/vue/no-multiple-slot-args.md): Disallow passing multiple arguments to scoped slots
- [vue/block-order](https://lintradar.dev/rules/vue/block-order.md): Enforce order of component top-level elements
- [vue/v-slot-style](https://lintradar.dev/rules/vue/v-slot-style.md): Enforce `v-slot` directive style
- [vue/no-lone-template](https://lintradar.dev/rules/vue/no-lone-template.md): Disallow unnecessary `<template>`
- [vue/v-on-style](https://lintradar.dev/rules/vue/v-on-style.md): Enforce `v-on` directive style
- [vue/this-in-template](https://lintradar.dev/rules/vue/this-in-template.md): Disallow usage of `this` in template

---

Web page: https://lintradar.dev/rules/vue/no-required-prop-with-default. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
