Skip to content

Conversation

@mydea
Copy link
Member

@mydea mydea commented Dec 13, 2024

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.

@mydea mydea requested review from AbhiPrasad, Lms24 and lforst December 13, 2024 10:07
@mydea mydea self-assigned this Dec 13, 2024
@mydea mydea requested a review from a team as a code owner December 13, 2024 10:07
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
exception.stacktrace!.frames!.forEach(frame => {
if (filenameDebugIdMap && frame.filename) {
if (frame.filename) {
Copy link
Member Author

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.

}

async function monitoredCallback(): Promise<void> {
const monitoredCallback = async (): Promise<void> => {
Copy link
Member Author

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.

Copy link
Member

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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 13, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.27 KB -0.06% -12 B 🔽
@sentry/browser - with treeshaking flags 21.94 KB -0.07% -15 B 🔽
@sentry/browser (incl. Tracing) 35.79 KB -0.03% -9 B 🔽
@sentry/browser (incl. Tracing, Replay) 73 KB -0.02% -8 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 63.4 KB -0.02% -12 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 77.31 KB -0.02% -8 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 89.8 KB -0.01% -9 B 🔽
@sentry/browser (incl. Feedback) 40.02 KB -0.03% -12 B 🔽
@sentry/browser (incl. sendFeedback) 27.88 KB -0.04% -11 B 🔽
@sentry/browser (incl. FeedbackAsync) 32.67 KB -0.05% -14 B 🔽
@sentry/react 25.95 KB -0.05% -11 B 🔽
@sentry/react (incl. Tracing) 38.59 KB -0.03% -10 B 🔽
@sentry/vue 27.48 KB -0.05% -12 B 🔽
@sentry/vue (incl. Tracing) 37.62 KB -0.03% -8 B 🔽
@sentry/svelte 23.44 KB -0.05% -11 B 🔽
CDN Bundle 24.41 KB -0.06% -13 B 🔽
CDN Bundle (incl. Tracing) 37.44 KB -0.04% -13 B 🔽
CDN Bundle (incl. Tracing, Replay) 72.63 KB -0.02% -11 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 77.99 KB -0.03% -17 B 🔽
CDN Bundle - uncompressed 71.71 KB -0.05% -34 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 111.01 KB -0.03% -34 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 225.07 KB -0.02% -34 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 238.29 KB -0.02% -34 B 🔽
@sentry/nextjs (client) 38.87 KB -0.04% -12 B 🔽
@sentry/sveltekit (client) 36.28 KB -0.03% -9 B 🔽
@sentry/node 162.43 KB -0.06% -89 B 🔽
@sentry/node - without tracing 98.63 KB -0.08% -80 B 🔽
@sentry/aws-serverless 126.33 KB -0.05% -52 B 🔽

View base workflow run

@mydea mydea force-pushed the fn/remove-some-unnecessary-conditions branch from d5ec64c to 1713ea7 Compare December 13, 2024 11:55
}

async function monitoredCallback(): Promise<void> {
const monitoredCallback = async (): Promise<void> => {
Copy link
Member

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.

@mydea mydea merged commit e714e3d into develop Dec 16, 2024
158 checks passed
@mydea mydea deleted the fn/remove-some-unnecessary-conditions branch December 16, 2024 07:57
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.

2 participants