chore: fix eslint rules
This commit is contained in:
parent
a34e215202
commit
ee9207a7f4
9 changed files with 33 additions and 42 deletions
|
|
@ -689,7 +689,8 @@ export async function convert(
|
|||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
options?: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
): Promise<string> {
|
||||
const command = `ffmpeg -i "${filePath}" "${targetPath}"`;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,10 +54,9 @@ const properties: Record<
|
|||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
||||
options?: unknown,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
) => any;
|
||||
) => unknown;
|
||||
}
|
||||
> = {
|
||||
libjxl: {
|
||||
|
|
@ -97,17 +96,14 @@ const properties: Record<
|
|||
export async function mainConverter(
|
||||
inputFilePath: string,
|
||||
fileTypeOriginal: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
convertTo: any,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
converterName?: string,
|
||||
) {
|
||||
const fileType = normalizeFiletype(fileTypeOriginal);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
let converterFunc: any;
|
||||
let converterFunc: ((filePath: string, fileType: string, convertTo: string, targetPath: string, options?: unknown) => unknown) | undefined;
|
||||
// let converterName = converterName;
|
||||
|
||||
if (converterName) {
|
||||
|
|
@ -211,6 +207,7 @@ for (const converterName in properties) {
|
|||
}
|
||||
possibleInputs.sort();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const getPossibleInputs = () => {
|
||||
return possibleInputs;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -141,7 +141,9 @@ const app = new Elysia({
|
|||
<main class="mx-auto w-full max-w-4xl px-4">
|
||||
<h1 class="my-8 text-3xl">Welcome to ConvertX!</h1>
|
||||
<article class="article p-0">
|
||||
<header class="w-full bg-neutral-800 p-4">Create your account</header>
|
||||
<header class="w-full bg-neutral-800 p-4">
|
||||
Create your account
|
||||
</header>
|
||||
<form method="post" action="/register" class="p-4">
|
||||
<fieldset class="mb-4 flex flex-col gap-4">
|
||||
<label class="flex flex-col gap-1">
|
||||
|
|
@ -565,7 +567,7 @@ const app = new Elysia({
|
|||
{Object.entries(getAllTargets()).map(
|
||||
([converter, targets]) => (
|
||||
<article
|
||||
class="convert_to_group w-full border-b border-neutral-700 p-4 flex flex-col"
|
||||
class="convert_to_group flex w-full flex-col border-b border-neutral-700 p-4"
|
||||
data-converter={converter}
|
||||
>
|
||||
<header class="mb-2 w-full text-xl font-bold" safe>
|
||||
|
|
@ -633,7 +635,7 @@ const app = new Elysia({
|
|||
{Object.entries(getPossibleTargets(body.fileType)).map(
|
||||
([converter, targets]) => (
|
||||
<article
|
||||
class="convert_to_group w-full border-b border-neutral-700 p-4 flex flex-col"
|
||||
class="convert_to_group flex w-full flex-col border-b border-neutral-700 p-4"
|
||||
data-converter={converter}
|
||||
>
|
||||
<header class="mb-2 w-full text-xl font-bold" safe>
|
||||
|
|
@ -713,7 +715,7 @@ const app = new Elysia({
|
|||
await Bun.write(`${userUploadsDir}${file.name}`, file);
|
||||
}
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/dot-notation
|
||||
|
||||
await Bun.write(`${userUploadsDir}${body.file["name"]}`, body.file);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@ const dropZone = document.getElementById("dropzone");
|
|||
const fileNames = [];
|
||||
let fileType;
|
||||
|
||||
dropZone.addEventListener("dragover", (e) => {
|
||||
dropZone.addEventListener("dragover", () => {
|
||||
dropZone.classList.add("dragover");
|
||||
});
|
||||
|
||||
dropZone.addEventListener("dragleave", (e) => {
|
||||
dropZone.addEventListener("dragleave", () => {
|
||||
dropZone.classList.remove("dragover");
|
||||
});
|
||||
|
||||
|
|
@ -153,6 +153,7 @@ const setTitle = () => {
|
|||
};
|
||||
|
||||
// Add a onclick for the delete button
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const deleteRow = (target) => {
|
||||
const filename = target.parentElement.parentElement.children[0].textContent;
|
||||
const row = target.parentElement.parentElement;
|
||||
|
|
@ -203,7 +204,7 @@ const uploadFiles = (files) => {
|
|||
|
||||
const formConvert = document.querySelector("form[action='/convert']");
|
||||
|
||||
formConvert.addEventListener("submit", (e) => {
|
||||
formConvert.addEventListener("submit", () => {
|
||||
const hiddenInput = document.querySelector("input[name='file_names']");
|
||||
hiddenInput.value = JSON.stringify(fileNames);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue