Skip to content
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

Disallow clearing timers without no argument at all #1330

Merged

Conversation

Andarist
Copy link
Contributor

This aligns the signatures with the recent change in @types/node (here).

My rationale behind this change is outlined here, but in a short, I don't think those calls make any sense:

clearTimeout() // what do we clear?
clearInterval() // what do we clear?

@github-actions
Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged.

"method": {
"clearInterval": {
"overrideSignatures": [
"clearInterval(id: number | undefined): void"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overrideSignatures should be used as a last resort. Could you do the signature way as it's done below in OnErrorEventHandlerNonNull etc.?

@Andarist Andarist force-pushed the clear-timers-disallow-lack-of-arg branch 2 times, most recently from 9508d85 to c6fcd7b Compare May 15, 2022 19:40
{
"name": "id",
"optional": "false",
"overrideType": "number | undefined"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overrideType should be also a last resort, perhaps additionalTypes: ["undefined"]?

@Andarist Andarist force-pushed the clear-timers-disallow-lack-of-arg branch from c6fcd7b to 40c0e96 Compare May 15, 2022 19:45
@Andarist Andarist force-pushed the clear-timers-disallow-lack-of-arg branch from 40c0e96 to 418b048 Compare May 15, 2022 19:46
@Andarist
Copy link
Contributor Author

@saschanaz thanks for the suggestions. Sorry for a few rapid pushes - I forgot that I had to accept baselines on top of rerunning the build script and didn't know at first how I should verify my changes locally 😅 I think this build will finally pass and it comes with your suggestions applied.

@saschanaz
Copy link
Contributor

Thanks!

lgtm

@github-actions github-actions bot merged commit 9e13665 into microsoft:main May 15, 2022
@github-actions
Copy link
Contributor

Merging because @saschanaz is a code-owner of all the changes - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants