File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
Filter options
packages/eslint-plugin/src/rules Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
Original file line number Diff line number Diff line change @@ -118,7 +118,6 @@ function collectTypeParameterUsageCounts(
118
118
) : void {
119
119
const visitedSymbolLists = new Set < ts . Symbol [ ] > ( ) ;
120
120
const type = checker . getTypeAtLocation ( node ) ;
121
- const typeCounts = new Map < ts . Type , number > ( ) ;
122
121
const visitedConstraints = new Set < ts . TypeNode > ( ) ;
123
122
let functionLikeType = false ;
124
123
let visitedDefault = false ;
@@ -140,11 +139,7 @@ function collectTypeParameterUsageCounts(
140
139
area : IdentifierArea ,
141
140
asRepeatedType : boolean ,
142
141
) : void {
143
- // Seeing the same type > (threshold=3 ** 2) times indicates a likely
144
- // recursive type, like `T = { [P in keyof T]: T }`.
145
- // If it's not recursive, then heck, we've seen it enough times that any
146
- // referenced types have been counted enough to qualify as used.
147
- if ( ! type || incrementTypeCount ( type ) > 9 ) {
142
+ if ( ! type ) {
148
143
return ;
149
144
}
150
145
@@ -268,12 +263,6 @@ function collectTypeParameterUsageCounts(
268
263
identifierCounts . set ( id , identifierCount ) ;
269
264
}
270
265
271
- function incrementTypeCount ( type : ts . Type ) : number {
272
- const count = ( typeCounts . get ( type ) ?? 0 ) + 1 ;
273
- typeCounts . set ( type , count ) ;
274
- return count ;
275
- }
276
-
277
266
function visitSignature (
278
267
signature : ts . Signature | undefined ,
279
268
area : IdentifierArea ,
You can’t perform that action at this time.
0 commit comments