-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
base: develop
Are you sure you want to change the base?
feat: Avoid usage of any
#17041
Conversation
size-limit report 📦
|
@@ -380,7 +382,11 @@ function instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder: PostgRESTFilte | |||
} | |||
|
|||
if (Object.keys(body).length) { | |||
attributes['db.body'] = body; | |||
try { | |||
attributes['db.body'] = JSON.stringify(body); |
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.
q: Did this get stringified anyway before or why are we doing it now?
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.
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 |
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.
Could we use unknown here?
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.
this sadly does not work, there are some incompatibilites with function arguments and unknown, sometimes...
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.
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.