# max-lines-per-block

Rule `vue/max-lines-per-block`. Enforce maximum number of lines in Vue SFC blocks

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```vue
<template>
  <div>
    hi
  </div>
</template>
```

### Correct: the rule accepts this

```vue
<script>

  console.log(1)
</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/max-lines-per-block": "error",
    },
  },
];
```

## Related rules

- [vue/max-len](https://lintradar.dev/rules/vue/max-len.md): Enforce a maximum line length in `.vue` files
- [vue/max-template-depth](https://lintradar.dev/rules/vue/max-template-depth.md): Enforce maximum depth of template
- [vue/match-component-import-name](https://lintradar.dev/rules/vue/match-component-import-name.md): Require the registered component name to match the imported component name
- [vue/multiline-ternary](https://lintradar.dev/rules/vue/multiline-ternary.md): Enforce newlines between operands of ternary expressions in `<template>`
- [vue/html-comment-indent](https://lintradar.dev/rules/vue/html-comment-indent.md): Enforce consistent indentation in HTML comments
- [vue/new-line-between-multi-line-property](https://lintradar.dev/rules/vue/new-line-between-multi-line-property.md): Enforce new lines between multi-line properties in Vue components

---

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