# no-useless-template-literals

Rule `unicorn/no-useless-template-literals`. Disallow useless template literal expressions.

- Source: unicorn
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 9.5M weekly downloads of presets that enable it
- Trend: +30.3% last quarter
- Rank: #1119 by reach, #1138 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/no-useless-template-literals` | no | safe | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/no-useless-template-literals.md) |

## Code examples

### Incorrect: the rule reports this

```js
const message = `${'Hello'}`;
```

```js
const message = `Hello ${'world'}!`;
```

```js
const message = `${value}`;
```

### Correct: the rule accepts this

```js
const message = 'Hello';
```

```js
const message = `Hello world!`;
```

```js
const message = String(value);
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { unicorn },
    rules: {
      "unicorn/no-useless-template-literals": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Unicorn recommended](https://lintradar.dev/presets/unicorn-recommended.md) | ESLint | `eslint-plugin-unicorn` | 340 | 9.5M | +30.3% |
| [Unicorn unopinionated](https://lintradar.dev/presets/unicorn-unopinionated.md) | ESLint | `eslint-plugin-unicorn` | 236 | 9.5M | +30.3% |

## Related rules

- [unicorn/no-invalid-argument-count](https://lintradar.dev/rules/unicorn/no-invalid-argument-count.md): Disallow calling functions and constructors with an invalid number of arguments.
- [unicorn/require-array-sort-compare](https://lintradar.dev/rules/unicorn/require-array-sort-compare.md): Require a compare function when calling `Array#sort()` or `Array#toSorted()`.
- [unicorn/consistent-compound-words](https://lintradar.dev/rules/unicorn/consistent-compound-words.md): Enforce consistent spelling of compound words in identifiers.
- [unicorn/no-this-outside-of-class](https://lintradar.dev/rules/unicorn/no-this-outside-of-class.md): Disallow `this` outside of classes.
- [unicorn/no-unreadable-for-of-expression](https://lintradar.dev/rules/unicorn/no-unreadable-for-of-expression.md): Disallow unreadable iterable expressions in `for…of` and `for await…of` loop headers.
- [unicorn/no-top-level-assignment-in-function](https://lintradar.dev/rules/unicorn/no-top-level-assignment-in-function.md): Disallow assigning to top-level variables from inside functions.

---

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