# component-api-style

Rule `vue/component-api-style`. Enforce component API style

- Source: vue
- Technologies: Vue
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1820 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/component-api-style` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/component-api-style.html) |
| Biome | `style/noVueOptionsApi` | no | no | group style, since 2.3.12 | [docs](https://biomejs.dev/linter/rules/no-vue-options-api/) |

## Code examples

### Incorrect: the rule reports this

```vue
<script setup>
import { ref } from 'vue'
const msg = ref('Hello World!')
</script>
```

### Correct: the rule accepts this

```vue
<script setup>
import { ref } from 'vue'
const msg = ref('Hello World!')
</script>
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { vue },
    rules: {
      "vue/component-api-style": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "noVueOptionsApi": "error"
      }
    }
  }
}
```

## Related rules

- [vue/camelcase](https://lintradar.dev/rules/vue/camelcase.md): Enforce camelcase naming convention in `<template>`
- [vue/html-button-has-type](https://lintradar.dev/rules/vue/html-button-has-type.md): Disallow usage of button without an explicit type attribute
- [vue/block-lang](https://lintradar.dev/rules/vue/block-lang.md): Disallow use other than available `lang`
- [vue/match-component-file-name](https://lintradar.dev/rules/vue/match-component-file-name.md): Require component name property to match its file name
- [vue/no-console](https://lintradar.dev/rules/vue/no-console.md): Disallow the use of `console` in `<template>`
- [vue/no-constant-condition](https://lintradar.dev/rules/vue/no-constant-condition.md): Disallow constant expressions in conditions in `<template>`

---

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