# no-unnecessary-type-parameters

Rule `typescript/no-unnecessary-type-parameters`. Disallow type parameters that aren't used multiple times

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/no-unnecessary-type-parameters` | no | suggestion | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/no-unnecessary-type-parameters) |
| Oxlint | `typescript/no-unnecessary-type-parameters` | no | safe | plugin `typescript`, category suspicious | [docs](https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-parameters.html) |

## Code examples

### Incorrect: the rule reports this

```ts
function second<A, B>(a: A, b: B): B {
  return b;
}

function parseJSON<T>(input: string): T {
  return JSON.parse(input);
}

function printProperty<T, K extends keyof T>(obj: T, key: K) {
  console.log(obj[key]);
}
```

```ts
declare function length<T>(array: ReadonlyArray<T>): number;
```

### Correct: the rule accepts this

```ts
function second<B>(a: unknown, b: B): B {
  return b;
}

function parseJSON(input: string): unknown {
  return JSON.parse(input);
}

function printProperty<T>(obj: T, key: keyof T) {
  console.log(obj[key]);
}

// T appears twice: in the type of arg and as the return type
function identity<T>(arg: T): T {
  return arg;
}

// T appears twice: "keyof T" and in the inferred return type (T[K]).
// K appears twice: "key: K" and in the inferred return type (T[K]).
function getProperty<T, K extends keyof T>(obj: T, key: K) {
  return obj[key];
}
```

```ts
declare function length(array: ReadonlyArray<unknown>): number;
```

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-parameters": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "typescript/no-unnecessary-type-parameters": "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% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [typescript/no-unnecessary-type-arguments](https://lintradar.dev/rules/typescript/no-unnecessary-type-arguments.md): Disallow type arguments that are equal to the default
- [typescript/no-unnecessary-boolean-literal-compare](https://lintradar.dev/rules/typescript/no-unnecessary-boolean-literal-compare.md): Disallow unnecessary equality comparisons against boolean literals
- [typescript/no-unsafe-class-instance-assignment](https://lintradar.dev/rules/typescript/no-unsafe-class-instance-assignment.md): Disallow assigning non-instance values to class instance typed locations
- [typescript/no-generated-empty-object-type](https://lintradar.dev/rules/typescript/no-generated-empty-object-type.md): Disallow type operations that resolve to the "empty object" type
- [typescript/no-confusing-void-expression](https://lintradar.dev/rules/typescript/no-confusing-void-expression.md): Require expressions of type void to appear in statement position
- [typescript/no-unnecessary-condition](https://lintradar.dev/rules/typescript/no-unnecessary-condition.md): Disallow conditionals where the type is always truthy or always falsy

---

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