Refactor lint comments and minor code improvements
Removed or updated unnecessary eslint-disable comments across several server and service files to improve code clarity. Fixed import paths and added TypeScript ignore comments where needed for compatibility. Minor formatting adjustments were made for readability.
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
import 'dotenv/config'
|
import 'dotenv/config'
|
||||||
import { defineConfig } from 'prisma/config'
|
import { defineConfig } from 'prisma/config'
|
||||||
|
|
||||||
// @ts-ignore - Prisma 7 config types are incomplete
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
schema: 'prisma/schema.prisma',
|
schema: 'prisma/schema.prisma',
|
||||||
|
// @ts-expect-error - Prisma 7 config types are incomplete
|
||||||
studio: {
|
studio: {
|
||||||
adapter: async () => {
|
adapter: async () => {
|
||||||
const { PrismaBetterSqlite3 } = await import('@prisma/adapter-better-sqlite3')
|
const { PrismaBetterSqlite3 } = await import('@prisma/adapter-better-sqlite3')
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import stripAnsi from 'strip-ansi';
|
|||||||
import { spawn as ptySpawn } from 'node-pty';
|
import { spawn as ptySpawn } from 'node-pty';
|
||||||
import { getSSHExecutionService } from './src/server/ssh-execution-service.js';
|
import { getSSHExecutionService } from './src/server/ssh-execution-service.js';
|
||||||
import { getDatabase } from './src/server/database-prisma.js';
|
import { getDatabase } from './src/server/database-prisma.js';
|
||||||
|
// @ts-ignore - TypeScript has trouble with JS module exports
|
||||||
import { initializeAutoSync, initializeRepositories, setupGracefulShutdown } from './src/server/lib/autoSyncInit.js';
|
import { initializeAutoSync, initializeRepositories, setupGracefulShutdown } from './src/server/lib/autoSyncInit.js';
|
||||||
import dotenv from 'dotenv';
|
import dotenv from 'dotenv';
|
||||||
|
|
||||||
|
|||||||
@@ -584,7 +584,10 @@ export function ScriptsGrid({ onInstallScript }: ScriptsGridProps) {
|
|||||||
} else {
|
} else {
|
||||||
const error =
|
const error =
|
||||||
"error" in result ? result.error : "Failed to load script";
|
"error" in result ? result.error : "Failed to load script";
|
||||||
const userFriendlyError = getFriendlyErrorMessage(error ?? "Unknown error", slug ?? "");
|
const userFriendlyError = getFriendlyErrorMessage(
|
||||||
|
error ?? "Unknown error",
|
||||||
|
slug ?? "",
|
||||||
|
);
|
||||||
failed.push({ slug: slug ?? "", error: userFriendlyError });
|
failed.push({ slug: slug ?? "", error: userFriendlyError });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";
|
import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";
|
||||||
import { scriptManager } from "~/server/lib/scripts";
|
import { scriptManager } from "~/server/lib/scripts";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument */
|
|
||||||
import { prisma } from './db';
|
import { prisma } from './db';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { writeFileSync, unlinkSync, chmodSync, mkdirSync } from 'fs';
|
import { writeFileSync, unlinkSync, chmodSync, mkdirSync } from 'fs';
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { AutoSyncService } from '../services/autoSyncService.js';
|
import { AutoSyncService } from '../services/autoSyncService.js';
|
||||||
import { repositoryService } from '../services/repositoryService.ts';
|
import { repositoryService } from '../services/repositoryService.js';
|
||||||
|
|
||||||
|
/** @type {AutoSyncService | null} */
|
||||||
let autoSyncService = null;
|
let autoSyncService = null;
|
||||||
let isInitialized = false;
|
let isInitialized = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize default repositories
|
* Initialize default repositories
|
||||||
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
export async function initializeRepositories() {
|
export async function initializeRepositories() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-floating-promises, @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/no-unused-vars, @typescript-eslint/prefer-regexp-exec, @typescript-eslint/prefer-optional-chain, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument */
|
/* eslint-disable @typescript-eslint/no-floating-promises, @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/no-unused-vars, @typescript-eslint/prefer-regexp-exec, @typescript-eslint/prefer-optional-chain */
|
||||||
import { getSSHExecutionService } from '../ssh-execution-service';
|
import { getSSHExecutionService } from '../ssh-execution-service';
|
||||||
import { getStorageService } from './storageService';
|
import { getStorageService } from './storageService';
|
||||||
import { getDatabase } from '../database-prisma';
|
import { getDatabase } from '../database-prisma';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-argument, @typescript-eslint/prefer-nullish-coalescing */
|
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
||||||
import { writeFile, mkdir, readdir, readFile } from 'fs/promises';
|
import { writeFile, mkdir, readdir, readFile } from 'fs/promises';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { env } from '../../env.js';
|
import { env } from '../../env.js';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
||||||
import { readFile, readdir, writeFile, mkdir } from 'fs/promises';
|
import { readFile, readdir, writeFile, mkdir } from 'fs/promises';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import type { Script, ScriptCard } from '~/types/script';
|
import type { Script, ScriptCard } from '~/types/script';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument, @typescript-eslint/prefer-regexp-exec */
|
/* eslint-disable @typescript-eslint/prefer-regexp-exec */
|
||||||
import { prisma } from '../db';
|
import { prisma } from '../db';
|
||||||
|
|
||||||
export class RepositoryService {
|
export class RepositoryService {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-floating-promises, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-return, @typescript-eslint/prefer-optional-chain, @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/prefer-regexp-exec, @typescript-eslint/no-empty-function */
|
/* eslint-disable @typescript-eslint/no-floating-promises, @typescript-eslint/prefer-optional-chain, @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/prefer-regexp-exec, @typescript-eslint/no-empty-function */
|
||||||
import { getSSHExecutionService } from '../ssh-execution-service';
|
import { getSSHExecutionService } from '../ssh-execution-service';
|
||||||
import { getBackupService } from './backupService';
|
import { getBackupService } from './backupService';
|
||||||
import { getStorageService } from './storageService';
|
import { getStorageService } from './storageService';
|
||||||
|
|||||||
Reference in New Issue
Block a user