# no-useless-concat

> Disallow joining two string literals with `+` on the same line

`"a" + "b"` is a longer way to write `"ab"`. Two literals next to each other are usually left over after someone removed a variable between them.

Both plain strings and template literals count. Strings on different lines are allowed, because that's a common way to break a long string.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"no-useless-concat" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad {"count": 2} */}
```js
const greeting = "Hello, " + "world";
const path = base + "/api" + `/users`;
```

Not reported:

{/* good */}
```js
const greeting = "Hello, world";
const path = base + "/api/users";
const label = "user " + id;

const message = "This sentence is too long for one line, " +
  "so it goes on here.";
```
