forked from open-telemetry/opentelemetry-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(instrumentation-http): fix eslint warnings
Fix the following eslint warnings: ``` /home/runner/work/opentelemetry-js/opentelemetry-js/experimental/packages/opentelemetry-instrumentation-http/src/http.ts 508:17 warning Forbidden non-null assertion @typescript-eslint/no-non-null-assertion 931:11 warning Forbidden non-null assertion @typescript-eslint/no-non-null-assertion 1032:13 warning Forbidden non-null assertion @typescript-eslint/no-non-null-assertion 1043:13 warning Forbidden non-null assertion @typescript-eslint/no-non-null-assertion ``` Because the expression we check is indirected through the a method call (`getConfig()`), TypeScript cannot assume the value would be the same across the two calls. By extracting the value and checking for that, TypeScript can narrow the type correctly and we can avoid the non-null assertion. Ref open-telemetry#5365
- Loading branch information
1 parent
732bf01
commit de724a6
Showing
1 changed file
with
30 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters