From d5e2973dce617f451e4eb07491b3a6874ea6ca47 Mon Sep 17 00:00:00 2001 From: xuatz Date: Sun, 22 Jun 2025 20:29:30 +0900 Subject: chore: migrate away from eslint to oxlint (#1642) * chore: migrate away from eslint to oxlint * revert turbo task name lint * it seems like we can remove the seemingly default globals --- apps/mobile/.oxlintrc.json | 39 +++++++++++++++++++++++ apps/mobile/app/dashboard/bookmarks/new.tsx | 2 +- apps/mobile/components/bookmarks/BookmarkCard.tsx | 2 +- apps/mobile/package.json | 20 ++---------- 4 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 apps/mobile/.oxlintrc.json (limited to 'apps/mobile') diff --git a/apps/mobile/.oxlintrc.json b/apps/mobile/.oxlintrc.json new file mode 100644 index 00000000..dc4ad1e1 --- /dev/null +++ b/apps/mobile/.oxlintrc.json @@ -0,0 +1,39 @@ +{ + "$schema": "../../node_modules/oxlint/configuration_schema.json", + "extends": [ + "../../tooling/oxlint/oxlint-base.json", + "../../tooling/oxlint/oxlint-react.json" + ], + "categories": { + "correctness": "warn" + }, + "env": { + "builtin": true, + "commonjs": true, + "browser": true, + "es2022": true, + "node": true + }, + "globals": { + "React": "writeable" + }, + "settings": { + "react": { + "version": "detect" + } + }, + "ignorePatterns": [ + "**/*.config.js", + "**/*.config.cjs", + "**/.eslintrc.cjs", + "tailwind.config.ts", + ".next", + "dist", + "build", + "pnpm-lock.yaml", + "expo-plugins/**", + "ios/**", + "android/**", + "plugins/**" + ] +} diff --git a/apps/mobile/app/dashboard/bookmarks/new.tsx b/apps/mobile/app/dashboard/bookmarks/new.tsx index e821555a..d24c1597 100644 --- a/apps/mobile/app/dashboard/bookmarks/new.tsx +++ b/apps/mobile/app/dashboard/bookmarks/new.tsx @@ -48,7 +48,7 @@ const NoteEditorPage = () => { throw new Error(`Unsupported URL protocol: ${url.protocol}`); } createBookmark({ type: BookmarkTypes.LINK, url: data }); - } catch (e: unknown) { + } catch { createBookmark({ type: BookmarkTypes.TEXT, text: data }); } }; diff --git a/apps/mobile/components/bookmarks/BookmarkCard.tsx b/apps/mobile/components/bookmarks/BookmarkCard.tsx index 5b118f43..52d39c5c 100644 --- a/apps/mobile/components/bookmarks/BookmarkCard.tsx +++ b/apps/mobile/components/bookmarks/BookmarkCard.tsx @@ -224,7 +224,7 @@ function LinkCard({ } else { imageComp = ( diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 426df353..f60b77a3 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -10,8 +10,8 @@ "web": "expo start --web", "format": "prettier .", "format:fix": "prettier . --write", - "lint": "eslint .", - "lint:fix": "eslint . --fix", + "lint": "oxlint .", + "lint:fix": "oxlint . --fix", "typecheck": "tsc --noEmit" }, "dependencies": { @@ -61,31 +61,15 @@ }, "devDependencies": { "@babel/core": "~7.26.0", - "@karakeep/eslint-config": "workspace:^0.2.0", "@karakeep/prettier-config": "workspace:^0.1.0", "@karakeep/tailwind-config": "workspace:^0.1.0", "@karakeep/tsconfig": "workspace:^0.1.0", "@types/react": "^18.3.12", "ajv": "latest", - "eslint": "^8.57.0", - "eslint-config-universe": "^12.0.0", "prettier": "^3.4.2", "tailwindcss": "^3.4.1", "typescript": "^5.7.3" }, "private": true, - "eslintConfig": { - "root": true, - "extends": [ - "@karakeep/eslint-config/base", - "@karakeep/eslint-config/react" - ], - "ignorePatterns": [ - "expo-plugins/**", - "ios/**", - "android/**", - "plugins/**" - ] - }, "prettier": "@karakeep/prettier-config" } -- cgit v1.2.3-70-g09d2