Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(otlp-exporter-base): fix eslint warnigns
Fix the following eslint warnings: ``` /home/runner/work/opentelemetry-js/opentelemetry-js/experimental/packages/otlp-exporter-base/src/transport/http-exporter-transport.ts 55:9 warning Forbidden non-null assertion @typescript-eslint/no-non-null-assertion /home/runner/work/opentelemetry-js/opentelemetry-js/experimental/packages/otlp-exporter-base/src/transport/http-transport-utils.ts 95:35 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any ``` The first was that we know we already checked and initialized a related variable, but TypeScript has no idea they are related. We can better communicate that, both to TypeScript and to humans, by groupping the related variables into a single one, that is either set or not. The second was a little strange, and I don't really see what the `any` is doing there. `res.on('end')` is already typed to have an `Error` type on the callback argument (maybe that wasn't always the case?). If we trust the type, then there is nothing more we need to do. If we don't trust the type, widening it to `any` without other runtime checks isn't going to do anything for us either. So I just removed it and everything was still fine. Ref open-telemetry#5365
- Loading branch information