-
Notifications
You must be signed in to change notification settings - Fork 842
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(resources): fix eslint warning #5383
base: main
Are you sure you want to change the base?
Conversation
``` /home/runner/work/opentelemetry-js/opentelemetry-js/packages/opentelemetry-resources/src/utils.ts 17:39 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any ``` Ref open-telemetry#5365
val !== null && typeof val === 'object' && typeof val.then === 'function' | ||
val !== null && | ||
typeof val === 'object' && | ||
typeof (val as Partial<PromiseLike<R>>).then === '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.
Adding 'then' in val
to the existing chain would also work (instead of doing the cast), and sometimes I prefer that for readability. However that does impose a tiny bit of additional runtime cost so I avoided it 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.
@david-luna resolved
For context: #5350 landed a similar fix so this PR isn't strictly necessary anymore, if the only goal is to get rid of the any
(which #5350 did). This is slightly more precise and matches the intention of the code better.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5383 +/- ##
=======================================
Coverage 94.79% 94.79%
=======================================
Files 310 310
Lines 7969 7969
Branches 1679 1679
=======================================
Hits 7554 7554
Misses 415 415
|
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.
@chancancode could you please resolve the conflict? Thanks
Which problem is this PR solving?
Fix the following eslint warning in the resources package:
Ref #5365
Short description of the changes
Use
unknown
instead.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: