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
This commit is contained in:
xuatz
2025-06-22 20:29:30 +09:00
committed by GitHub
parent 91a9d3c1ae
commit d5e2973dce
70 changed files with 1175 additions and 1696 deletions

12
.oxlintrc.json Normal file
View File

@@ -0,0 +1,12 @@
{
"$schema": "node_modules/oxlint/configuration_schema.json",
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -0,0 +1,34 @@
{
"$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",
".next",
"dist",
"build",
"pnpm-lock.yaml"
]
}

View File

@@ -8,8 +8,8 @@
"build": "tsc && vite build",
"format": "prettier .",
"format:fix": "prettier . --write",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint:fix": "eslint . --ext ts,tsx --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"preview": "vite preview",
"typecheck": "tsc --noEmit"
},
@@ -41,7 +41,6 @@
},
"devDependencies": {
"@crxjs/vite-plugin": "2.0.0-beta.28",
"@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",
@@ -50,20 +49,10 @@
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.17",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"typescript": "^5.7.3",
"vite": "^5.1.0"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base",
"@karakeep/eslint-config/react"
]
},
"prettier": "@karakeep/prettier-config"
}

22
apps/cli/.oxlintrc.json Normal file
View File

@@ -0,0 +1,22 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -15,7 +15,6 @@
},
"devDependencies": {
"@commander-js/extra-typings": "^12.0.1",
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/shared": "workspace:^0.1.0",
"@karakeep/trpc": "workspace:^0.1.0",
@@ -33,8 +32,8 @@
"scripts": {
"build": "vite build",
"run": "tsx src/index.ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"format": "prettier . --ignore-path ../../.prettierignore",
"format:fix": "prettier . --write --ignore-path ../../.prettierignore",
"typecheck": "tsc --noEmit"
@@ -44,11 +43,5 @@
"url": "git+https://github.com/karakeep-app/karakeep.git",
"directory": "apps/cli"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -261,7 +261,7 @@ bookmarkCmd
results = [...results, ...resp.bookmarks];
}
printObject(results.map(normalizeBookmark), { maxArrayLength: null });
} catch (e) {
} catch {
printStatusMessage(false, "Failed to query bookmarks");
}
});

View File

@@ -0,0 +1,34 @@
{
"$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",
".next",
"dist",
"build",
"pnpm-lock.yaml"
]
}

View File

@@ -8,8 +8,8 @@
"dev": "vite",
"build": "tsc -b && vite build",
"preview": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"format": "prettier . --ignore-path ../../.prettierignore",
"format:fix": "prettier . --ignore-path ../../.prettierignore --write",
"typecheck": "tsc --noEmit"
@@ -28,7 +28,6 @@
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@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",
@@ -42,12 +41,5 @@
"vite": "^5.1.0",
"vite-plugin-svgr": "^4.3.0"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base",
"@karakeep/eslint-config/react"
]
},
"prettier": "@karakeep/prettier-config"
}

22
apps/mcp/.oxlintrc.json Normal file
View File

