mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 03:20:46 +02:00
Switch to use ESLint 10 (#5794)
This commit is contained in:
@@ -133,7 +133,7 @@ const validateParameters = (params: ConvertParameters): boolean => {
|
||||
if (!fromExtension || !toExtension) return false;
|
||||
|
||||
// Handle dynamic format identifiers (file-<extension>)
|
||||
let supportedToExtensions: string[] = [];
|
||||
let supportedToExtensions: string[];
|
||||
if (fromExtension.startsWith('file-')) {
|
||||
// Dynamic format - use 'any' conversion options
|
||||
supportedToExtensions = CONVERSION_MATRIX['any'] || [];
|
||||
|
||||
@@ -71,7 +71,10 @@ const removeAnnotationsProcessor = async (_parameters: RemoveAnnotationsParamete
|
||||
processedFiles.push(processedFile);
|
||||
} catch (error) {
|
||||
console.error('Error processing file:', file.name, error);
|
||||
throw new Error(`Failed to process ${file.name}: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
||||
throw new Error(
|
||||
`Failed to process ${file.name}: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
||||
{ cause: error }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,4 +99,4 @@ export const useRemoveAnnotationsOperation = () => {
|
||||
...removeAnnotationsOperationConfig,
|
||||
getErrorMessage: createStandardErrorHandler(t('removeAnnotations.error.failed', 'An error occurred while removing annotations from the PDF.'))
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ export const useToolApiCalls = <TParams = void>() => {
|
||||
|
||||
} catch (error) {
|
||||
if (axios.isCancel(error)) {
|
||||
throw new Error('Operation was cancelled');
|
||||
throw new Error('Operation was cancelled', { cause: error });
|
||||
}
|
||||
console.error('[processFiles] Failed', { name: file.name, error });
|
||||
failedFiles.push(file.name);
|
||||
|
||||
@@ -71,7 +71,7 @@ export const createReportPdf = async (
|
||||
cursorY -= 16;
|
||||
|
||||
if (entry.error) {
|
||||
cursorY = drawCenteredMessage({
|
||||
drawCenteredMessage({
|
||||
page,
|
||||
font,
|
||||
fontBold,
|
||||
@@ -86,7 +86,7 @@ export const createReportPdf = async (
|
||||
}
|
||||
|
||||
if (entry.signatures.length === 0) {
|
||||
cursorY = drawCenteredMessage({
|
||||
drawCenteredMessage({
|
||||
page,
|
||||
font,
|
||||
fontBold,
|
||||
|
||||
@@ -71,8 +71,7 @@ export const useCookieConsent = ({
|
||||
const hasDarkClass = document.documentElement.classList.contains('dark');
|
||||
const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
let isDarkMode = false;
|
||||
|
||||
let isDarkMode: boolean;
|
||||
if (mantineScheme) {
|
||||
isDarkMode = mantineScheme === 'dark';
|
||||
} else if (hasLightClass) {
|
||||
@@ -94,9 +93,8 @@ export const useCookieConsent = ({
|
||||
return;
|
||||
}
|
||||
|
||||
let themeObserver: MutationObserver | null = null;
|
||||
if (!forceLightMode) {
|
||||
themeObserver = new MutationObserver((mutations) => {
|
||||
const themeObserver = new MutationObserver((mutations) => {
|
||||
mutations.forEach((mutation) => {
|
||||
if (mutation.type === 'attributes' &&
|
||||
(mutation.attributeName === 'data-mantine-color-scheme' ||
|
||||
@@ -241,7 +239,7 @@ export const useCookieConsent = ({
|
||||
const hasDarkClass = document.documentElement.classList.contains('dark');
|
||||
const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
let isDarkMode = false;
|
||||
let isDarkMode: boolean;
|
||||
if (mantineScheme) {
|
||||
isDarkMode = mantineScheme === 'dark';
|
||||
} else if (hasLightClass) {
|
||||
|
||||
Reference in New Issue
Block a user