# no-unnecessary-type-conversion

Rule `typescript/no-unnecessary-type-conversion`. Disallow conversion idioms when they do not change the type or value of the expression

- Source: typescript
- Technologies: TypeScript
- Kind: suspicious
- Needs type information: yes
- Autofix: yes, in at least one linter
- Reach: 46.6M weekly downloads of presets that enable it
- Trend: +31.9% last quarter
- Rank: #280 by reach, #1106 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/no-unnecessary-type-conversion` | no | suggestion | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/no-unnecessary-type-conversion) |
| Oxlint | `typescript/no-unnecessary-type-conversion` | no | safe | plugin `typescript`, category suspicious | [docs](https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-conversion.html) |
| Biome | `nursery/noUselessTypeConversion` | no | no | group nursery, since 2.4.11 | [docs](https://biomejs.dev/linter/rules/no-useless-type-conversion/) |

## Code examples

### Incorrect: the rule reports this

```ts
String('123');
'123'.toString();
'' + '123';
'123' + '';

Number(123);
+123;
~~123;

Boolean(true);
!!true;

BigInt(BigInt(1));

let str = '123';
str += '';
```

### Correct: the rule accepts this

```ts
function foo(bar: string | number) {
  String(bar);
  bar.toString();
  '' + bar;
  bar + '';

  Number(bar);
  +bar;
  ~~bar;

  Boolean(bar);
  !!bar;

  BigInt(1);

  bar += '';
}
```

Examples from the ESLint documentation.

## Enable it

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

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/no-unnecessary-type-conversion": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "typescript/no-unnecessary-type-conversion": "error"
  }
}
```

### Biome: `biome.json`

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [typescript-eslint strict type-checked](https://lintradar.dev/presets/typescript-eslint-strict-type-checked.md) | ESLint | `@typescript-eslint/eslint-plugin` | 75 | 175.9M | +29.5% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [typescript/no-deprecated](https://lintradar.dev/rules/typescript/no-deprecated.md): Disallow using code marked as `@deprecated`
- [typescript/ban-tslint-comment](https://lintradar.dev/rules/typescript/ban-tslint-comment.md): Disallow `// tslint:<rule-flag>` comments
- [typescript/consistent-indexed-object-style](https://lintradar.dev/rules/typescript/consistent-indexed-object-style.md): Require or disallow the `Record` type
- [typescript/consistent-generic-constructors](https://lintradar.dev/rules/typescript/consistent-generic-constructors.md): Enforce specifying generic type arguments on type annotation or constructor name of a constructor call
- [typescript/no-unsafe-member-access](https://lintradar.dev/rules/typescript/no-unsafe-member-access.md): Disallow member access on a value with type `any`
- [typescript/no-confusing-non-null-assertion](https://lintradar.dev/rules/typescript/no-confusing-non-null-assertion.md): Disallow non-null assertion in locations that may be confusing

---

Web page: https://lintradar.dev/rules/typescript/no-unnecessary-type-conversion. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