@@ -0,0 +1,22 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -14,7 +14,6 @@
"karakeep-mcp": "dist/index.js"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0",
"@tsconfig/node22": "^22.0.0",
@@ -26,8 +25,8 @@
"scripts": {
"build": "vite build && shx chmod +x dist/index.js",
"run": "tsx src/index.ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"format": "prettier . --ignore-path ../../.prettierignore",
"format:fix": "prettier . --write --ignore-path ../../.prettierignore",
"typecheck": "tsc --noEmit"
@@ -37,12 +36,6 @@
"url": "git+https://github.com/karakeep-app/karakeep.git",
"directory": "apps/mcp"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
]
},
"prettier": "@karakeep/prettier-config",
"dependencies": {
"@karakeep/sdk": "workspace:*",

View File

@@ -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/**"
]
}

View File

@@ -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 });
}
};

View File

@@ -224,7 +224,7 @@ function LinkCard({
} else {
imageComp = (
<Image
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
// oxlint-disable-next-line no-require-imports
source={require("@/assets/blur.jpeg")}
className="h-56 w-full rounded-t-lg"
/>

View File

@@ -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"
}

35
apps/web/.oxlintrc.json Normal file
View File

@@ -0,0 +1,35 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json",
"../../tooling/oxlint/oxlint-nextjs.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",
".next",
"dist",
"build",
"pnpm-lock.yaml"
]
}

View File

@@ -4,6 +4,7 @@ import { useTranslation } from "@/lib/i18n/server";
import { Paintbrush, Tags } from "lucide-react";
export default async function Cleanups() {
// oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
return (

View File

@@ -5,6 +5,7 @@ import { api } from "@/server/api/client";
import { Highlighter } from "lucide-react";
export default async function HighlightsPage() {
// oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
const highlights = await api.highlights.getAll({});
return (

View File

@@ -4,6 +4,7 @@ import { useTranslation } from "@/lib/i18n/server";
import { api } from "@/server/api/client";
export default async function ListsPage() {
// oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
const lists = await api.lists.list();

View File

@@ -4,6 +4,7 @@ import { useTranslation } from "@/lib/i18n/server";
import { api } from "@/server/api/client";
export default async function TagsPage() {
// oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
const allTags = (await api.tags.list()).tags;

View File

@@ -132,7 +132,7 @@ export default function EditorCard({ className }: { className?: string }) {
if (!text.length) return;
try {
tryToImportUrls(text);
} catch (e) {
} catch {
// Not a URL
mutate({ type: BookmarkTypes.TEXT, text });
}

View File

@@ -192,7 +192,11 @@ export function EditListModal({
(value: z.infer<typeof zNewBookmarkListSchema>) => {
value.parentId = value.parentId === "" ? null : value.parentId;
value.query = value.type === "smart" ? value.query : undefined;
isEdit ? editList({ ...value, listId: list.id }) : createList(value);
if (isEdit) {
editList({ ...value, listId: list.id });
} else {
createList(value);
}
},
);

View File

@@ -1,3 +1,4 @@
import { Fragment } from "react";
import {
Collapsible,
CollapsibleContent,
@@ -28,10 +29,10 @@ export default function HighlightsBox({ bookmarkId }: { bookmarkId: string }) {
</CollapsibleTrigger>
<CollapsibleContent className="group flex flex-col py-3 text-sm">
{highlights.highlights.map((highlight) => (
<>
<HighlightCard key={highlight.id} highlight={highlight} clickable />
<Fragment key={highlight.id}>
<HighlightCard highlight={highlight} clickable />
<Separator className="m-2 h-0.5 bg-gray-200 last:hidden" />
</>
</Fragment>
))}
</CollapsibleContent>
</Collapsible>

View File

@@ -13,6 +13,7 @@ import AddApiKey from "./AddApiKey";
import DeleteApiKey from "./DeleteApiKey";
export default async function ApiKeys() {
// oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
const keys = await api.apiKeys.list();
return (

View File

@@ -282,7 +282,7 @@ export function ImportExportRow() {
};
});
return { status: "fulfilled" as const, value: created };
} catch (e) {
} catch {
setImportProgress((prev) => {
const newDone = (prev?.done ?? 0) + 1;
return {

View File

@@ -7,6 +7,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
import { Label } from "../ui/label";
export default async function UserDetails() {
// oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
const whoami = await api.users.whoami();

View File

@@ -9,6 +9,7 @@ export default async function MobileSidebar({
}: {
items: (t: TFunction) => TSidebarItem[];
}) {
// oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
return (
<aside className="w-full overflow-x-auto">

View File

@@ -14,6 +14,7 @@ export default async function Sidebar({
items: (t: TFunction) => TSidebarItem[];
extraSections?: React.ReactNode;
}) {
// oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
return (

View File

@@ -54,7 +54,7 @@ export function CopyBtnV2({
await navigator.clipboard.writeText(url);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch (err) {
} catch {
toast({
description:
"Failed to copy link. Browsers only support copying to the clipboard from https pages.",

View File

@@ -39,7 +39,7 @@ export async function parseNetscapeBookmarkFile(
const tagsStr = $a.attr("tags");
try {
tags = tagsStr && tagsStr.length > 0 ? tagsStr.split(",") : [];
} catch (e) {
} catch {
/* empty */
}
const url = $a.attr("href");

View File

@@ -15,7 +15,7 @@ export type UserLocalSettings = z.infer<typeof zUserLocalSettings>;
export function parseUserLocalSettings(str: string | undefined) {
try {
return zUserLocalSettings.parse(JSON.parse(str ?? "{}"));
} catch (e) {
} catch {
return undefined;
}
}

View File

