Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae4e523

Browse files
committed
doc
1 parent 286e7ae commit ae4e523

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/eslint-plugin/docs/rules/no-unnecessary-type-parameters.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ declare function createStateHistory<T>(): Set<T>;
8585
This is because the type parameter `T` relates multiple methods in the `Set<T>` together, making it used more than once.
8686

8787
Therefore, this rule won't report on type parameters used as a type argument.
88-
That includes type arguments given to global types such as `Map` and `Set`, whereas `readonly T[]`, `T[]`, `ReadonlyArray`, `Array` and tuples are special cases that are reported on:
88+
This includes type arguments provided to global types such as `Map` and `Set`, whereas `readonly T[]`, `T[]`, `ReadonlyArray`, `Array`, and tuples are special cases that are specifically reported on when used as input types.
8989

9090
```ts
91-
declare function createStateHistory<T>(): Array<T>;
91+
declare function length<T>(array: ReadonlyArray<T>): number;
9292
```
9393

94-
In such case an error will be reported because `T` is used only once as type argument for the `Array` global type.
94+
In such case an error will be reported because `T` is used only once as type argument for the `ReadonlyArray` global type.
9595

9696
## FAQ
9797

0 commit comments

Comments
 (0)