# no-restricted-class

Rule `vue/no-restricted-class`. Disallow specific classes in Vue components

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/no-restricted-class` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/no-restricted-class.html) |

## Code examples

### Incorrect: the rule reports this

```vue
<div class="forbidden" />
<div :class="{ forbidden: someBoolean }" />
<div :class="`forbidden ${someString}`" />
<div :class="'forbidden'" />
<div :class="'forbidden ' + someString" />
<div :class="[someString, 'forbidden']" />
```

### Correct: the rule accepts this

```vue
  <div class="allowed-class" />
</template>

<script>
export default {
  props: {
    someBoolean: Boolean,
    someString: String,
  }
}
</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/no-restricted-class": "error",
    },
  },
];
```

## Related rules

- [vue/no-restricted-block](https://lintradar.dev/rules/vue/no-restricted-block.md): Disallow specific block
- [vue/no-restricted-component-names](https://lintradar.dev/rules/vue/no-restricted-component-names.md): Disallow specific component names
- [vue/no-props-shadow](https://lintradar.dev/rules/vue/no-props-shadow.md): Disallow declarations that shadow props in `<script setup>`
- [vue/no-restricted-custom-event](https://lintradar.dev/rules/vue/no-restricted-custom-event.md): Disallow specific custom event
- [vue/no-potential-component-option-typo](https://lintradar.dev/rules/vue/no-potential-component-option-typo.md): Disallow a potential typo in your component property
- [vue/no-restricted-props](https://lintradar.dev/rules/vue/no-restricted-props.md): Disallow specific props

---

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