Skip to content
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

chore: Fix lint warnings in core package #2405

Merged
merged 3 commits into from
Aug 11, 2021

Conversation

alisabzevari
Copy link
Contributor

related to #1093,

Which problem is this PR solving?

  • This PR fixes lint warnings in core package.

Short description of the changes

  • Fix lint warnings

@alisabzevari alisabzevari requested a review from a team August 8, 2021 18:13
@alisabzevari alisabzevari changed the title chore(core): fix lint warnings Fix lint warnings in core package Aug 8, 2021
@codecov
Copy link

codecov bot commented Aug 8, 2021

Codecov Report

Merging #2405 (4b3363d) into main (eb3cd50) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 4b3363d differs from pull request most recent head 0f5f47c. Consider uploading reports for the commit 0f5f47c to get more accurate results

@@            Coverage Diff             @@
##             main    #2405      +/-   ##
==========================================
- Coverage   92.64%   92.64%   -0.01%     
==========================================
  Files         137      137              
  Lines        4974     4973       -1     
  Branches     1047     1047              
==========================================
- Hits         4608     4607       -1     
  Misses        366      366              
Impacted Files Coverage Δ
...ckages/opentelemetry-core/src/common/attributes.ts 97.29% <ø> (ø)
...e/src/baggage/propagation/HttpBaggagePropagator.ts 96.96% <100.00%> (ø)
packages/opentelemetry-core/src/baggage/utils.ts 73.33% <100.00%> (-0.87%) ⬇️
...ntelemetry-core/src/common/global-error-handler.ts 100.00% <100.00%> (ø)
packages/opentelemetry-core/src/common/time.ts 95.38% <100.00%> (ø)
...es/opentelemetry-core/src/propagation/composite.ts 100.00% <100.00%> (ø)
...metry-core/src/trace/HttpTraceContextPropagator.ts 100.00% <100.00%> (ø)
packages/opentelemetry-core/src/utils/wrap.ts 100.00% <100.00%> (ø)

Copy link
Member

@rauno56 rauno56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imho such contributions are invaluable, thanks!

One question though: Any specific reason to replace const function declarations with function statements?

@alisabzevari
Copy link
Contributor Author

Any specific reason to replace const function declarations with function statements?

No, I just saw using function notation in the majority of the code in other files. I just did it to be consistent with the rest of the codebase.

@@ -129,6 +130,7 @@ export function hrTimeToTimeStamp(hrTime: api.HrTime): string {
* Convert hrTime to nanoseconds.
* @param hrTime
*/
// eslint-disable-next-line @typescript-eslint/no-shadow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the no-shadow error should be rather fixed then ignored, in most cases this should be an easy fix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have answered this in another comment as well. I couldn't find a better name for the parameter and thought the name of the parameter should be meaningful for users who don't use types.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be fine with just using time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name is only ever likely to show up in intellisense and generated docs. In both cases it woudl be alongside its type which is clearly named.

@dyladan dyladan changed the title Fix lint warnings in core package chore: Fix lint warnings in core package Aug 10, 2021
@dyladan
Copy link
Member

dyladan commented Aug 10, 2021

I updated the PR title. Please in the future use conventional commits for titles since they become the commit message when PRs are squashed.

@dyladan dyladan merged commit 4553b29 into open-telemetry:main Aug 11, 2021
@alisabzevari alisabzevari deleted the lint-warnings-core branch August 11, 2021 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants