-
Notifications
You must be signed in to change notification settings - Fork 837
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(context-zone-peer-dep): fix eslint warnings #5371
base: main
Are you sure you want to change the base?
refactor(context-zone-peer-dep): fix eslint warnings #5371
Conversation
/home/runner/work/opentelemetry-js/opentelemetry-js/packages/opentelemetry-context-zone-peer-dep/src/util.ts 22:39 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any Ref open-telemetry#5365
* @param obj - The object to check. | ||
*/ | ||
export function isListenerObject(obj: any = {}): boolean { |
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.
The parameter default seems pointless as that will just always return false
. Removed it since this is a private utility not a public export.
typeof obj.addEventListener === 'function' && | ||
'removeEventListener' in obj && | ||
typeof obj.removeEventListener === 'function' |
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.
There are alternatives without changing the runtime code (which can impose a small runtime cost), but this seemed the most straightforward/clear, and doesn't seem like the micro performance cost should matter all that much.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5371 +/- ##
=======================================
Coverage 94.54% 94.54%
=======================================
Files 318 318
Lines 8052 8052
Branches 1694 1694
=======================================
Hits 7613 7613
Misses 439 439 |
Which problem is this PR solving?
Fixed this eslint warning:
Ref #5365
Short description of the changes
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: