# keyword-spacing

Rule `vue/keyword-spacing`. Enforce consistent spacing before and after keywords in `<template>`

- Source: vue
- Technologies: Vue
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 758.7K weekly downloads of presets that enable it
- Trend: +49.9% last quarter
- Rank: #1598 by reach, #815 by growth

## Linters

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

## Enable it

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

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

export default [
  {
    plugins: { vue },
    rules: {
      "vue/keyword-spacing": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |

## Related rules

- [eslint/keyword-spacing](https://lintradar.dev/rules/eslint/keyword-spacing.md): Enforce consistent spacing before and after keywords
- [vue/key-spacing](https://lintradar.dev/rules/vue/key-spacing.md): Enforce consistent spacing between keys and values in object literal properties in `<template>`
- [vue/no-restricted-syntax](https://lintradar.dev/rules/vue/no-restricted-syntax.md): Disallow specified syntax in `<template>`
- [vue/html-comment-content-spacing](https://lintradar.dev/rules/vue/html-comment-content-spacing.md): Enforce unified spacing in HTML comments
- [vue/no-restricted-v-bind](https://lintradar.dev/rules/vue/no-restricted-v-bind.md): Disallow specific argument in `v-bind`
- [vue/dot-location](https://lintradar.dev/rules/vue/dot-location.md): Enforce consistent newlines before and after dots in `<template>`

---

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