-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ref: Remove some unnecessary conditions #14698
Conversation
@@ -179,7 +179,7 @@ export function applyDebugIds(event: Event, stackParser: StackParser): void { | |||
event!.exception!.values!.forEach(exception => { | |||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | |||
exception.stacktrace!.frames!.forEach(frame => { | |||
if (filenameDebugIdMap && frame.filename) { | |||
if (frame.filename) { |
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.
all of this is try-catched anyhow.
throw new Error('Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.'); | ||
} | ||
|
||
async function monitoredCallback(): Promise<void> { | ||
const monitoredCallback = async (): Promise<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.
@AbhiPrasad (I think you worked on this initially) is it important that this is not an arrow function? Without this, it complains about stuff being mutateable as this is hoisted, I guess.
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.
arrow function should be fine, it shouldn't rely on the this
context.
size-limit report 📦
|
d5ec64c
to
1713ea7
Compare
throw new Error('Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.'); | ||
} | ||
|
||
async function monitoredCallback(): Promise<void> { | ||
const monitoredCallback = async (): Promise<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.
arrow function should be fine, it shouldn't rely on the this
context.
I was playing around with finally enabling the no-unnecessary-condition eslint rule, and figured to start fixing some of the stuff it found. These should mostly be straightforward things, or in some cases I adjusted tests to ensure we "correctly" check for stuff.