# require-emit-validator

Rule `vue/require-emit-validator`. Require type definitions in emits

- Source: vue
- Technologies: Vue
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1848 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/require-emit-validator` | no | suggestion | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/require-emit-validator.html) |
| Biome | `nursery/useVueEmitValidator` | no | unsafe | group nursery, since 2.6.5 | [docs](https://biomejs.dev/linter/rules/use-vue-emit-validator/) |

## Code examples

### Incorrect: the rule reports this

```vue
<script>
export default {
  emits: ["change"],
};
</script>
```

```vue
<script setup>
defineEmits({
  change: null,
});
</script>
```

### Correct: the rule accepts this

```vue
<script>
import { isNumber } from "./validators";

export default {
  emits: {
    change: (id) => typeof id === "number",
    close: () => true,
    select: isNumber,
  },
};
</script>
```

```vue
<script setup lang="ts">
defineEmits<{ change: [id: number] }>();
</script>
```

Examples from the Biome documentation.

## Enable it

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

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

export default [
  {
    plugins: { vue },
    rules: {
      "vue/require-emit-validator": "error",
    },
  },
];
```

### Biome: `biome.json`

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

## Related rules

- [vue/prefer-use-template-ref](https://lintradar.dev/rules/vue/prefer-use-template-ref.md): Require using `useTemplateRef` instead of `ref`/`shallowRef` for template refs
- [vue/require-explicit-slots](https://lintradar.dev/rules/vue/require-explicit-slots.md): Require slots to be explicitly defined
- [vue/prefer-true-attribute-shorthand](https://lintradar.dev/rules/vue/prefer-true-attribute-shorthand.md): Require shorthand form attribute when `v-bind` value is `true`
- [vue/require-macro-variable-name](https://lintradar.dev/rules/vue/require-macro-variable-name.md): Require a certain macro variable name
- [vue/prefer-single-event-payload](https://lintradar.dev/rules/vue/prefer-single-event-payload.md): Enforce passing a single argument to custom event emissions
- [vue/require-typed-object-prop](https://lintradar.dev/rules/vue/require-typed-object-prop.md): Enforce adding type declarations to object props

---

Web page: https://lintradar.dev/rules/vue/require-emit-validator. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
