From 42610d290d457c56f84b479181698240f8a11e0f Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 3 Feb 2025 15:45:48 -0500 Subject: [PATCH] fix: lint --- .../__test__/generic-modification.spec.ts | 10 +--------- .../modifications/auth-request.modification.ts | 13 ++++++++++--- .../default-page-layout.modification.ts | 13 ++++++++++--- .../notifications-page.modification.ts | 13 ++++++++++--- .../modifications/sso.modification.ts | 8 +++++++- 5 files changed, 38 insertions(+), 19 deletions(-) diff --git a/api/src/unraid-api/unraid-file-modifier/modifications/__test__/generic-modification.spec.ts b/api/src/unraid-api/unraid-file-modifier/modifications/__test__/generic-modification.spec.ts index a3f5e75e5..3deb93739 100644 --- a/api/src/unraid-api/unraid-file-modifier/modifications/__test__/generic-modification.spec.ts +++ b/api/src/unraid-api/unraid-file-modifier/modifications/__test__/generic-modification.spec.ts @@ -3,12 +3,8 @@ import { existsSync } from 'fs'; import { cp, readFile, writeFile } from 'fs/promises'; import path, { basename, resolve } from 'path'; - - import { describe, expect, test } from 'vitest'; - - import { FileModification } from '@app/unraid-api/unraid-file-modifier/file-modification'; import AuthRequestModification from '@app/unraid-api/unraid-file-modifier/modifications/auth-request.modification'; import DefaultPageLayoutModification from '@app/unraid-api/unraid-file-modifier/modifications/default-page-layout.modification'; @@ -16,10 +12,6 @@ import { LogRotateModification } from '@app/unraid-api/unraid-file-modifier/modi import NotificationsPageModification from '@app/unraid-api/unraid-file-modifier/modifications/notifications-page.modification'; import SSOFileModification from '@app/unraid-api/unraid-file-modifier/modifications/sso.modification'; - - - - interface ModificationTestCase { ModificationClass: new (...args: ConstructorParameters) => FileModification; fileUrl: string; @@ -116,4 +108,4 @@ describe('File modifications', () => { test.each(testCases)(`$fileName modifier correctly applies to fresh install`, async (testCase) => { await testModification(testCase); }); -}); \ No newline at end of file +}); diff --git a/api/src/unraid-api/unraid-file-modifier/modifications/auth-request.modification.ts b/api/src/unraid-api/unraid-file-modifier/modifications/auth-request.modification.ts index 925c5d1ad..6220140a7 100644 --- a/api/src/unraid-api/unraid-file-modifier/modifications/auth-request.modification.ts +++ b/api/src/unraid-api/unraid-file-modifier/modifications/auth-request.modification.ts @@ -43,9 +43,16 @@ export default class AuthRequestModification extends FileModification { const newContent = fileContent.replace(/(\$arrWhitelist\s*=\s*\[)/, `$1\n${filesToAddString}`); // Generate and return patch - const patch = createPatch(overridePath ?? this.filePath, fileContent, newContent, undefined, undefined, { - context: 3, - }); + const patch = createPatch( + overridePath ?? this.filePath, + fileContent, + newContent, + undefined, + undefined, + { + context: 3, + } + ); return patch; } diff --git a/api/src/unraid-api/unraid-file-modifier/modifications/default-page-layout.modification.ts b/api/src/unraid-api/unraid-file-modifier/modifications/default-page-layout.modification.ts index b9ee7e08b..130a728be 100644 --- a/api/src/unraid-api/unraid-file-modifier/modifications/default-page-layout.modification.ts +++ b/api/src/unraid-api/unraid-file-modifier/modifications/default-page-layout.modification.ts @@ -46,9 +46,16 @@ export default class DefaultPageLayoutModification extends FileModification { const newContent = this.applyToSource(fileContent); - const patch = createPatch(overridePath ?? this.filePath, fileContent, newContent, undefined, undefined, { - context: 2, - }); + const patch = createPatch( + overridePath ?? this.filePath, + fileContent, + newContent, + undefined, + undefined, + { + context: 2, + } + ); return patch; } diff --git a/api/src/unraid-api/unraid-file-modifier/modifications/notifications-page.modification.ts b/api/src/unraid-api/unraid-file-modifier/modifications/notifications-page.modification.ts index 4020d7078..7ff5c538f 100644 --- a/api/src/unraid-api/unraid-file-modifier/modifications/notifications-page.modification.ts +++ b/api/src/unraid-api/unraid-file-modifier/modifications/notifications-page.modification.ts @@ -17,9 +17,16 @@ export default class NotificationsPageModification extends FileModification { const newContent = NotificationsPageModification.applyToSource(fileContent); - const patch = createPatch(overridePath ?? this.filePath, fileContent, newContent, undefined, undefined, { - context: 3, - }); + const patch = createPatch( + overridePath ?? this.filePath, + fileContent, + newContent, + undefined, + undefined, + { + context: 3, + } + ); return patch; } diff --git a/api/src/unraid-api/unraid-file-modifier/modifications/sso.modification.ts b/api/src/unraid-api/unraid-file-modifier/modifications/sso.modification.ts index 9620df077..931368f8f 100644 --- a/api/src/unraid-api/unraid-file-modifier/modifications/sso.modification.ts +++ b/api/src/unraid-api/unraid-file-modifier/modifications/sso.modification.ts @@ -64,7 +64,13 @@ function verifyUsernamePasswordAndSSO(string $username, string $password): bool newContent = newContent.replace(/<\/form>/i, `\n${tagToInject}`); // Create and return the patch - const patch = createPatch(overridePath ?? this.filePath, originalContent, newContent, 'original', 'modified'); + const patch = createPatch( + overridePath ?? this.filePath, + originalContent, + newContent, + 'original', + 'modified' + ); return patch; }