@@ -9,12 +9,12 @@
"clean": "git clean -xdf .next .turbo node_modules",
"build": "next build --experimental-build-mode compile",
"start": "next start",
"lint": "next lint",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"test": "vitest",
"typecheck": "tsc --noEmit",
"format": "prettier --check . --ignore-path ../../.gitignore",
"format:fix": "prettier --write . --ignore-path ../../.gitignore",
"lint:fix": "next lint --fix"
"format:fix": "prettier --write . --ignore-path ../../.gitignore"
},
"dependencies": {
"@auth/drizzle-adapter": "~1.5.0",
@@ -96,7 +96,6 @@
"zustand": "^4.5.1"
},
"devDependencies": {
"@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",
@@ -112,13 +111,5 @@
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.6.1"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base",
"@karakeep/eslint-config/nextjs",
"@karakeep/eslint-config/react"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -25,7 +25,7 @@ export async function createContextFromRequest(req: Request) {
ip,
},
};
} catch (e) {
} catch {
// Fallthrough to cookie-based auth
}
}

View File

@@ -0,0 +1,22 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -46,7 +46,6 @@
"zod": "^3.24.2"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@types/jsdom": "^21.1.6",
"@types/metascraper": "^5.14.3",
@@ -55,17 +54,11 @@
"scripts": {
"start": "tsx watch index.ts",
"start:prod": "tsx index.ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"format": "prettier . --ignore-path ../../.prettierignore",
"format:fix": "prettier . --ignore-path ../../.prettierignore --write",
"typecheck": "tsc --noEmit"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -697,7 +697,7 @@ async function crawlAndParseUrl(
}
try {
return new Date(date);
} catch (_e) {
} catch {
return null;
}
};

View File

@@ -150,7 +150,7 @@ async function run(req: DequeuedJob<ZFeedRequestSchema>) {
// For feeds that don't have guids, use the link as the id
feedItems.forEach((item) => {
item.guid = item.guid ?? `${item.id}` ?? item.link;
item.guid = item.guid ?? item.id ?? item.link;
});
const exitingEntries = await db.query.rssFeedImportsTable.findMany({

View File

@@ -193,7 +193,7 @@ async function deleteLeftOverAssetFile(
);
try {
await fs.promises.rm(assetFile);
} catch (e) {
} catch {
logger.error(
`[VideoCrawler][${jobId}] Failed deleting leftover video asset "${assetFile}".`,
);

35
docs/.oxlintrc.json Normal file
View File

@@ -0,0 +1,35 @@
{
"$schema": "../node_modules/oxlint/configuration_schema.json",
"extends": [
"../tooling/oxlint/oxlint-base.json",
"../tooling/oxlint/oxlint-nextjs.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",
".next",
"dist",
"build",
"pnpm-lock.yaml"
]
}

View File

@@ -45,14 +45,6 @@
"last 5 safari version"
]
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base",
"@karakeep/eslint-config/nextjs",
"@karakeep/eslint-config/react"
]
},
"prettier": "@karakeep/prettier-config",
"engines": {
"node": ">=18.0"

View File

@@ -16,18 +16,17 @@
"prepare": "husky",
"format": "turbo --no-daemon format --continue -- --cache-location node_modules/.cache/.prettiercache",
"format:fix": "turbo --no-daemon format --continue -- --write --cache-location node_modules/.cache/.prettiercache",
"lint": "turbo --no-daemon lint --continue -- --cache-location node_modules/.cache/.eslintcache",
"lint:fix": "turbo --no-daemon lint --continue -- --fix --cache-location node_modules/.cache/.eslintcache",
"lint": "turbo --no-daemon lint --continue --",
"lint:fix": "turbo --no-daemon lint --continue -- --fix",
"typecheck": "turbo --no-daemon typecheck"
},
"devDependencies": {
"@karakeep/prettier-config": "workspace:^0.1.0",
"@tanstack/eslint-plugin-query": "^5.20.1",
"@types/node": "^22",
"es-errors": "^1.3.0",
"eslint": "^8.57.0",
"husky": "^9.0.11",
"install": "^0.13.0",
"oxlint": "^1.2.0",
"prettier": "^3.4.2",
"sherif": "^1.2.0",
"turbo": "^2.1.2"

View File

@@ -0,0 +1,22 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -8,8 +8,8 @@
"typecheck": "tsc --noEmit",
"format": "prettier . --ignore-path ../../.prettierignore",
"format:fix": "prettier . --write --ignore-path ../../.prettierignore",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"test": "vitest"
},
"dependencies": {
@@ -22,7 +22,6 @@
"zod": "^3.24.2"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0",
"@types/bcryptjs": "^2.4.6",
@@ -31,11 +30,5 @@
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.6.1"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -0,0 +1,22 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -20,18 +20,11 @@
"tsx": "^4.7.1"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0",
"@tsconfig/node22": "^22.0.0",
"@types/better-sqlite3": "^7.6.11",
"drizzle-kit": "^0.30.01"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -0,0 +1,22 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -8,8 +8,8 @@
"typecheck": "tsc --noEmit",
"format": "prettier . --ignore-path ../../.prettierignore",
"format:fix": "prettier . --write --ignore-path ../../.prettierignore",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"test": "vitest run",
"test:watch": "vitest"
},
@@ -19,17 +19,10 @@
"superjson": "^2.2.1"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.6.1"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -0,0 +1,22 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -10,7 +10,6 @@
"zod": "^3.24.2"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0",
"tsx": "^4.7.1"
@@ -20,14 +19,9 @@
"generate": "tsx index.ts",
"format": "prettier . --ignore-path ../../.prettierignore",
"format:fix": "prettier . --write --ignore-path ../../.prettierignore",
"lint": "eslint ."
"lint": "oxlint .",
"lint:fix": "oxlint . --fix"
},
"main": "index.ts",
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -0,0 +1,23 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml",
"src/karakeep-api.d.ts"
]
}

