Skip to content

Commit 7d87f0e

Browse files
committed
fix: lint
1 parent e0e2a7b commit 7d87f0e

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

api/src/unraid-api/unraid-file-modifier/modifications/__test__/generic-modification.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Logger } from '@nestjs/common';
2+
import { existsSync } from 'fs';
23
import { readFile, writeFile } from 'fs/promises';
34
import { basename, resolve } from 'path';
45

@@ -8,7 +9,6 @@ import { FileModification } from '@app/unraid-api/unraid-file-modifier/file-modi
89
import DefaultPageLayoutModification from '@app/unraid-api/unraid-file-modifier/modifications/default-page-layout.modification';
910
import NotificationsPageModification from '@app/unraid-api/unraid-file-modifier/modifications/notifications-page.modification';
1011
import SSOFileModification from '@app/unraid-api/unraid-file-modifier/modifications/sso.modification';
11-
import { existsSync } from 'fs';
1212

1313
interface ModificationTestCase {
1414
ModificationClass: new (...args: ConstructorParameters<typeof FileModification>) => FileModification;
@@ -50,10 +50,10 @@ async function testModification(testCase: ModificationTestCase) {
5050

5151
const logger = new Logger();
5252
const patcher = await new testCase.ModificationClass(logger);
53-
// @ts-ignore - Ignore for testing purposes
53+
// @ts-expect-error - Ignore for testing purposes
5454
patcher.filePath = path;
5555

56-
// @ts-ignore - Ignore for testing purposes
56+
// @ts-expect-error - Ignore for testing purposes
5757
const patch = await patcher.generatePatch();
5858

5959
// Test patch matches snapshot

api/src/unraid-api/unraid-file-modifier/modifications/default-page-layout.modification.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import {
1010

1111
export default class DefaultPageLayoutModification extends FileModification {
1212
id: string = 'default-page-layout';
13-
public readonly filePath: string =
14-
'/usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php';
13+
public readonly filePath: string = '/usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php';
1514

1615
private addToaster(source: string): string {
1716
if (source.includes('unraid-toaster')) {
@@ -45,7 +44,6 @@ export default class DefaultPageLayoutModification extends FileModification {
4544
protected async generatePatch(): Promise<string> {
4645
const fileContent = await readFile(this.filePath, 'utf-8');
4746

48-
4947
const newContent = this.applyToSource(fileContent);
5048

5149
const patch = createPatch(this.filePath, fileContent, newContent, undefined, undefined, {

api/src/unraid-api/unraid-file-modifier/modifications/sso.modification.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import type { Logger } from '@nestjs/common';
22
import { readFile } from 'node:fs/promises';
3+
34
import { createPatch } from 'diff';
4-
import { FileModification, ShouldApplyWithReason } from '@app/unraid-api/unraid-file-modifier/file-modification';
5+
6+
import {
7+
FileModification,
8+
ShouldApplyWithReason,
9+
} from '@app/unraid-api/unraid-file-modifier/file-modification';
510

611
export default class SSOFileModification extends FileModification {
712
id: string = 'sso';
@@ -43,7 +48,7 @@ function verifyUsernamePasswordAndSSO(string $username, string $password): bool
4348

4449
// Read the file content
4550
const originalContent = await readFile(this.filePath, 'utf-8');
46-
51+
4752
// Create modified content
4853
let newContent = originalContent;
4954

0 commit comments

Comments
 (0)