Update packages and migrate from eslint to biome

This commit is contained in:
Kizuren 2025-12-09 01:18:10 +01:00
parent f955580abe
commit a07f904415
6 changed files with 232 additions and 823 deletions

103
biome.json Normal file
View file

@ -0,0 +1,103 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"includes": [
"**",
"!node_modules",
"!dist",
"!build",
"!coverage",
"!*.min.js",
"!.env*",
"!*.log",
"!tmp",
"!temp",
"!*.config.js",
"!src/core/anime/nexus/fingerprint.ts",
"!src/core/anime/miruro/decrypt.ts",
"!src/core/anime/1anime/decrypt.ts",
"!src/core/anime/miruro/utils.ts",
"!src/core/anime/animekai/decrypt.ts",
"!inspection-tool.ts"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noExtraBooleanCast": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
"noUselessLabel": "error",
"noUselessRename": "error"
},
"correctness": {
"noConstAssign": "error",
"noConstantCondition": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInnerDeclarations": "error",
"noInvalidConstructorSuper": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnusedLabels": "error",
"noUnusedVariables": "warn",
"useIsNan": "error"
},
"style": {
"useConst": "warn",
"useTemplate": "warn"
},
"suspicious": {
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noDebugger": "warn",
"noDoubleEquals": "warn",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateObjectKeys": "error",
"noEmptyBlockStatements": "warn",
"noExplicitAny": "warn",
"noFallthroughSwitchClause": "error",
"noGlobalAssign": "error",
"noRedeclare": "error",
"noShadowRestrictedNames": "error",
"noUnsafeNegation": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "single",
"semicolons": "always",
"trailingCommas": "es5",
"arrowParentheses": "asNeeded"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}

875
bun.lock

File diff suppressed because it is too large Load diff

View file

@ -1,16 +0,0 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
];
export default eslintConfig;

View file

@ -1,34 +1,33 @@
{ {
"name": "ulinkshortener", "name": "ulinkshortener",
"version": "0.1.0", "version": "2.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev --turbopack", "dev": "next dev --turbopack",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint" "lint": "next lint",
"format": "biome format . --write"
}, },
"dependencies": { "dependencies": {
"chart.js": "^4.5.0", "chart.js": "^4.5.1",
"mongodb": "^7.0.0", "mongodb": "^7.0.0",
"next": "16.0.8", "next": "16.0.8",
"next-auth": "^4.24.11", "next-auth": "^4.24.13",
"react": "^19.0.0", "react": "^19.2.1",
"react-chartjs-2": "^5.3.0", "react-chartjs-2": "^5.3.1",
"react-dom": "^19.0.0", "react-dom": "^19.2.1",
"ua-parser-js": "^2.0.3", "ua-parser-js": "^2.0.6",
"winston": "^3.17.0" "winston": "^3.19.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3", "@biomejs/biome": "^2.3.8",
"@tailwindcss/postcss": "^4", "@tailwindcss/postcss": "^4.1.17",
"@types/node": "^24", "@types/node": "^24.10.2",
"@types/react": "^19", "@types/react": "^19.2.7",
"@types/react-dom": "^19", "@types/react-dom": "^19.2.3",
"@types/uuid": "^11.0.0", "@types/uuid": "^11.0.0",
"eslint": "^9", "tailwindcss": "^4.1.17",
"eslint-config-next": "16.0.1", "typescript": "^5.9.3"
"tailwindcss": "^4",
"typescript": "^5"
} }
} }

View file

@ -2,7 +2,7 @@ import { NextResponse } from 'next/server';
import { getToken } from 'next-auth/jwt'; import { getToken } from 'next-auth/jwt';
import type { NextRequest } from 'next/server'; import type { NextRequest } from 'next/server';
export async function middleware(request: NextRequest) { export async function proxy(request: NextRequest) {
const path = request.nextUrl.pathname; const path = request.nextUrl.pathname;
const response = NextResponse.next(); const response = NextResponse.next();

View file

@ -1,7 +1,11 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ES2017", "target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"], "lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
@ -11,7 +15,7 @@
"moduleResolution": "bundler", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve", "jsx": "react-jsx",
"incremental": true, "incremental": true,
"plugins": [ "plugins": [
{ {
@ -19,9 +23,19 @@
} }
], ],
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": [
"./src/*"
]
} }
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "include": [
"exclude": ["node_modules"] "next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
]
} }