Skip to content

feat: Avoid usage of any #17041

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

feat: Avoid usage of any #17041

wants to merge 3 commits into from

Conversation

mydea
Copy link
Member

@mydea mydea commented Jul 16, 2025

This makes the lint rule error, instead of warn, and gets rid of some more any usage. Some of that may technically be breaking because the types can be exposed, but this should be very unlikely to affect any users.

In a future version of eslint, this is on by default, but IMHO it makes sense for us anyhow - any should only be used when absolutely necessary and when we make a conscious choice to do so.

@mydea mydea requested review from Lms24 and AbhiPrasad July 16, 2025 13:28
@mydea mydea self-assigned this Jul 16, 2025
@mydea mydea requested review from a team as code owners July 16, 2025 13:28
Copy link
Contributor

github-actions bot commented Jul 16, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.78 kB added added
@sentry/browser - with treeshaking flags 22.34 kB added added
@sentry/browser (incl. Tracing) 39.66 kB added added
@sentry/browser (incl. Tracing, Replay) 77.77 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.57 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 82.47 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 94.59 kB added added
@sentry/browser (incl. Feedback) 40.48 kB added added
@sentry/browser (incl. sendFeedback) 28.46 kB added added
@sentry/browser (incl. FeedbackAsync) 33.35 kB added added
@sentry/react 25.54 kB added added
@sentry/react (incl. Tracing) 41.61 kB added added
@sentry/vue 28.23 kB added added
@sentry/vue (incl. Tracing) 41.44 kB added added
@sentry/svelte 23.8 kB added added
CDN Bundle 25.18 kB added added
CDN Bundle (incl. Tracing) 39.42 kB added added
CDN Bundle (incl. Tracing, Replay) 75.41 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 80.88 kB added added
CDN Bundle - uncompressed 73.44 kB added added
CDN Bundle (incl. Tracing) - uncompressed 116.86 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 230.99 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 243.8 kB added added
@sentry/nextjs (client) 43.66 kB added added
@sentry/sveltekit (client) 40.08 kB added added
@sentry/node-core 47.24 kB added added
@sentry/node 143.82 kB added added
@sentry/node - without tracing 91.31 kB added added
@sentry/aws-serverless 102.75 kB added added

@@ -380,7 +382,11 @@ function instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder: PostgRESTFilte
}

if (Object.keys(body).length) {
attributes['db.body'] = body;
try {
attributes['db.body'] = JSON.stringify(body);
Copy link
Member

Choose a reason for hiding this comment

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

q: Did this get stringified anyway before or why are we doing it now?

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure if this ever worked, but OTEL does not support complex attributes. Maybe it kind-of worked because we accept this in our transaction event, but this is the more safe/correct solution IMHO!

@@ -47,4 +47,5 @@ export interface Integration {
* An integration in function form.
* This is expected to return an integration.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Copy link
Member

Choose a reason for hiding this comment

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

Could we use unknown here?

Copy link
Member Author

Choose a reason for hiding this comment

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

this sadly does not work, there are some incompatibilites with function arguments and unknown, sometimes...

mydea added 3 commits July 18, 2025 08:39
This makes the lint rule error, instead of warn, and gets rid of some more any usage.
Some of that may technically be breaking because the types can be exposed, but this should be very unlikely to affect any users.
@mydea mydea enabled auto-merge (squash) July 18, 2025 06:39
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