View File

@@ -18,7 +18,6 @@
"types": "./dist/index.d.ts"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0",
"@tsconfig/node22": "^22.0.0",
@@ -30,8 +29,8 @@
"scripts": {
"build": "vite build",
"run": "tsx src/index.ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"format": "prettier . --ignore-path ../../.prettierignore",
"format:fix": "prettier . --write --ignore-path ../../.prettierignore",
"typecheck": "tsc --noEmit"
@@ -41,15 +40,6 @@
"url": "git+https://github.com/karakeep-app/karakeep.git",
"directory": "packages/sdk"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
],
"ignorePatterns": [
"src/karakeep-api.d.ts"
]
},
"prettier": "@karakeep/prettier-config",
"dependencies": {
"openapi-fetch": "^0.13.3"

View File

@@ -0,0 +1,34 @@
{
"$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",
".next",
"dist",
"build",
"pnpm-lock.yaml"
]
}

View File

@@ -11,7 +11,6 @@
"superjson": "^2.2.1"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0"
},
@@ -27,14 +26,7 @@
"scripts": {
"typecheck": "tsc --noEmit",
"format": "prettier . --ignore-path ../../.prettierignore",
"lint": "eslint ."
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base",
"@karakeep/eslint-config/react"
]
"lint": "oxlint ."
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -0,0 +1,22 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -17,7 +17,6 @@
"zod-to-json-schema": "^3.24.3"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0",
"vitest": "^1.6.1"
@@ -26,16 +25,10 @@
"typecheck": "tsc --noEmit",
"format": "prettier . --ignore-path ../../.prettierignore",
"format:fix": "prettier . --write --ignore-path ../../.prettierignore",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"test": "vitest"
},
"main": "index.ts",
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -224,7 +224,7 @@ MATCHER.setPattern(
inverse: !!minus,
},
};
} catch (e) {
} catch {
return {
// If parsing the date fails, emit it as pure text
text: (minus?.text ?? "") + qualifier.text + ident,
@@ -241,7 +241,7 @@ MATCHER.setPattern(
inverse: !!minus,
},
};
} catch (e) {
} catch {
return {
// If parsing the date fails, emit it as pure text
text: (minus?.text ?? "") + qualifier.text + ident,
@@ -258,7 +258,7 @@ MATCHER.setPattern(
relativeDate: { direction, amount, unit },
},
};
} catch (e) {
} catch {
return {
// If parsing the relative time fails, emit it as pure text
text: (minus?.text ?? "") + qualifier.text + ident,

View File

@@ -0,0 +1,22 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": [
"../../tooling/oxlint/oxlint-base.json"
],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -8,8 +8,8 @@
"typecheck": "tsc --noEmit",
"format": "prettier . --ignore-path ../../.prettierignore",
"format:fix": "prettier . --write --ignore-path ../../.prettierignore",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"test": "vitest"
},
"dependencies": {
@@ -24,7 +24,6 @@
"zod": "^3.24.2"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0",
"@types/bcryptjs": "^2.4.6",
@@ -32,11 +31,5 @@
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.6.1"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -178,7 +178,7 @@ export const usersAppRouter = router({
let user;
try {
user = await validatePassword(ctx.user.email, input.currentPassword);
} catch (e) {
} catch {
throw new TRPCError({ code: "UNAUTHORIZED" });
}
invariant(user.id, ctx.user.id);

1790
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +0,0 @@
/** @type {import("eslint").Linter.Config} */
const config = {
extends: [
"turbo",
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
],
env: {
es2022: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: { project: true },
plugins: ["@typescript-eslint", "import"],
rules: {
"turbo/no-undeclared-env-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/no-misused-promises": [
2,
{ checksVoidReturn: { attributes: false } },
],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/prefer-optional-chain": "off",
},
ignorePatterns: [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
".next",
"dist",
"build",
"pnpm-lock.yaml",
],
reportUnusedDisableDirectives: true,
};
module.exports = config;

View File

@@ -1,10 +0,0 @@
/** @type {import('eslint').Linter.Config} */
const config = {
extends: ["plugin:@next/next/core-web-vitals"],
rules: {
"@next/next/no-html-link-for-pages": "off",
"@typescript-eslint/require-await": "off",
},
};
module.exports = config;

View File

@@ -1,42 +0,0 @@
{
"name": "@karakeep/eslint-config",
"version": "0.2.0",
"private": true,
"license": "MIT",
"files": [
"./base.js",
"./nextjs.js",
"./react.js"
],
"scripts": {
"clean": "rm -rf .turbo node_modules",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint .",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@next/eslint-plugin-next": "^14.1.1",
"@typescript-eslint/eslint-plugin": "~8.30.0",
"@typescript-eslint/parser": "~8.30.0",
"eslint-config-turbo": "^2.0.9",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0"
},
"devDependencies": {
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0",
"@types/eslint": "^8.56.5",
"eslint": "^8.57.0",
"prettier": "^3.4.2",
"typescript": "^5.7.3"
},
"eslintConfig": {
"root": true,
"extends": [
"./base.js"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -1,27 +0,0 @@
/** @type {import('eslint').Linter.Config} */
const config = {
extends: [
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
],
rules: {
"react/prop-types": "off",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/label-has-associated-control": "off",
"react-hooks/exhaustive-deps": "off",
},
globals: {
React: "writable",
},
settings: {
react: {
version: "detect",
},
},
env: {
browser: true,
},
};
module.exports = config;

View File

@@ -1,8 +0,0 @@
{
"extends": "@karakeep/tsconfig/base.json",
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
},
"include": ["."],
"exclude": ["node_modules"]
}

View File

@@ -0,0 +1,130 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"plugins": [
"typescript",
"import"
],
"rules": {
"for-direction": "error",
"no-async-promise-executor": "error",
"no-case-declarations": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-const-assign": "error",
"no-constant-binary-expression": "error",
"no-constant-condition": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-class-members": "error",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-empty-static-block": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-import-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-new-native-nonconstructor": "error",
"no-nonoctal-decimal-escape": "error",
"no-obj-calls": "error",
"no-prototype-builtins": "error",
"no-redeclare": "error",
"no-regex-spaces": "error",
"no-self-assign": "error",
"no-setter-return": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "error",
"no-unexpected-multiline": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-labels": "error",
"no-unused-private-class-members": "error",
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-escape": "error",
"no-with": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
"@typescript-eslint/ban-ts-comment": "error",
"no-array-constructor": "error",
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unsafe-declaration-merging": "error",
"@typescript-eslint/no-unsafe-function-type": "error",
"no-unused-expressions": "error",
"@typescript-eslint/no-wrapper-object-types": "error",
"no-throw-literal": "off",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"prefer-promise-reject-errors": "off",
"require-await": "off",
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/ban-tslint-comment": "error",
"@typescript-eslint/consistent-generic-constructors": "error",
"@typescript-eslint/consistent-indexed-object-style": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"no-empty-function": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/consistent-type-imports": "off",
"import/consistent-type-specifier-style": [
"error",
"prefer-top-level"
]
},
"overrides": [
{
"files": ["**/*"],
"rules": {
"no-class-assign": "off",
"no-const-assign": "off",
"no-dupe-class-members": "off",
"no-dupe-keys": "off",
"no-func-assign": "off",
"no-import-assign": "off",
"no-new-native-nonconstructor": "off",
"no-obj-calls": "off",
"no-redeclare": "off",
"no-setter-return": "off",
"no-this-before-super": "off",
"no-unsafe-negation": "off",
"no-var": "error",
"no-with": "off",
"prefer-rest-params": "error",
"prefer-spread": "error"
}
}
]
}

View File

@@ -0,0 +1,28 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"plugins": [
"nextjs"
],
"rules": {
"@next/next/google-font-display": "warn",
"@next/next/google-font-preconnect": "warn",
"@next/next/next-script-for-ga": "warn",
"@next/next/no-async-client-component": "warn",
"@next/next/no-before-interactive-script-outside-document": "warn",
"@next/next/no-css-tags": "warn",
"@next/next/no-head-element": "warn",
"@next/next/no-img-element": "warn",
"@next/next/no-page-custom-font": "warn",
"@next/next/no-styled-jsx-in-document": "warn",
"@next/next/no-sync-scripts": "error",
"@next/next/no-title-in-document-head": "warn",
"@next/next/no-typos": "warn",
"@next/next/no-unwanted-polyfillio": "warn",
"@next/next/inline-script-id": "error",
"@next/next/no-assign-module-variable": "error",
"@next/next/no-document-import-in-page": "error",
"@next/next/no-duplicate-head": "error",
"@next/next/no-head-import-in-document": "error",
"@next/next/no-script-component-in-head": "error"
}
}

View File

@@ -0,0 +1,62 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"plugins": [
"react",
"jsx-a11y"
],
"rules": {
"react/prop-types": "off",
"react/jsx-key": "warn",
"react/jsx-no-comment-textnodes": "warn",
"react/jsx-no-duplicate-props": "warn",
"react/jsx-no-target-blank": "warn",
"react/jsx-no-undef": "warn",
"react/no-children-prop": "warn",
"react/no-danger-with-children": "warn",
"react/no-direct-mutation-state": "warn",
"react/no-find-dom-node": "warn",
"react/no-is-mounted": "warn",
"react/no-render-return-value": "warn",
"react/no-string-refs": "warn",
"react/no-unescaped-entities": "warn",
"react/no-unknown-property": "warn",
"react/react-in-jsx-scope": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "off",
"jsx-a11y/alt-text": "error",
"jsx-a11y/anchor-ambiguous-text": "off",
"jsx-a11y/anchor-has-content": "error",
"jsx-a11y/anchor-is-valid": "error",
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
"jsx-a11y/aria-props": "error",
"jsx-a11y/aria-role": "error",
"jsx-a11y/aria-unsupported-elements": "error",
"jsx-a11y/autocomplete-valid": "error",
"jsx-a11y/click-events-have-key-events": "error",
"jsx-a11y/heading-has-content": "error",
"jsx-a11y/html-has-lang": "error",
"jsx-a11y/iframe-has-title": "off",
"jsx-a11y/img-redundant-alt": "error",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/media-has-caption": "error",
"jsx-a11y/mouse-events-have-key-events": "error",
"jsx-a11y/no-access-key": "error",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/no-distracting-elements": "error",
"jsx-a11y/no-noninteractive-tabindex": [
"error",
{
"tags": [],
"roles": [
"tabpanel"
],
"allowExpressionValues": true
}
],
"jsx-a11y/no-redundant-roles": "error",
"jsx-a11y/role-has-required-aria-props": "warn",
"jsx-a11y/role-supports-aria-props": "error",
"jsx-a11y/scope": "error",
"jsx-a11y/tabindex-no-positive": "error"
}
}

View File

@@ -0,0 +1,20 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": ["../../tooling/oxlint/oxlint-base.json"],
"categories": {
"correctness": "warn"
},
"env": {
"builtin": true,
"commonjs": true
},
"ignorePatterns": [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"**/.next",
"**/dist",
"**/build",
"**/pnpm-lock.yaml"
]
}

View File

@@ -11,8 +11,10 @@
"license": "MIT",
"scripts": {
"clean": "rm -rf .turbo node_modules",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint .",
"format": "prettier .",
"format:fix": "prettier . --write",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -23,18 +25,10 @@
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@karakeep/eslint-config": "workspace:^0.2.0",
"@karakeep/prettier-config": "workspace:^0.1.0",
"@karakeep/tsconfig": "workspace:^0.1.0",
"eslint": "^8.57.0",
"prettier": "^3.4.2",
"typescript": "^5.7.3"
},
"eslintConfig": {
"root": true,
"extends": [
"@karakeep/eslint-config/base"
]
},
"prettier": "@karakeep/prettier-config"
}

View File

@@ -35,9 +35,6 @@
"lint": {
"dependsOn": [
"^topo"
],
"outputs": [
"node_modules/.cache/.eslintcache"
]
},
"typecheck": {