From 37d2b68a67dd837cacbe67d203c1ced6aff26e36 Mon Sep 17 00:00:00 2001 From: rozetko Date: Fri, 5 Apr 2024 16:05:39 +0300 Subject: [PATCH] linter fixes --- src/components/editors/ThresholdsEditor.tsx | 8 +++++++- src/components/editors/UseMetricEditor.tsx | 4 +++- src/utils.ts | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/editors/ThresholdsEditor.tsx b/src/components/editors/ThresholdsEditor.tsx index ea6b11a..54ae452 100644 --- a/src/components/editors/ThresholdsEditor.tsx +++ b/src/components/editors/ThresholdsEditor.tsx @@ -115,7 +115,13 @@ export function ThresholdsEditor({ onChange, value, context }: StandardEditorPro placeholder="value" width={24} value={threshold.value} - onChange={(evt) => onThresholdFieldChange(thresholdIdx, 'value', isNumber(evt.currentTarget.value) ? +evt.currentTarget.value : undefined)} + onChange={(evt) => + onThresholdFieldChange( + thresholdIdx, + 'value', + isNumber(evt.currentTarget.value) ? +evt.currentTarget.value : undefined + ) + } /> )} diff --git a/src/components/editors/UseMetricEditor.tsx b/src/components/editors/UseMetricEditor.tsx index 8d51fa8..c251402 100644 --- a/src/components/editors/UseMetricEditor.tsx +++ b/src/components/editors/UseMetricEditor.tsx @@ -50,7 +50,9 @@ export function UseMetricEditor({ onChange, value, context }: StandardEditorProp placeholder="value" value={config?.value} width={24} - onChange={(evt) => onFieldChange('value', isNumber(evt.currentTarget.value) ? +evt.currentTarget.value : undefined)} + onChange={(evt) => + onFieldChange('value', isNumber(evt.currentTarget.value) ? +evt.currentTarget.value : undefined) + } /> )} diff --git a/src/utils.ts b/src/utils.ts index eda0983..5ec77f2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -26,7 +26,7 @@ export function getLastMetricValue( metricName: string | undefined, optionName: string ): number | null { - if(metricName === undefined) { + if (metricName === undefined) { return null; } // optionName -> helper in Error, mb use option path instead