# no-empty-component-block

Rule `vue/no-empty-component-block`. Disallow the `<template>` `<script>` `<style>` block to be empty

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```vue
<template></template>
<template />
<template src="" />

<script></script>
<script />
<script src="" />

<style></style>
<style />
<style src="" />
```

### Correct: the rule accepts this

```vue
<template>
  <p>foo</p>
</template>

<script>
console.log('foo')
</script>

<style>
p {
  display: inline;
}
</style>

<template src="./template.html"></template>
<template src="./template.html" />

<script src="./script.js"></script>
<script src="./script.js" />

<style src="./style.css"></style>
<style src="./style.css" />
```

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-empty-component-block": "error",
    },
  },
];
```

## Related rules

- [vue/no-duplicate-class-names](https://lintradar.dev/rules/vue/no-duplicate-class-names.md): Disallow duplication of class names in class attributes
- [vue/no-extra-parens](https://lintradar.dev/rules/vue/no-extra-parens.md): Disallow unnecessary parentheses in `<template>`
- [vue/no-duplicate-attr-inheritance](https://lintradar.dev/rules/vue/no-duplicate-attr-inheritance.md): Enforce `inheritAttrs` to be set to `false` when using `v-bind="$attrs"`
- [vue/no-literals-in-template](https://lintradar.dev/rules/vue/no-literals-in-template.md): Disallow object, array, and function literals in template
- [vue/no-deprecated-html-elements](https://lintradar.dev/rules/vue/no-deprecated-html-elements.md): Disallow using deprecated HTML elements
- [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

---

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