From ccf0663613889649f4f0d12c22d6c4eb5e43c28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Curley?= Date: Thu, 26 Mar 2026 15:26:57 +0000 Subject: [PATCH] stuff --- .oxlintrc.json | 3 --- app/routes/home.tsx | 16 ++++++++-------- opencode.json | 13 +++++++++++++ tsconfig.json | 7 +------ 4 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 opencode.json diff --git a/.oxlintrc.json b/.oxlintrc.json index b99210f..f5e68cf 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,11 +1,9 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", - "plugins": null, "categories": {}, "rules": {}, "settings": { "jsx-a11y": { - "polymorphicPropName": null, "components": {}, "attributes": {} }, @@ -15,7 +13,6 @@ "react": { "formComponents": [], "linkComponents": [], - "version": null, "componentWrapperFunctions": [] }, "jsdoc": { diff --git a/app/routes/home.tsx b/app/routes/home.tsx index 32da3af..bdecba3 100644 --- a/app/routes/home.tsx +++ b/app/routes/home.tsx @@ -1,4 +1,4 @@ -import { useQuery } from "@tanstack/react-query"; +import { queryOptions, useQuery } from "@tanstack/react-query"; import type { Route } from "./+types/home"; export function meta(_: Route.MetaArgs) { @@ -21,11 +21,13 @@ async function fetchPosts(): Promise { return res.json(); } +const postsQueryOptions = queryOptions({ + queryKey: ["posts"] as const, + queryFn: fetchPosts, +}); + export default function Home() { - const { data, isPending, isError, error, refetch, isFetching } = useQuery({ - queryKey: ["posts"], - queryFn: fetchPosts, - }); + const { data, isPending, isError, error, refetch, isFetching } = useQuery(postsQueryOptions); return (
@@ -42,9 +44,7 @@ export default function Home() { {isPending &&

Loading posts…

} - {isError && ( -

Error: {error.message}

- )} + {isError &&

Error: {error.message}

} {data && (
    diff --git a/opencode.json b/opencode.json new file mode 100644 index 0000000..d2e5642 --- /dev/null +++ b/opencode.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://opencode.ai/config.json", + "lsp": { + "oxlint": { + "command": ["pnpm", "dlx", "oxlint", "--lsp"], + "extensions": ["ts", "tsx"] + }, + "oxfmt": { + "command": ["pnpm", "dlx", "oxfmt", "--lsp"], + "extensions": ["ts", "tsx", "json"] + } + } +} diff --git a/tsconfig.json b/tsconfig.json index cbe49c7..438d26f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,5 @@ { - "include": [ - "**/*", - "**/.server/**/*", - "**/.client/**/*", - ".react-router/types/**/*" - ], + "include": ["**/*", "**/.server/**/*", "**/.client/**/*", ".react-router/types/**/*"], "compilerOptions": { "lib": ["DOM", "DOM.Iterable", "ES2022"], "types": ["node", "vite/client"], -- knotmirror 0.0.1