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,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { TBaseTheme, themes } from '@/features/theme/Themes.ts';
import type { TBaseTheme } from '@/features/theme/Themes.ts';
import { themes } from '@/features/theme/Themes.ts';
export type AppThemes = keyof typeof themes | string;

View File

@@ -6,24 +6,18 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import {
createTheme as createMuiTheme,
Direction,
PaletteBackgroundChannel,
responsiveFontSizes,
Theme,
TypeBackground,
useTheme,
} from '@mui/material/styles';
import type { Direction, PaletteBackgroundChannel, Theme, TypeBackground } from '@mui/material/styles';
import { createTheme as createMuiTheme, responsiveFontSizes, useTheme } from '@mui/material/styles';
import { useCallback } from 'react';
// oxlint-disable-next-line no-restricted-imports
import { deepmerge } from '@mui/utils';
import { complement, hsl, parseToHsl } from 'polished';
import { HslaColor, HslColor } from 'polished/lib/types/color';
import { AppTheme } from '@/features/theme/services/AppThemes.ts';
import type { HslaColor, HslColor } from 'polished/lib/types/color';
import type { AppTheme } from '@/features/theme/services/AppThemes.ts';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import { applyStyles } from '@/base/utils/ApplyStyles.ts';
import { TAppThemeContext, ThemeMode } from '@/features/theme/AppTheme.types.ts';
import type { TAppThemeContext } from '@/features/theme/AppTheme.types.ts';
import { ThemeMode } from '@/features/theme/AppTheme.types.ts';
import { ThemeFontLoader } from '@/features/theme/services/ThemeFontLoader.ts';
import { coerceIn } from '@/lib/HelperFunctions.ts';
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';

View File

@@ -7,7 +7,7 @@
*/
import WebFont from 'webfontloader';
import { CssVarsThemeOptions } from '@mui/material/styles';
import type { CssVarsThemeOptions } from '@mui/material/styles';
import { ControlledPromise } from '@/lib/ControlledPromise.ts';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
@@ -36,11 +36,15 @@ export class ThemeFontLoader {
}
private static parseWeight(value: any): number | null {
if (typeof value === 'number') return value;
if (typeof value === 'number') {
return value;
}
if (typeof value === 'string') {
const parsed = Number(value);
if (!Number.isNaN(parsed)) return parsed;
if (!Number.isNaN(parsed)) {
return parsed;
}
// Handle CSS keywords
switch (value.toLowerCase()) {
@@ -79,7 +83,7 @@ export class ThemeFontLoader {
const isValidFontProperty = propertyName === 'fontFamily' && propertyType === 'string';
if (isValidFontProperty) {
const detectedFonts = propertyValue.split(',') as string[];
const normalizedFonts = detectedFonts.map((detectedFont) => detectedFont.replace(/"/g, '').trim());
const normalizedFonts = detectedFonts.map((detectedFont) => detectedFont.replaceAll('"', '').trim());
const weights = this.extractWeights(obj);