-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Abort Controller] Update linting and fix linting errors #11269
Changes from 1 commit
8c8ce80
2e254d5
a779bf7
1661829
2e064fe
aa839c2
a0a847e
6b853dd
3a98df7
e1b6a12
fb4b659
e25024e
e4337b5
9b69013
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ export class AbortController { | |
constructor(parentSignals?: AbortSignalLike[]); | ||
constructor(...parentSignals: AbortSignalLike[]); | ||
abort(): void; | ||
readonly signal: AbortSignal; | ||
get signal(): AbortSignal; | ||
static timeout(ms: number): AbortSignal; | ||
} | ||
|
||
|
@@ -21,10 +21,11 @@ export class AbortError extends Error { | |
// @public | ||
export class AbortSignal implements AbortSignalLike { | ||
constructor(); | ||
readonly aborted: boolean; | ||
get aborted(): boolean; | ||
addEventListener(_type: "abort", listener: (this: AbortSignalLike, ev: any) => any): void; | ||
static readonly none: AbortSignal; | ||
onabort?: (ev?: Event) => any; | ||
dispatchEvent(_event: Event): boolean; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other four changes seem reasonable if weird, but here |
||
static get none(): AbortSignal; | ||
onabort: ((ev?: Event) => any) | null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did we change an undefined to null? The change in this signature doesn't seem compatible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also seems like the forward-declaration of |
||
removeEventListener(_type: "abort", listener: (this: AbortSignalLike, ev: any) => any): void; | ||
} | ||
|
||
|
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.
We typically downlevel TypeScript
get
accessor signatures toreadonly
properties. Was that something we were doing on the older types file that didn't get carried in?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 didn't realize this was an accessor before, yes we should use
downlevel-dts
here if soThere 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.
@willmtemple and @xirzec
So to be clear, we should not ship a
get
accessor at all? if so, why?If not, would #11319 take care of this?
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 prefer to avoid them since:
There are times where for compat purposes we can't avoid them (and maybe this is one of those times) but for new code I'd like to steer away from using getters.
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 turned off
extract-api
again. We already have an issue opened for it: #10320.