Update lint rules

This commit is contained in:
schroda
2026-03-11 00:11:29 +01:00
parent 5dda4304d9
commit 72af9d52d1
377 changed files with 1132 additions and 1048 deletions

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { Theme } from '@mui/material/styles';
import type { Theme } from '@mui/material/styles';
// use CSSObject instead of SxProps<Theme> because this completely fucks over typescript by causing an out of memory error during compilation
type CSSObject = ReturnType<Theme['applyStyles']>;

View File

@@ -6,7 +6,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import dayjs, { Dayjs } from 'dayjs';
import type { Dayjs } from 'dayjs';
import dayjs from 'dayjs';
import { t } from '@lingui/core/macro';
export const timeFormatter = new Intl.DateTimeFormat(navigator.language, { hour: '2-digit', minute: '2-digit' });

View File

@@ -6,10 +6,11 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { MessageDescriptor } from '@lingui/core';
import type { MessageDescriptor } from '@lingui/core';
import { msg, t } from '@lingui/core/macro';
import { getISOLanguage, getPreferredISOLanguageCodes, LanguageObject } from '@/lib/ISOLanguageUtil.ts';
import type { LanguageObject } from '@/lib/ISOLanguageUtil.ts';
import { getISOLanguage, getPreferredISOLanguageCodes } from '@/lib/ISOLanguageUtil.ts';
import { i18n } from '@/i18n';

View File

@@ -7,7 +7,7 @@
*/
import useMediaQuery from '@mui/material/useMediaQuery';
import { Breakpoint, SxProps, Theme } from '@mui/material/styles';
import type { Breakpoint, SxProps, Theme } from '@mui/material/styles';
import { useCallback, useState } from 'react';
import { getCurrentTheme } from '@/features/theme/services/ThemeCreator.ts';
import { useResizeObserver } from '@/base/hooks/useResizeObserver.tsx';

View File

@@ -11,7 +11,7 @@ export const baseCleanup = (str: string) => str.toLowerCase().trim();
export const enhancedCleanup = (str: string): string =>
baseCleanup(str)
.normalize('NFKC')
.replace(/[^\p{L}\p{N}]+/gu, ' ')
.replaceAll(/[^\p{L}\p{N}]+/gu, ' ')
.trim();
export const reverseString = (str: string, separator: string = ''): string =>

View File

@@ -6,7 +6,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { enqueueSnackbar, OptionsObject, SnackbarKey } from 'notistack';
import type { OptionsObject, SnackbarKey } from 'notistack';
import { enqueueSnackbar } from 'notistack';
export function makeToast(message: string, severity?: OptionsObject['variant'], description?: string): SnackbarKey;
export function makeToast(message: string, options?: OptionsObject, description?: string): SnackbarKey;

View File

@@ -7,5 +7,5 @@
*/
export function cloneObject<T extends object>(obj: T) {
return JSON.parse(JSON.stringify(obj)) as T;
return structuredClone(obj);
}