-
Notifications
You must be signed in to change notification settings - Fork 253
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
Refactor @bugsnag/plugin-client-ip #2260
Refactor @bugsnag/plugin-client-ip #2260
Conversation
*/ | ||
const plugin: Plugin = { | ||
load: client => { | ||
// @ts-expect-error _config is private API |
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 extend the Plugin
interface here to get rid of these instances of ts-expect-error?
c391bf4
to
0059f4f
Compare
/* | ||
* Prevent collection of user IPs | ||
*/ | ||
const plugin: Plugin = { |
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.
you can also change this to
interface ExtendedPlugin extends Plugin {
configSchema: Record<string, ValidationOption>
}
interface ValidationOption {
validate: (value: unknown) => boolean
defaultValue: () => unknown
message: string
}
to remove the need for the second @ts-expect-error
* refactor @bugsnag/plugin-client-ip * fix rollup config * update with internal client * update extended plugin interface * fix value type to unknown
Goal
Convert source code to TypeScript and export both es modules and common js modules
Testing
Covered by existing test suite