# prefer-true-attribute-shorthand

Rule `vue/prefer-true-attribute-shorthand`. Require shorthand form attribute when `v-bind` value is `true`

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/prefer-true-attribute-shorthand` | no | suggestion | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/prefer-true-attribute-shorthand.html) |
| Biome | `nursery/useVueConsistentBooleanPropStyle` | no | unsafe | group nursery, since 2.6.5 | [docs](https://biomejs.dev/linter/rules/use-vue-consistent-boolean-prop-style/) |

## Code examples

### Incorrect: the rule reports this

```vue
<MyComponent v-bind:show="true" />
<MyComponent :show="true" />
```

```vue
<MyComponent show />
```

```vue
<MyComponent show />
<MyComponent :value="true" />
<MyComponent :foo-bar="true" />
```

### Correct: the rule accepts this

```vue
  <MyComponent show />
  <MyComponent another-prop="true" />
</template>
```

```vue
  <MyComponent :show="true" />
  <MyComponent v-bind:show="true" />
</template>
```

```vue
  <MyComponent :show="true" />
  <MyComponent value />
  <MyComponent foo-bar />
</template>
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { vue },
    rules: {
      "vue/prefer-true-attribute-shorthand": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useVueConsistentBooleanPropStyle": "error"
      }
    }
  }
}
```

## Related rules

- [vue/prefer-single-event-payload](https://lintradar.dev/rules/vue/prefer-single-event-payload.md): Enforce passing a single argument to custom event emissions
- [vue/prefer-use-template-ref](https://lintradar.dev/rules/vue/prefer-use-template-ref.md): Require using `useTemplateRef` instead of `ref`/`shallowRef` for template refs
- [vue/prefer-prop-type-boolean-first](https://lintradar.dev/rules/vue/prefer-prop-type-boolean-first.md): Enforce `Boolean` comes first in component prop types
- [vue/require-emit-validator](https://lintradar.dev/rules/vue/require-emit-validator.md): Require type definitions in emits
- [vue/no-v-text](https://lintradar.dev/rules/vue/no-v-text.md): Disallow use of v-text
- [vue/require-explicit-slots](https://lintradar.dev/rules/vue/require-explicit-slots.md): Require slots to be explicitly defined

---

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