# unicorn/prefer-string-trim-start-end

> Require `trimStart()` and `trimEnd()` instead of `trimLeft()` and `trimRight()`

`trimLeft()` and `trimRight()` are old aliases for `trimStart()` and `trimEnd()`. The names are also wrong for text written from right to left, where the start of the string is on the right.

`--fix` renames the method.

{/* 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]
"unicorn/prefer-string-trim-start-end" = "error" # or "warn"
```

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

## Examples

Reported:

{/* bad {"count": 2} */}
```js
const command = input.trimLeft();
const line = text.trimRight();
```

Not reported:

{/* good */}
```js
const command = input.trimStart();
const line = text.trimEnd();
```
