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-date-picker/src/DateInput.spec.tsx b/packages/react-date-picker/src/DateInput.spec.tsx index 126acd99..1030b34a 100644 --- a/packages/react-date-picker/src/DateInput.spec.tsx +++ b/packages/react-date-picker/src/DateInput.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-date-picker/src/DateInput.tsx b/packages/react-date-picker/src/DateInput.tsx index cf2e11c1..c21fcdf8 100644 --- a/packages/react-date-picker/src/DateInput.tsx +++ b/packages/react-date-picker/src/DateInput.tsx @@ -619,7 +619,7 @@ export default function DateInput({ ); } - function renderYear(currentMatch: string, index: number) { + function renderYear(_currentMatch: string, index: number) { return ( new Date(2019, index, 1)); + const dates = [...Array(12)].map((_el, index) => new Date(2019, index, 1)); const name = 'month'; const formatter = short ? formatShortMonth : formatMonth; diff --git a/packages/react-date-picker/src/DatePicker.spec.tsx b/packages/react-date-picker/src/DatePicker.spec.tsx index 2a83ac0b..e500611a 100644 --- a/packages/react-date-picker/src/DatePicker.spec.tsx +++ b/packages/react-date-picker/src/DatePicker.spec.tsx @@ -12,7 +12,7 @@ async function waitForElementToBeRemovedOrHidden(callback: () => HTMLElement | n await waitFor(() => expect(element).toHaveAttribute('class', expect.stringContaining('--closed')), ); - } catch (error) { + } catch { await waitForElementToBeRemoved(element); } }