Skip to content

Commit

Permalink
Fix new eslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnei committed Feb 26, 2025
1 parent 88441e8 commit edc6d4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/shared/TimeSeriesStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ const TimeSeriesStatistics = ({
dataResolution: dataResolution,
// Typescript complains that the method "startOf" cannot take "custom" as a parameter, but in practice
// this does not seem to be a problem
//@ts-ignore
//@ts-expect-error: timeMode should be assignable here
fromDate: moment(fromDate).startOf(timeMode).format("YYYY-MM-DD"),
//@ts-ignore
//@ts-expect-error: timeMode should be assignable here
toDate: moment(toDate).endOf(timeMode).format("YYYY-MM-DD"),
}}
onSubmit={(values) => {}}
Expand Down
5 changes: 2 additions & 3 deletions src/utils/statisticsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { ChartOptions, TooltipItem } from 'chart.js';
*/

/* creates callback function for formatting the labels of the xAxis in a statistics diagram */
function createXAxisTickCallback (
function createXAxisTickCallback(
timeMode: TimeMode,
dataResolution: DataResolution,
language: string,
Expand All @@ -36,8 +36,7 @@ function createXAxisTickCallback (
}

return function (tickValue: number | string) {
// Typescript does not like "this", but the chart.js documentation insists we should do it this way
// @ts-ignore
// @ts-expect-error: Typescript does not like "this", but the chart.js documentation insists we should do it this way
return moment(this.getLabelForValue(tickValue)).locale(language).format(formatString);
};
};
Expand Down

0 comments on commit edc6d4e

Please sign in to comment.