Skip to content

Commit

Permalink
Enable noUnusedImports and noUnusedVariables in Biome
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Aug 14, 2024
1 parent e9557bc commit aa33fa6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"complexity": {
"noUselessSwitchCase": "off"
},
"correctness": {
"noUnusedImports": "warn",
"noUnusedVariables": "warn"
},
"suspicious": {
"noConsoleLog": "warn"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-date-picker/src/DateInput.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
})();
Expand Down
2 changes: 1 addition & 1 deletion packages/react-date-picker/src/DateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ export default function DateInput({
);
}

function renderYear(currentMatch: string, index: number) {
function renderYear(_currentMatch: string, index: number) {
return (
<YearInput
key="year"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-date-picker/src/DateInput/MonthSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function MonthSelect({

const maxMonth = safeMin(12, maxDate && isSameYear(maxDate) && getMonthHuman(maxDate));
const minMonth = safeMax(1, minDate && isSameYear(minDate) && getMonthHuman(minDate));
const dates = [...Array(12)].map((el, index) => 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;

Expand Down
2 changes: 1 addition & 1 deletion packages/react-date-picker/src/DatePicker.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit aa33fa6

Please sign in to comment.