# @typescript-eslint/no-unnecessary-type-arguments

> Disallow a type argument that is the same as the default of its type parameter

A type parameter can have a default, like `<T = string>`. Passing that same type yourself doesn't change anything.

Only the last type argument is checked, because you can't leave out the earlier ones while it's there.

`--fix` removes the type argument.

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

## Configure

Off by default. This rule needs types, so turning it on makes `bun lint` type check your code first.

```toml bunfig.toml
[lint.rules]
"@typescript-eslint/no-unnecessary-type-arguments" = "error" # or "warn"
```

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

## Examples

Reported:

{/* bad {"count": 3} */}
```ts
class Store<Value = string> {
  items: Value[] = [];
}

const labels: Store<string> = new Store<string>();

class TagStore extends Store<string> {}
```

Not reported:

{/* good */}
```ts
class Store<Value = string> {
  items: Value[] = [];
}

const labels: Store = new Store();
const counts = new Store<number>();

class TagStore extends Store {}
```

With several type parameters, the first argument stays if the last one differs from its default:

{/* good */}
```ts
interface Result<Data = unknown, Failure = Error> {
  data?: Data;
  failure?: Failure;
}

let result: Result<unknown, string>;
```
