Replace empty arrow functions with explicit comments

Updated all empty arrow functions and constructors to include an explicit '/* empty */' comment for clarity and consistency. Also fixed a minor HTML entity in SwaggerUI and removed unnecessary async/Promise usage in some service methods.
This commit is contained in:
Ludy87 2025-09-25 07:46:23 +02:00
parent 4c8ae23652
commit 1c95c6a2e8
No known key found for this signature in database
GPG Key ID: 92696155E0220F94
11 changed files with 15 additions and 15 deletions

View File

@ -21,7 +21,7 @@ export function adjustFontSizeToFit(
element: HTMLElement,
options: AdjustFontSizeOptions = {}
): () => void {
if (!element) return () => {};
if (!element) return () => { /* empty */ };
const computed = window.getComputedStyle(element);
const baseFontPx = options.maxFontSizePx ?? parseFloat(computed.fontSize || '16');

View File

@ -150,7 +150,7 @@ export default function ToolSelector({
<div onClick={handleSearchFocus} style={{ cursor: 'pointer',
borderRadius: "var(--mantine-radius-lg)" }}>
<ToolButton id='tool' tool={toolRegistry[selectedValue]} isSelected={false}
onSelect={()=>{}} rounded={true} disableNavigation={true}></ToolButton>
onSelect={()=>{ /* empty */ }} rounded={true} disableNavigation={true}></ToolButton>
</div>
) : (
// Show search input when no tool selected OR when dropdown is opened

View File

@ -166,9 +166,9 @@ export function useFileContext() {
addFiles: actions.addFiles,
consumeFiles: actions.consumeFiles,
undoConsumeFiles: actions.undoConsumeFiles,
recordOperation: (_fileId: FileId, _operation: any) => {}, // Operation tracking not implemented
markOperationApplied: (_fileId: FileId, _operationId: string) => {}, // Operation tracking not implemented
markOperationFailed: (_fileId: FileId, _operationId: string, _error: string) => {}, // Operation tracking not implemented
recordOperation: (_fileId: FileId, _operation: any) => { /* empty */ }, // Operation tracking not implemented
markOperationApplied: (_fileId: FileId, _operationId: string) => { /* empty */ }, // Operation tracking not implemented
markOperationFailed: (_fileId: FileId, _operationId: string, _error: string) => { /* empty */ }, // Operation tracking not implemented
// File ID lookup
findFileId: (file: File) => {
return state.files.ids.find(id => {

View File

@ -57,7 +57,7 @@ describe('useAdjustPageScaleParameters', () => {
test.each([
{
description: 'with default parameters',
setup: () => {},
setup: () => { /* empty */ },
expected: true
},
{

View File

@ -40,7 +40,7 @@ export function useFileWithUrlAndCleanup(file: File | null): {
cleanup: () => void;
} {
return useMemo(() => {
if (!file) return { fileObj: null, cleanup: () => {} };
if (!file) return { fileObj: null, cleanup: () => { /* empty */ } };
const url = URL.createObjectURL(file);
const fileObj = { file, url };

View File

@ -16,7 +16,7 @@ export function useToolParameters(
// Return empty values and noop updater
const currentValues = useMemo(() => ({}), []);
const updateParameters = useCallback(() => {}, []);
const updateParameters = useCallback(() => { /* empty */ }, []);
return [currentValues, updateParameters];
}
@ -45,7 +45,7 @@ export function useToolParameter<T = any>(
*/
export function useGlobalParameters() {
const currentValues = useMemo(() => ({}), []);
const updateParameters = useCallback(() => {}, []);
const updateParameters = useCallback(() => { /* empty */ }, []);
return [currentValues, updateParameters];
}

View File

@ -29,7 +29,7 @@ export class EnhancedPDFProcessingService {
maxRetries: 3
};
private constructor() {}
private constructor() { /* empty */ }
static getInstance(): EnhancedPDFProcessingService {
if (!EnhancedPDFProcessingService.instance) {

View File

@ -24,7 +24,7 @@ class IndexedDBManager {
private databases = new Map<string, IDBDatabase>();
private initPromises = new Map<string, Promise<IDBDatabase>>();
private constructor() {}
private constructor() { /* empty */ }
static getInstance(): IndexedDBManager {
if (!IndexedDBManager.instance) {

View File

@ -210,7 +210,7 @@ export class PDFExportService {
/**
* Download multiple files as a ZIP
*/
async downloadAsZip(blobs: Blob[], filenames: string[]): Promise<void> {
downloadAsZip(blobs: Blob[], filenames: string[]): void {
blobs.forEach((blob, index) => {
setTimeout(() => {
this.downloadFile(blob, filenames[index]);

View File

@ -9,7 +9,7 @@ export class PDFProcessingService {
private processing = new Map<string, ProcessingState>();
private processingListeners = new Set<(states: Map<string, ProcessingState>) => void>();
private constructor() {}
private constructor() { /* empty */ }
static getInstance(): PDFProcessingService {
if (!PDFProcessingService.instance) {
@ -18,7 +18,7 @@ export class PDFProcessingService {
return PDFProcessingService.instance;
}
async getProcessedFile(file: File): Promise<ProcessedFile | null> {
getProcessedFile(file: File): ProcessedFile | null {
const fileKey = this.generateFileKey(file);
// Check cache first

View File

@ -12,7 +12,7 @@ const SwaggerUI: React.FC<BaseToolProps> = () => {
<div style={{ textAlign: "center", padding: "2rem" }}>
<p>Opening Swagger UI in a new tab...</p>
<p>
If it didn't open automatically,{" "}
If it didn&apos;t open automatically,{" "}
<a href={withBasePath("/swagger-ui/5.21.0/index.html")} target="_blank" rel="noopener noreferrer">
click here
</a>