mirror of
https://github.com/C4illin/ConvertX.git
synced 2025-10-23 04:52:18 +00:00
chore: remove biome
This commit is contained in:
10
package.json
10
package.json
@@ -4,12 +4,12 @@
|
||||
"scripts": {
|
||||
"dev": "bun run --watch src/index.tsx",
|
||||
"hot": "bun run --hot src/index.tsx",
|
||||
"format": "biome format --write ./src",
|
||||
"format": "eslint --fix ./src",
|
||||
"build": "postcss ./src/main.css -o ./src/public/generated.css",
|
||||
"lint": "run-p 'lint:*'",
|
||||
"lint:tsc": "tsc --noEmit",
|
||||
"lint:knip": "knip",
|
||||
"lint:biome": "biome lint --error-on-warnings ./src"
|
||||
"lint:eslint": "eslint ./src",
|
||||
},
|
||||
"dependencies": {
|
||||
"@elysiajs/cookie": "^0.8.0",
|
||||
@@ -24,7 +24,6 @@
|
||||
"start": "bun run src/index.tsx"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.9.3",
|
||||
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
||||
"@eslint/compat": "^1.1.1",
|
||||
"@eslint/js": "^9.11.1",
|
||||
@@ -60,8 +59,5 @@
|
||||
"tailwindcss": "^3.4.13",
|
||||
"typescript": "^5.6.2",
|
||||
"typescript-eslint": "^8.7.0"
|
||||
},
|
||||
"trustedDependencies": [
|
||||
"@biomejs/biome"
|
||||
]
|
||||
}
|
||||
}
|
@@ -116,8 +116,8 @@ export async function convert(
|
||||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
): Promise<string> {
|
||||
// let command = "ffmpeg";
|
||||
|
||||
|
@@ -689,7 +689,6 @@ export async function convert(
|
||||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
): Promise<string> {
|
||||
const command = `ffmpeg -i "${filePath}" "${targetPath}"`;
|
||||
|
@@ -313,8 +313,8 @@ export function convert(
|
||||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
exec(
|
||||
|
@@ -39,8 +39,8 @@ export function convert(
|
||||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
): Promise<string> {
|
||||
let tool = "";
|
||||
if (fileType === "jxl") {
|
||||
|
@@ -1,67 +1,65 @@
|
||||
import {
|
||||
convert as convertImage,
|
||||
properties as propertiesImage
|
||||
} from "./vips";
|
||||
|
||||
import { normalizeFiletype } from "../helpers/normalizeFiletype";
|
||||
import {
|
||||
convert as convertPandoc,
|
||||
properties as propertiesPandoc,
|
||||
} from "./pandoc";
|
||||
|
||||
convert as convertassimp,
|
||||
properties as propertiesassimp,
|
||||
} from "./assimp";
|
||||
import {
|
||||
convert as convertFFmpeg,
|
||||
properties as propertiesFFmpeg,
|
||||
} from "./ffmpeg";
|
||||
|
||||
import {
|
||||
convert as convertGraphicsmagick,
|
||||
properties as propertiesGraphicsmagick,
|
||||
} from "./graphicsmagick";
|
||||
|
||||
import {
|
||||
convert as convertLibjxl,
|
||||
properties as propertiesLibjxl,
|
||||
} from "./libjxl";
|
||||
import {
|
||||
convert as convertPandoc,
|
||||
properties as propertiesPandoc,
|
||||
} from "./pandoc";
|
||||
import {
|
||||
convert as convertresvg,
|
||||
properties as propertiesresvg,
|
||||
} from "./resvg";
|
||||
import { convert as convertImage, properties as propertiesImage } from "./vips";
|
||||
import {
|
||||
convert as convertxelatex,
|
||||
properties as propertiesxelatex,
|
||||
} from "./xelatex";
|
||||
|
||||
import {
|
||||
convert as convertLibjxl,
|
||||
properties as propertiesLibjxl,
|
||||
} from "./libjxl";
|
||||
|
||||
import {
|
||||
convert as convertresvg,
|
||||
properties as propertiesresvg,
|
||||
} from "./resvg";
|
||||
|
||||
import {
|
||||
convert as convertassimp,
|
||||
properties as propertiesassimp,
|
||||
} from "./assimp";
|
||||
|
||||
import { normalizeFiletype } from "../helpers/normalizeFiletype";
|
||||
|
||||
// This should probably be reconstructed so that the functions are not imported instead the functions hook into this to make the converters more modular
|
||||
|
||||
const properties: Record<string, {
|
||||
const properties: Record<
|
||||
string,
|
||||
{
|
||||
properties: {
|
||||
from: Record<string, string[]>;
|
||||
to: Record<string, string[]>;
|
||||
options?: Record<string, Record<string, {
|
||||
options?: Record<
|
||||
string,
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
description: string;
|
||||
type: string;
|
||||
default: number;
|
||||
}>>;
|
||||
}
|
||||
>
|
||||
>;
|
||||
};
|
||||
converter: (
|
||||
filePath: string,
|
||||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
) => any;
|
||||
}> = {
|
||||
}
|
||||
> = {
|
||||
libjxl: {
|
||||
properties: propertiesLibjxl,
|
||||
converter: convertLibjxl,
|
||||
@@ -99,16 +97,16 @@ const properties: Record<string, {
|
||||
export async function mainConverter(
|
||||
inputFilePath: string,
|
||||
fileTypeOriginal: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
convertTo: any,
|
||||
targetPath: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
converterName?: string,
|
||||
) {
|
||||
const fileType = normalizeFiletype(fileTypeOriginal);
|
||||
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
let converterFunc: any;
|
||||
// let converterName = converterName;
|
||||
|
||||
@@ -116,7 +114,6 @@ export async function mainConverter(
|
||||
converterFunc = properties[converterName]?.converter;
|
||||
} else {
|
||||
// Iterate over each converter in properties
|
||||
// biome-ignore lint/style/noParameterAssign: <explanation>
|
||||
for (converterName in properties) {
|
||||
const converterObj = properties[converterName];
|
||||
|
||||
@@ -190,9 +187,7 @@ for (const converterName in properties) {
|
||||
}
|
||||
}
|
||||
|
||||
export const getPossibleTargets = (
|
||||
from: string,
|
||||
): Record<string, string[]> => {
|
||||
export const getPossibleTargets = (from: string): Record<string, string[]> => {
|
||||
const fromClean = normalizeFiletype(from);
|
||||
|
||||
return possibleTargets[fromClean] || {};
|
||||
|
@@ -124,8 +124,8 @@ export function convert(
|
||||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
): Promise<string> {
|
||||
// set xelatex here
|
||||
const xelatex = ["pdf", "latex"];
|
||||
|
@@ -14,8 +14,8 @@ export function convert(
|
||||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
exec(`resvg "${filePath}" "${targetPath}"`, (error, stdout, stderr) => {
|
||||
|
@@ -94,8 +94,8 @@ export function convert(
|
||||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
): Promise<string> {
|
||||
// if (fileType === "svg") {
|
||||
// const scale = options.scale || 1;
|
||||
|
@@ -14,8 +14,8 @@ export function convert(
|
||||
fileType: string,
|
||||
convertTo: string,
|
||||
targetPath: string,
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
options?: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
options?: unknown,
|
||||
): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
// const fileName: string = (targetPath.split("/").pop() as string).replace(".pdf", "")
|
||||
|
Reference in New Issue
Block a user