# max-len

Rule `vue/max-len`. Enforce a maximum line length in `.vue` files

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```vue
  <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div>
  <div>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
  </div>
</template>

<script>
/* ✓ GOOD */
var foo = {
  "bar": "This is a bar.",
  "baz": { "qux": "This is a qux" },
  "easier": "to read"
};

/* ✗ BAD */
var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" };
</script>

<style>
/* ignore */
.ignore-stylesheet .blocks-other-than-script-and-template-are-ignored .this-line-has-a-length-of-100
{}
</style>
```

```vue
  <div>line length is 50 .................. </div>
</template>

<script>
/* ✓ GOOD */
var foo = ['line', 'length', 'is', '40']

/* ✗ BAD */
var foo = ['line', 'length', 'is', '50', '......']
</script>
```

```vue
  <div>line length is 121 ........................................................................................ </div>
</template>

<script>
/* ✗ BAD */
var foo = ['line', 'length', 'is', '81', '......', '......', '......', '......'];
</script>
```

### Correct: the rule accepts this

```vue
<div>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit,
  sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
```

```vue
<div>line length is 40 ........ </div>
```

```vue
<div>line length is 120 ....................................................................................... </div>
```

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

## Related rules

- [eslint/max-len](https://lintradar.dev/rules/eslint/max-len.md): Enforce a maximum line length
- [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/max-lines-per-block](https://lintradar.dev/rules/vue/max-lines-per-block.md): Enforce maximum number of lines in Vue SFC blocks
- [vue/html-comment-indent](https://lintradar.dev/rules/vue/html-comment-indent.md): Enforce consistent indentation in HTML comments
- [vue/max-template-depth](https://lintradar.dev/rules/vue/max-template-depth.md): Enforce maximum depth of template
- [vue/html-comment-content-newline](https://lintradar.dev/rules/vue/html-comment-content-newline.md): Enforce unified line break in HTML comments

---

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