From 408cd9ce4b086c18d806301ec47af2d59249dce0 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Fri, 13 Dec 2024 15:19:21 +0800 Subject: [PATCH] fix: lint --- auth.ts | 2 +- bun.lockb | Bin 618282 -> 618282 bytes eslint.config.js | 20 ++++++++++++++++++++ package.json | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 eslint.config.js diff --git a/auth.ts b/auth.ts index 0dd5b26df..8b5698f76 100644 --- a/auth.ts +++ b/auth.ts @@ -22,7 +22,7 @@ export const { handlers, signIn, signOut, auth } = NextAuth({ ], callbacks: { async signIn({ user }) { - // @ts-ignore + // @ts-expect-error user is not null if (user.error) { return false } diff --git a/bun.lockb b/bun.lockb index 3278b7fb5041340bc2fd665212272d97d7da87bb..49affa214770d9ff96adb5d70bcebb0b2f01b5a0 100755 GIT binary patch delta 46 vcmZ2=Pj%Hj)rJF7M3lni{EiDF+f23>UXR_%m&2l+gHEisBZuOmFp4` delta 46 zcmZ2=Pj%Hj)rJF7M3lni{EiD##!nan&}y|uYSi0#B4y!zJ2vOj`{`wxJ472 diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..0f7515f1d --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,20 @@ +import js from "@eslint/js" +import globals from "globals" +import tseslint from "typescript-eslint" + +export default tseslint.config( + { ignores: [".next"] }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ["**/*.{ts,tsx}"], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + rules: { + "@typescript-eslint/no-explicit-any": "off", + "@next/next/no-img-element": "off", + "react-hooks/exhaustive-deps": "off", + }, + }, +) diff --git a/package.json b/package.json index 9928853dc..05b603287 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "nezha-dash", "version": "1.8.1", "private": true, + "type": "module", "scripts": { "dev": "next dev -p 3040", "start": "node .next/standalone/server.js",