mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-08 17:51:20 +02:00
Enable and fix no-empty linting rule
This commit is contained in:
parent
0de0bb2d41
commit
ef7c25482e
@ -15,7 +15,6 @@ export default defineConfig(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-empty": "off", // Temporarily disabled until codebase conformant
|
|
||||||
"no-empty-pattern": "off", // Temporarily disabled until codebase conformant
|
"no-empty-pattern": "off", // Temporarily disabled until codebase conformant
|
||||||
"no-undef": "off", // Temporarily disabled until codebase conformant
|
"no-undef": "off", // Temporarily disabled until codebase conformant
|
||||||
"no-useless-escape": "off", // Temporarily disabled until codebase conformant
|
"no-useless-escape": "off", // Temporarily disabled until codebase conformant
|
||||||
|
@ -82,8 +82,8 @@ export function adjustFontSizeToFit(
|
|||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
cancelAnimationFrame(raf);
|
cancelAnimationFrame(raf);
|
||||||
try { ro.disconnect(); } catch {}
|
try { ro.disconnect(); } catch { /* Ignore errors */ }
|
||||||
try { mo.disconnect(); } catch {}
|
try { mo.disconnect(); } catch { /* Ignore errors */ }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* PDF.js Worker Manager - Centralized worker lifecycle management
|
* PDF.js Worker Manager - Centralized worker lifecycle management
|
||||||
*
|
*
|
||||||
* Prevents infinite worker creation by managing PDF.js workers globally
|
* Prevents infinite worker creation by managing PDF.js workers globally
|
||||||
* and ensuring proper cleanup when operations complete.
|
* and ensuring proper cleanup when operations complete.
|
||||||
*/
|
*/
|
||||||
@ -86,7 +86,7 @@ class PDFWorkerManager {
|
|||||||
const pdf = await loadingTask.promise;
|
const pdf = await loadingTask.promise;
|
||||||
this.activeDocuments.add(pdf);
|
this.activeDocuments.add(pdf);
|
||||||
this.workerCount++;
|
this.workerCount++;
|
||||||
|
|
||||||
return pdf;
|
return pdf;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// If document creation fails, make sure to clean up the loading task
|
// If document creation fails, make sure to clean up the loading task
|
||||||
@ -94,6 +94,7 @@ class PDFWorkerManager {
|
|||||||
try {
|
try {
|
||||||
loadingTask.destroy();
|
loadingTask.destroy();
|
||||||
} catch (destroyError) {
|
} catch (destroyError) {
|
||||||
|
// Ignore errors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
@ -125,7 +126,7 @@ class PDFWorkerManager {
|
|||||||
documentsToDestroy.forEach(pdf => {
|
documentsToDestroy.forEach(pdf => {
|
||||||
this.destroyDocument(pdf);
|
this.destroyDocument(pdf);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.activeDocuments.clear();
|
this.activeDocuments.clear();
|
||||||
this.workerCount = 0;
|
this.workerCount = 0;
|
||||||
}
|
}
|
||||||
@ -166,9 +167,10 @@ class PDFWorkerManager {
|
|||||||
try {
|
try {
|
||||||
pdf.destroy();
|
pdf.destroy();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
// Ignore errors
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.activeDocuments.clear();
|
this.activeDocuments.clear();
|
||||||
this.workerCount = 0;
|
this.workerCount = 0;
|
||||||
}
|
}
|
||||||
@ -182,4 +184,4 @@ class PDFWorkerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Export singleton instance
|
// Export singleton instance
|
||||||
export const pdfWorkerManager = PDFWorkerManager.getInstance();
|
export const pdfWorkerManager = PDFWorkerManager.getInstance();
|
||||||
|
Loading…
Reference in New Issue
Block a user