# prefer-define-options

Rule `vue/prefer-define-options`. Enforce use of `defineOptions` instead of default export

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/prefer-define-options` | no | safe | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/prefer-define-options.html) |
| Biome | `nursery/useVueDefineOptions` | yes | no | group nursery, since 2.6.4 | [docs](https://biomejs.dev/linter/rules/use-vue-define-options/) |

## Code examples

### Incorrect: the rule reports this

```vue
<script>
export default {
  name: "MyComponent",
  inheritAttrs: false,
};
</script>

<script setup>
const props = defineProps(["title"]);
</script>
```

### Correct: the rule accepts this

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

const props = defineProps(["title"]);
</script>
```

```vue
<script>
export default {
  name: "MyComponent",
};
</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/prefer-define-options": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useVueDefineOptions": "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% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [vue/no-unused-emit-declarations](https://lintradar.dev/rules/vue/no-unused-emit-declarations.md): Disallow unused emit declarations
- [vue/prefer-v-model](https://lintradar.dev/rules/vue/prefer-v-model.md): Enforce using `v-model` instead of `:prop`/`@update:prop` pair
- [vue/no-root-v-if](https://lintradar.dev/rules/vue/no-root-v-if.md): Disallow `v-if` directives on root element
- [vue/no-boolean-default](https://lintradar.dev/rules/vue/no-boolean-default.md): Disallow boolean defaults
- [vue/enforce-style-attribute](https://lintradar.dev/rules/vue/enforce-style-attribute.md): Enforce or forbid the use of the `scoped` and `module` attributes in SFC top level style tags
- [vue/no-import-compiler-macros](https://lintradar.dev/rules/vue/no-import-compiler-macros.md): Disallow importing Vue compiler macros

---

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