# max-attributes-per-line

Rule `vue/max-attributes-per-line`. Enforce the maximum number of attributes per line

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```vue
  <MyComponent lorem="1" ipsum="2"/>
  <MyComponent
    lorem="1" ipsum="2"
  />
  <MyComponent
    lorem="1" ipsum="2"
    dolor="3"
  />
</template>
```

```vue
  <MyComponent lorem="1" ipsum="2" dolor="3" sit="4" />
</template>
```

```vue
  <MyComponent
    lorem="1" ipsum="2" dolor="3"
    sit="4"
  />
</template>
```

### Correct: the rule accepts this

```vue
<MyComponent lorem="1"/>
<MyComponent
  lorem="1"
  ipsum="2"
/>
<MyComponent
  lorem="1"
  ipsum="2"
  dolor="3"
/>
```

```vue
<MyComponent lorem="1" ipsum="2" dolor="3" />
```

```vue
<MyComponent
  lorem="1" ipsum="2"
  dolor="3"
/>
```

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Vue recommended](https://lintradar.dev/presets/vue-recommended.md) | ESLint | `eslint-plugin-vue` | 118 | 9.5M | +46.6% |
| [Vue strongly recommended](https://lintradar.dev/presets/vue-strongly-recommended.md) | ESLint | `eslint-plugin-vue` | 110 | 9.5M | +46.6% |

## Related rules

- [vue/singleline-html-element-content-newline](https://lintradar.dev/rules/vue/singleline-html-element-content-newline.md): Require a line break before and after the contents of a singleline element
- [vue/no-spaces-around-equal-signs-in-attribute](https://lintradar.dev/rules/vue/no-spaces-around-equal-signs-in-attribute.md): Disallow spaces around equal signs in attribute
- [vue/no-multi-spaces](https://lintradar.dev/rules/vue/no-multi-spaces.md): Disallow multiple spaces
- [vue/mustache-interpolation-spacing](https://lintradar.dev/rules/vue/mustache-interpolation-spacing.md): Enforce unified spacing in mustache interpolations
- [vue/multiline-html-element-content-newline](https://lintradar.dev/rules/vue/multiline-html-element-content-newline.md): Require a line break before and after the contents of a multiline element
- [vue/html-quotes](https://lintradar.dev/rules/vue/html-quotes.md): Enforce quotes style of HTML attributes

---

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