-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Enable noImplictThis rule
#60346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable noImplictThis rule
#60346
Conversation
| return debounced; | ||
| } | ||
|
|
||
| interface MapCacheType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to get rid of memoize because it had many this issues.
It was only used in one place, which was trivial to refactor, and this old-style code was hard to maintain (we already had a few any and TS/ESLint ignores there).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
|
|
||
| // Subsequent calls return the same value. | ||
| c.update(); | ||
| expect(c.value).toBe(firstReturnValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't test the return value of update which runOnce explicitly caches, does it? 😏 We'd need to return the symbol from update instead of storing it in a property. But I guess you also want to test this, so maybe we do both? As in store the symbol on the property but also return it from update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, fixed!
Closes #34192 (funny, it's a 4th search result for "noImplicitThis" in Google)
In #59643 (comment) I had a bug caused by
thisbeing implicitly set toany.To avoid such issues in the future, I enabled
noImplicitThisrule.