Skip to content

Commit

Permalink
Fix linting warnings for Function, Boolean and String types (jaegertr…
Browse files Browse the repository at this point in the history
…acing#1916)

## Which problem is this PR solving?
- Resolves part of no-unused-vars warnings for jaegertracing#1608 

## Description of the changes
-  Fixed ESlint warnings for Function, Boolean and String types

## How was this change tested?
- By running "yarn lint" command

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`
  • Loading branch information
DerenToy committed Oct 28, 2023
1 parent 2cad413 commit 6174590
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ export class OperationTableDetails extends React.PureComponent<TProps, TState> {
error={error.opsLatencies}
/>
<div className="table-graph-avg">
{typeof value === 'number' && row.dataPoints.service_operation_latencies.length > 0
? formatTimeValue(value * 1000)
: ''}
{row.dataPoints.service_operation_latencies.length > 0 ? formatTimeValue(value * 1000) : ''}
</div>
</div>
),
Expand All @@ -133,9 +131,7 @@ export class OperationTableDetails extends React.PureComponent<TProps, TState> {
error={error.opsCalls}
/>
<div className="table-graph-avg">
{typeof value === 'number' && row.dataPoints.service_operation_call_rate.length > 0
? `${formatValue(value)} req/s`
: ''}
{row.dataPoints.service_operation_call_rate.length > 0 ? `${formatValue(value)} req/s` : ''}
</div>
</div>
),
Expand All @@ -155,9 +151,7 @@ export class OperationTableDetails extends React.PureComponent<TProps, TState> {
error={error.opsErrors}
/>
<div className="table-graph-avg">
{typeof value === 'number' && row.dataPoints.service_operation_error_rate.length > 0
? `${formatValue(value * 100)}%`
: ''}
{row.dataPoints.service_operation_error_rate.length > 0 ? `${formatValue(value * 100)}%` : ''}
</div>
</div>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ export function findServerChildSpan(spans: Span[]) {
return null;
}

export const isKindClient = (span: Span): Boolean =>
export const isKindClient = (span: Span): boolean =>
span.tags.some(({ key, value }) => key === 'span.kind' && value === 'client');

export const isKindProducer = (span: Span): Boolean =>
export const isKindProducer = (span: Span): boolean =>
span.tags.some(({ key, value }) => key === 'span.kind' && value === 'producer');

export { formatDuration } from '../../../utils/date';
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function transformTracesToPaths(
focalService: string,
focalOperation?: string
): TDdgPayload {
const dependenciesMap = new Map<String, TDdgPayloadPath>();
const dependenciesMap = new Map<string, TDdgPayloadPath>();
Object.values(traces).forEach(({ data }) => {
if (data) {
const spanMap: Map<string, Span> = new Map();
Expand Down
2 changes: 1 addition & 1 deletion packages/jaeger-ui/src/types/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export type MonitorEmptyStateConfig = {
description?: string;
button?: {
text?: string;
onClick?: Function;
onClick?: () => void;
};
info?: string;
alert?: {
Expand Down
4 changes: 2 additions & 2 deletions packages/jaeger-ui/src/utils/TreeNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class TreeNode<TValue> {
return this;
}

find(search: Function): TreeNode<TValue> | null {
find(search: (node: TreeNode<TValue>) => boolean): TreeNode<TValue> | null {
const searchFn = TreeNode.iterFunction(TreeNode.searchFunction(search));
if (searchFn(this)) {
return this;
Expand All @@ -63,7 +63,7 @@ export default class TreeNode<TValue> {
return null;
}

getPath(search: Function) {
getPath(search: (node: TreeNode<TValue>) => boolean) {
const searchFn = TreeNode.iterFunction(TreeNode.searchFunction(search));

const findPath = (
Expand Down

0 comments on commit 6174590

Please sign in to comment.