# no-bare-strings-in-template

Rule `vue/no-bare-strings-in-template`. Disallow the use of bare strings in `<template>`

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```vue
  <h1>Lorem ipsum</h1>
  <div
    title="Lorem ipsum"
    aria-label="Lorem ipsum"
    aria-placeholder="Lorem ipsum"
    aria-roledescription="Lorem ipsum"
    aria-valuetext="Lorem ipsum"
  />
  <img alt="Lorem ipsum">
  <input placeholder="Lorem ipsum">
  <h1 v-text="'Lorem ipsum'" />

  <!-- Does not check -->
  <h1>{{ 'Lorem ipsum' }}</h1>
  <div
    v-bind:title="'Lorem ipsum'"
  />
</template>
```

### Correct: the rule accepts this

```vue
<h1>{{ $t('foo.bar') }}</h1>
<h1>{{ foo }}</h1>
<h1 v-t="'foo.bar'"></h1>
```

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-bare-strings-in-template": "error",
    },
  },
];
```

## Related rules

- [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
- [vue/no-custom-modifiers-on-v-model](https://lintradar.dev/rules/vue/no-custom-modifiers-on-v-model.md): Disallow custom modifiers on v-model used on the component
- [vue/multiline-ternary](https://lintradar.dev/rules/vue/multiline-ternary.md): Enforce newlines between operands of ternary expressions in `<template>`
- [vue/no-deprecated-html-elements](https://lintradar.dev/rules/vue/no-deprecated-html-elements.md): Disallow using deprecated HTML elements
- [vue/max-template-depth](https://lintradar.dev/rules/vue/max-template-depth.md): Enforce maximum depth of 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"`

---

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