# prefer-separate-static-class

Rule `vue/prefer-separate-static-class`. Require static class names in template to be in a separate `class` attribute

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```vue
<div :class="'static-class'" />
<div :class="{ 'static-class': true, 'dynamic-class': foo }" />
<div :class="['static-class', dynamicClass]" />
```

### Correct: the rule accepts this

```vue
  <div class="static-class" />
  <div class="static-class" :class="{ 'dynamic-class': foo }" />
  <div class="static-class" :class="[dynamicClass]" />
</template>
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { vue },
    rules: {
      "vue/prefer-separate-static-class": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useVueSeparateStaticClass": "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% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |

## Related rules

- [vue/multi-word-component-names](https://lintradar.dev/rules/vue/multi-word-component-names.md): Require component names to be always multi-word
- [vue/next-tick-style](https://lintradar.dev/rules/vue/next-tick-style.md): Enforce Promise or callback style in `nextTick`
- [vue/no-import-compiler-macros](https://lintradar.dev/rules/vue/no-import-compiler-macros.md): Disallow importing Vue compiler macros
- [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-boolean-default](https://lintradar.dev/rules/vue/no-boolean-default.md): Disallow boolean defaults
- [vue/no-root-v-if](https://lintradar.dev/rules/vue/no-root-v-if.md): Disallow `v-if` directives on root element

---

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