Conversation
size-limit report 📦
|
ead56db to
f0881c5
Compare
6b8ef0c to
142d072
Compare
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.
142d072 to
df28780
Compare
There was a problem hiding this comment.
So this is definitely a change we should make but unfortunately, most of the interface changes from core are publicly exported. Some of the keys I think would be fine but others are unfortunately used (e.g. EventHint, CustomSamplingContext, etc). So we can leave this PR open until v11. Additionally, we can extract some of the actually internal changes and merge them in now.
EDIT: I'm not sure why I approved this in August. Maybe we talked about this offline and decided it's fine at the time 🤔 I'd rather avoid this breakage though for now, given v11 isn't too far away.
| email: keyof User; | ||
| name: keyof User; |
There was a problem hiding this comment.
m: Unfortunately, I'm afraid this is a breaking change, given that previously any string value could be added here. Fully agree that we should type it as keyof User for much improved type safety though in the next major.
| // TODO: fix in v11, convert any to unknown | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| [key: string]: any; | ||
| [key: string]: unknown; |
There was a problem hiding this comment.
l: technically this is breaking, too, since we also export the type from Core as well as from @sentry/types. Given that this is internal stuff and types is deprecated and to be removed in v11 (#18256) I'm fine with doing this now.
| attachments?: Attachment[]; | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| data?: any; | ||
| data?: unknown; |
| export interface HandlerDataFetch { | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| args: any[]; | ||
| args: unknown[]; |
| level: ConsoleLevel; | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| args: any[]; | ||
| args: unknown[]; |
| // TODO: fix in v11, convert any to unknown | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| [key: string]: any; | ||
| [key: string]: unknown; |
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.