fix: resolve all ESLint errors in backend and frontend

Backend 958→0 errors, frontend 98→0 errors. Builds and tsc clean.

Echte Fixes:
- Auth: AuthenticatedUser/AuthenticatedRequest, JwtStrategy + alle 5
  Controller von `@Request() req: any` auf typisierten Request umgestellt
- Error-Handling: neuer getErrorMessage/Stack/Code/getResponseData-Helper;
  alle 50 `catch (err: any)`-Blöcke auf `unknown` + Helper umgestellt
- 24 echte Bugs: require-await, require-imports→ES-Imports, useless-escape,
  misused-promises, tote Imports/Vars, leere catch-Blöcke kommentiert
- document-pipeline: OCR-Ergebnis wird nicht gespeichert (als TODO markiert)

Pragmatisch auf warn herabgestuft (untypisierte Paperless-NGX-API):
no-unsafe-*, restrict-template-expressions, no-base-to-string,
no-explicit-any (FE), react-refresh/only-export-components

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 21:33:37 +02:00
parent d96e06e86d
commit 07dfd7e840
43 changed files with 399 additions and 204 deletions
+5 -4
View File
@@ -19,6 +19,7 @@ import {
} from '../database/entities/inbox-document.entity';
import { MailService } from '../postprocessing/mail.service';
import { buildSegmentBuffer } from '../inbox-postprocessor/edit-applier';
import { getErrorMessage } from '../common/error.util';
export interface InboxFile {
id: string;
@@ -99,9 +100,9 @@ export class InboxService {
try {
const stat = await fs.stat(pdfPath);
if (!stat.isFile()) throw new Error('not a file');
} catch (err: any) {
} catch (err: unknown) {
this.logger.warn(
`Datei fehlt trotz DB-Eintrag (${doc.Id}): ${err.message}`,
`Datei fehlt trotz DB-Eintrag (${doc.Id}): ${getErrorMessage(err)}`,
);
throw new NotFoundException('Dokument nicht gefunden');
}
@@ -218,9 +219,9 @@ export class InboxService {
await this.documentRepo.delete(doc.Id);
try {
await fs.rm(dir, { recursive: true, force: true });
} catch (err: any) {
} catch (err: unknown) {
this.logger.warn(
`Dokument-Ordner konnte nicht gelöscht werden (${dir}): ${err.message}`,
`Dokument-Ordner konnte nicht gelöscht werden (${dir}): ${getErrorMessage(err)}`,
);
}
}