From 6b4430f4e99a4bf11fcd00b30b9984270ac36fc2 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Wed, 14 Aug 2024 17:19:44 +0200 Subject: [PATCH] Enable noUnusedImports and noUnusedVariables in Biome --- biome.json | 4 ++++ packages/react-time-picker/src/TimeInput.spec.tsx | 2 +- packages/react-time-picker/src/TimeInput.tsx | 2 +- packages/react-time-picker/src/TimePicker.spec.tsx | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/biome.json b/biome.json index 02caffa1..c8ebc01b 100644 --- a/biome.json +++ b/biome.json @@ -12,6 +12,10 @@ "complexity": { "noUselessSwitchCase": "off" }, + "correctness": { + "noUnusedImports": "warn", + "noUnusedVariables": "warn" + }, "suspicious": { "noConsoleLog": "warn" } diff --git a/packages/react-time-picker/src/TimeInput.spec.tsx b/packages/react-time-picker/src/TimeInput.spec.tsx index 6f1d1698..bf36f6df 100644 --- a/packages/react-time-picker/src/TimeInput.spec.tsx +++ b/packages/react-time-picker/src/TimeInput.spec.tsx @@ -13,7 +13,7 @@ const hasFullICU = (() => { const date = new Date(2018, 0, 1, 21); const formatter = new Intl.DateTimeFormat('de-DE', { hour: 'numeric' }); return formatter.format(date).includes('21'); - } catch (err) { + } catch { return false; } })(); diff --git a/packages/react-time-picker/src/TimeInput.tsx b/packages/react-time-picker/src/TimeInput.tsx index fc5d08bf..4865c8d0 100644 --- a/packages/react-time-picker/src/TimeInput.tsx +++ b/packages/react-time-picker/src/TimeInput.tsx @@ -541,7 +541,7 @@ export default function TimeInput({ ); } - function renderAmPm(currentMatch: string, index: number) { + function renderAmPm(_currentMatch: string, index: number) { return ( HTMLElement | n await waitFor(() => expect(element).toHaveAttribute('class', expect.stringContaining('--closed')), ); - } catch (error) { + } catch { await waitForElementToBeRemoved(element); } }