diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 2884730..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": ["next/core-web-vitals", "next/typescript"], - "rules": { - "@typescript-eslint/no-explicit-any": "off", - "@next/next/no-img-element": "off", - "react-hooks/exhaustive-deps": "off" - } -} diff --git a/.github/workflows/auto-fix-lint-format-commit.yml b/.github/workflows/auto-fix-lint-format-commit.yml index 46c0150..3de375b 100644 --- a/.github/workflows/auto-fix-lint-format-commit.yml +++ b/.github/workflows/auto-fix-lint-format-commit.yml @@ -23,11 +23,8 @@ jobs: - name: Install dependencies run: bun install - - name: Run linter and fix issues - run: bun run lint:fix - - - name: Run formatter - run: bun run format + - name: Run linter & formatter and fix issues + run: bun run check:fix - name: Check for changes id: check_changes diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 55490b2..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "semi": false, - "singleQuote": false, - "printWidth": 100, - "tabWidth": 2, - "trailingComma": "all", - "importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"], - "importOrderSeparation": true, - "importOrderSortSpecifiers": true, - "endOfLine": "auto", - "plugins": ["prettier-plugin-tailwindcss", "@trivago/prettier-plugin-sort-imports"] -} diff --git a/app/api/server-ip/route.ts b/app/api/server-ip/route.ts index 3b12b45..90fdb0a 100644 --- a/app/api/server-ip/route.ts +++ b/app/api/server-ip/route.ts @@ -1,11 +1,11 @@ +import fs from "fs" +import path from "path" import { auth } from "@/auth" import getEnv from "@/lib/env-entry" import { GetServerIP } from "@/lib/serverFetch" -import fs from "fs" import { AsnResponse, CityResponse, Reader } from "maxmind" import { redirect } from "next/navigation" import { NextRequest, NextResponse } from "next/server" -import path from "path" export const dynamic = "force-dynamic" diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..3b714d1 --- /dev/null +++ b/biome.json @@ -0,0 +1,85 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false }, + "files": { "ignoreUnknown": false, "ignore": [".next", "public"] }, + "formatter": { + "enabled": true, + "useEditorconfig": true, + "formatWithErrors": false, + "indentStyle": "space", + "indentWidth": 2, + "lineWidth": 100, + "attributePosition": "auto", + "bracketSpacing": true + }, + "organizeImports": { "enabled": true }, + "linter": { + "enabled": true, + "rules": { + "recommended": false, + "complexity": { "noUselessTypeConstraint": "error" }, + "correctness": { + "noUnusedVariables": "error", + "useArrayLiterals": "off", + "useExhaustiveDependencies": "off" + }, + "style": { "noNamespace": "error", "useAsConstAssertion": "error" }, + "suspicious": { + "noExplicitAny": "off", + "noExtraNonNullAssertion": "error", + "noMisleadingInstantiator": "error", + "noUnsafeDeclarationMerging": "error", + "useNamespaceKeyword": "error" + } + } + }, + "javascript": { + "formatter": { + "jsxQuoteStyle": "double", + "quoteProperties": "asNeeded", + "trailingCommas": "all", + "semicolons": "asNeeded", + "arrowParentheses": "always", + "bracketSameLine": false, + "quoteStyle": "double", + "attributePosition": "auto", + "bracketSpacing": true + } + }, + "overrides": [ + { + "include": ["*.ts", "*.tsx", "*.mts", "*.cts"], + "linter": { + "rules": { + "correctness": { + "noConstAssign": "off", + "noGlobalObjectCalls": "off", + "noInvalidBuiltinInstantiation": "off", + "noInvalidConstructorSuper": "off", + "noNewSymbol": "off", + "noSetterReturn": "off", + "noUndeclaredVariables": "off", + "noUnreachable": "off", + "noUnreachableSuper": "off" + }, + "style": { + "noArguments": "error", + "noVar": "error", + "useConst": "error" + }, + "suspicious": { + "noClassAssign": "off", + "noDuplicateClassMembers": "off", + "noDuplicateObjectKeys": "off", + "noDuplicateParameters": "off", + "noFunctionAssign": "off", + "noImportAssign": "off", + "noRedeclare": "off", + "noUnsafeNegation": "off", + "useGetterReturn": "off" + } + } + } + } + ] +} diff --git a/bun.lockb b/bun.lockb index 4d33e23..3c94f28 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/bunfig.toml b/bunfig.toml deleted file mode 100644 index 6517a5c..0000000 --- a/bunfig.toml +++ /dev/null @@ -1,2 +0,0 @@ -[install] -registry = "https://registry.npmmirror.com/" diff --git a/i18n-metadata.ts b/i18n-metadata.ts index 1c3c804..16a1daf 100644 --- a/i18n-metadata.ts +++ b/i18n-metadata.ts @@ -6,19 +6,6 @@ export const localeItems = [ { code: "ja", name: "日本語" }, { code: "zh-t", name: "中文繁體" }, { code: "zh", name: "中文简体" }, - //{code: 'ar', name: 'العربية'}, - //{code: 'de', name: 'Deutsch'}, - //{code: 'es', name: 'Español'}, - //{code: 'fr', name: 'Français'}, - //{code: 'hi', name: 'हिन्दी'}, - //{code: 'id', name: 'Bahasa Indonesia'}, - //{code: 'it', name: 'Italiano'}, - //{code: 'ko', name: '한국어'}, - //{code: 'ms', name: 'Bahasa Melayu'}, - //{code: 'pt', name: 'Português'}, - //{code: 'ru', name: 'Русский'}, - //{code: 'th', name: 'ไทย'}, - //{code: 'vi', name: 'Tiếng Việt'}, ] export const locales = localeItems.map((item) => item.code) diff --git a/package.json b/package.json index d27823e..b9e2c28 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,11 @@ "scripts": { "dev": "next dev -p 3040", "start": "node .next/standalone/server.js", - "lint": "next lint", - "lint:fix": "next lint --fix", - "format": "prettier --write .", + "lint": "biome lint", + "lint:fix": "biome lint --fix", + "format": "biome format --write .", + "check": "biome check", + "check:fix": "biome check --fix", "build": "next build && cp -r .next/static .next/standalone/.next/ && cp -r public .next/standalone/", "build-dev": "next build", "start-dev": "next start" @@ -60,6 +62,7 @@ "typescript-eslint": "^8.18.2" }, "devDependencies": { + "@biomejs/biome": "1.9.4", "@next/bundle-analyzer": "^15.1.2", "@tailwindcss/postcss": "^4.0.0-beta.8", "@types/node": "^22.10.2",