---
url: /docs/guide/usage/linter/rules/vue/valid-define-options.md
---

### What it does

Enforce valid use of the `defineOptions` compiler macro.

### Why is this bad?

`defineOptions` is a compiler macro for `<script setup>`. It must be called
with a single object literal containing component options that are evaluable
at compile time. Misuse such as referencing locally declared variables,
declaring `props`/`emits`/`expose`/`slots`, calling without arguments, or
passing type arguments cannot be processed by the compiler.

### Examples

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

```vue
<script setup>
defineOptions(); // no options object
defineOptions({ name: "A" });
defineOptions({ name: "B" }); // multiple calls
defineOptions({ props: { msg: String } }); // use `defineProps()` instead
</script>
```

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

```vue
<script setup>
defineOptions({ name: "foo", inheritAttrs: false });
</script>
```

## How to use

## Version

This rule was added in v1.67.0.

## References
