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

Fix linting warnings for Function, Boolean and String types #1916

Merged
merged 2 commits into from
Oct 28, 2023

Conversation

DerenToy
Copy link
Contributor

Which problem is this PR solving?

Description of the changes

  • Fixed ESlint warnings for Function, Boolean and String types

How was this change tested?

  • By running "yarn lint" command

Checklist

Signed-off-by: deren.toy <derentoy@gmail.com>
@DerenToy DerenToy requested a review from a team as a code owner October 28, 2023 12:04
@DerenToy DerenToy requested review from joe-elliott and removed request for a team October 28, 2023 12:04
@codecov
Copy link

codecov bot commented Oct 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
...nitor/ServicesView/operationDetailsTable/index.tsx 100.00% <100.00%> (ø)
...components/TracePage/TraceTimelineViewer/utils.tsx 100.00% <100.00%> (ø)
...jaeger-ui/src/model/ddg/transformTracesToPaths.tsx 100.00% <100.00%> (ø)
packages/jaeger-ui/src/utils/TreeNode.tsx 100.00% <100.00%> (ø)

📢 Thoughts on this report? Let us know!.

Signed-off-by: deren.toy <derentoy@gmail.com>
{typeof value === 'number' && row.dataPoints.service_operation_latencies.length > 0
? formatTimeValue(value * 1000)
: ''}
{row.dataPoints.service_operation_latencies.length > 0 ? formatTimeValue(value * 1000) : ''}
Copy link
Member

Choose a reason for hiding this comment

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

This replacement is not completely equivalent. What would be a situation when value would not be a number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello,

In this case, the value of 'value' is 'ServiceOpsMetrics['latency']', and 'latency' is defined as a number type.

export type ServiceOpsMetrics = {
dataPoints: OpsDataPoints;
errRates: number;
impact: number;
latency: number;
name: string;
requests: number;
key: number;
};

Therefore, I thought that there is no need for additional type checking because 'value' is always of type number. Am I mistaken?

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

lgtm, except the question about the first file

@yurishkuro yurishkuro added the changelog:skip Trivial change that does not require an entry in CHANGELOG label Oct 28, 2023
@yurishkuro yurishkuro merged commit 6174590 into jaegertracing:main Oct 28, 2023
10 of 11 checks passed
@yurishkuro
Copy link
Member

Thanks!

@DerenToy
Copy link
Contributor Author

@yurishkuro 🙏🏻🙏🏻🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:skip Trivial change that does not require an entry in CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants