# no-restricted-static-attribute

Rule `vue/no-restricted-static-attribute`. Disallow specific attribute

- 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: #2071 by reach

## Linters

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

## Code examples

### Incorrect: the rule reports this

```vue
  <div foo="x" />
  <div bar />
</template>
```

```vue
  <div foo="bar" />
</template>
```

```vue
  <MyButton foo="x" />
</template>
```

### Correct: the rule accepts this

```vue
<div foo="foo" />
```

```vue
<CoolButton foo="x" />
```

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-static-attribute": "error",
    },
  },
];
```

## Related rules

- [vue/no-restricted-props](https://lintradar.dev/rules/vue/no-restricted-props.md): Disallow specific props
- [vue/no-static-inline-styles](https://lintradar.dev/rules/vue/no-static-inline-styles.md): Disallow static inline `style` attributes
- [vue/no-restricted-custom-event](https://lintradar.dev/rules/vue/no-restricted-custom-event.md): Disallow specific custom event
- [vue/no-undef-components](https://lintradar.dev/rules/vue/no-undef-components.md): Disallow use of undefined components in `<template>`
- [vue/no-restricted-component-names](https://lintradar.dev/rules/vue/no-restricted-component-names.md): Disallow specific component names
- [vue/no-unsupported-features](https://lintradar.dev/rules/vue/no-unsupported-features.md): Disallow unsupported Vue.js syntax on the specified version

---

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