fixed all warnings :D

This commit is contained in:
Oliver Bryan
2025-12-31 18:08:47 +00:00
parent 70ef02f790
commit 8b6dad8a2a
23 changed files with 138 additions and 145 deletions

View File

@@ -1,5 +1,5 @@
{ {
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json", "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
"formatter": { "formatter": {
"enabled": true, "enabled": true,
"formatWithErrors": false, "formatWithErrors": false,
@@ -11,5 +11,8 @@
"parser": { "parser": {
"tailwindDirectives": true "tailwindDirectives": true
} }
},
"files": {
"includes": ["**", "!packages/shared/dist"]
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"root": false, "root": false,
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json", "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
"formatter": { "formatter": {
"enabled": true, "enabled": true,
"formatWithErrors": false, "formatWithErrors": false,
@@ -12,5 +12,8 @@
"parser": { "parser": {
"tailwindDirectives": true "tailwindDirectives": true
} }
},
"files": {
"includes": ["**", "!drizzle/meta"]
} }
} }

View File

@@ -6,6 +6,6 @@ export default defineConfig({
schema: "../shared/src/schema.ts", schema: "../shared/src/schema.ts",
dialect: "postgresql", dialect: "postgresql",
dbCredentials: { dbCredentials: {
url: process.env.DATABASE_URL!, url: process.env.DATABASE_URL || "",
}, },
}); });

View File

@@ -17,6 +17,7 @@ export const testDB = async () => {
console.log("db connected"); console.log("db connected");
} catch (err) { } catch (err) {
console.log("db down"); console.log("db down");
console.error(err);
process.exit(); process.exit();
} }
}; };

View File

@@ -1,7 +1,7 @@
import type { BunRequest } from "bun"; import type { BunRequest } from "bun";
import { getIssues } from "../../db/queries"; import { getIssues } from "../../db/queries";
export default async function issuesAll(req: BunRequest) { export default async function issuesAll(_req: BunRequest) {
const issues = await getIssues(); const issues = await getIssues();
return Response.json(issues); return Response.json(issues);

View File

@@ -2,7 +2,7 @@ import type { BunRequest } from "bun";
import { getProjectsWithCreators } from "../../db/queries"; import { getProjectsWithCreators } from "../../db/queries";
// /projects/all // /projects/all
export default async function projectsAll(req: BunRequest) { export default async function projectsAll(_req: BunRequest) {
const projects = await getProjectsWithCreators(); const projects = await getProjectsWithCreators();
return Response.json(projects); return Response.json(projects);

View File

@@ -1,5 +1,5 @@
import type { BunRequest } from "bun"; import type { BunRequest } from "bun";
import { getProjectByID, deleteProject } from "../../db/queries"; import { deleteProject, getProjectByID } from "../../db/queries";
// /project/delete?id=1 // /project/delete?id=1
export default async function projectDelete(req: BunRequest) { export default async function projectDelete(req: BunRequest) {

View File

@@ -2,7 +2,7 @@ import type { BunRequest } from "bun";
import { getProjectsWithCreators } from "../../db/queries"; import { getProjectsWithCreators } from "../../db/queries";
// /projects/with-creators // /projects/with-creators
export default async function projectsWithCreators(req: BunRequest) { export default async function projectsWithCreators(_req: BunRequest) {
const projects = await getProjectsWithCreators(); const projects = await getProjectsWithCreators();
return Response.json(projects); return Response.json(projects);

View File

@@ -1,29 +1,29 @@
{ {
"compilerOptions": { "compilerOptions": {
// Environment setup & latest features // Environment setup & latest features
"lib": ["ESNext"], "lib": ["ESNext"],
"target": "ESNext", "target": "ESNext",
"module": "Preserve", "module": "Preserve",
"moduleDetection": "force", "moduleDetection": "force",
"jsx": "react-jsx", "jsx": "react-jsx",
"allowJs": true, "allowJs": true,
// Bundler mode // Bundler mode
"moduleResolution": "bundler", "moduleResolution": "bundler",
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,
"verbatimModuleSyntax": true, "verbatimModuleSyntax": true,
"noEmit": true, "noEmit": true,
// Best practices // Best practices
"strict": true, "strict": true,
"skipLibCheck": true, "skipLibCheck": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true, "noUncheckedIndexedAccess": true,
"noImplicitOverride": true, "noImplicitOverride": true,
// Some stricter flags (disabled by default) // Some stricter flags (disabled by default)
"noUnusedLocals": false, "noUnusedLocals": false,
"noUnusedParameters": false, "noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false "noPropertyAccessFromIndexSignature": false
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"root": false, "root": false,
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json", "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
"formatter": { "formatter": {
"enabled": true, "enabled": true,
"formatWithErrors": false, "formatWithErrors": false,
@@ -12,5 +12,8 @@
"parser": { "parser": {
"tailwindDirectives": true "tailwindDirectives": true
} }
},
"files": {
"includes": ["**", "!src-tauri/target", "!src-tauri/gen"]
} }
} }

View File

@@ -1,10 +1,7 @@
{ {
"$schema": "../gen/schemas/desktop-schema.json", "$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default", "identifier": "default",
"description": "Capability for the main window", "description": "Capability for the main window",
"windows": ["main"], "windows": ["main"],
"permissions": [ "permissions": ["core:default", "opener:default"]
"core:default",
"opener:default"
]
} }

View File

@@ -1,31 +1,31 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "issue", "productName": "issue",
"version": "0.1.0", "version": "0.1.0",
"identifier": "com.hex248.issue", "identifier": "com.hex248.issue",
"build": { "build": {
"beforeDevCommand": "bun run dev", "beforeDevCommand": "bun run dev",
"devUrl": "http://localhost:1420", "devUrl": "http://localhost:1420",
"beforeBuildCommand": "bun run build", "beforeBuildCommand": "bun run build",
"frontendDist": "../dist" "frontendDist": "../dist"
}, },
"app": { "app": {
"windows": [ "windows": [
{ {
"title": "Issue Project Manager", "title": "Issue Project Manager",
"width": 1600, "width": 1600,
"height": 900, "height": 900,
"minWidth": 640, "minWidth": 640,
"minHeight": 360, "minHeight": 360,
"decorations": false "decorations": false
} }
], ],
"security": { "security": {
"csp": null "csp": null
}
},
"bundle": {
"active": true,
"targets": "all"
} }
},
"bundle": {
"active": true,
"targets": "all"
}
} }

View File

@@ -19,7 +19,6 @@ import {
} from "@/components/ui/dropdown-menu"; } from "@/components/ui/dropdown-menu";
import { ResizablePanel, ResizablePanelGroup, ResizableSeparator } from "@/components/ui/resizable"; import { ResizablePanel, ResizablePanelGroup, ResizableSeparator } from "@/components/ui/resizable";
import { issue, organisation, project } from "@/lib/server"; import { issue, organisation, project } from "@/lib/server";
import { getAuthHeaders, getServerURL } from "@/lib/utils";
function Index() { function Index() {
const user = JSON.parse(localStorage.getItem("user") || "{}") as UserRecord; const user = JSON.parse(localStorage.getItem("user") || "{}") as UserRecord;
@@ -132,7 +131,7 @@ function Index() {
setSelectedProject((prev) => prev || projects[0] || null); setSelectedProject((prev) => prev || projects[0] || null);
}, [projects]); }, [projects]);
const refetchIssues = async (projectKey: string) => { const refetchIssues = async () => {
try { try {
await issue.byProject({ await issue.byProject({
projectId: selectedProject?.Project.id || 0, projectId: selectedProject?.Project.id || 0,
@@ -155,7 +154,7 @@ function Index() {
useEffect(() => { useEffect(() => {
if (!selectedProject) return; if (!selectedProject) return;
void refetchIssues(selectedProject.Project.key); void refetchIssues();
}, [selectedProject]); }, [selectedProject]);
return ( return (
@@ -196,7 +195,7 @@ function Index() {
projectId={selectedProject?.Project.id} projectId={selectedProject?.Project.id}
completeAction={async () => { completeAction={async () => {
if (!selectedProject) return; if (!selectedProject) return;
await refetchIssues(selectedProject.Project.key); await refetchIssues();
}} }}
/> />
)} )}
@@ -235,7 +234,6 @@ function Index() {
<ResizablePanel id={"left"} minSize={400}> <ResizablePanel id={"left"} minSize={400}>
{/* issues list (table) */} {/* issues list (table) */}
<IssuesTable <IssuesTable
project={selectedProject}
issuesData={issues} issuesData={issues}
columns={{ description: false }} columns={{ description: false }}
issueSelectAction={setSelectedIssue} issueSelectAction={setSelectedIssue}

View File

@@ -3,7 +3,6 @@ import { useCallback, useEffect, useState } from "react";
import { OrganisationSelect } from "@/components/organisation-select"; import { OrganisationSelect } from "@/components/organisation-select";
import { SettingsPageLayout } from "@/components/settings-page-layout"; import { SettingsPageLayout } from "@/components/settings-page-layout";
import { organisation } from "@/lib/server"; import { organisation } from "@/lib/server";
import { getAuthHeaders, getServerURL } from "@/lib/utils";
function Organisations() { function Organisations() {
const user = JSON.parse(localStorage.getItem("user") || "{}") as UserRecord; const user = JSON.parse(localStorage.getItem("user") || "{}") as UserRecord;

View File

@@ -1,16 +1,14 @@
import type { IssueResponse, ProjectResponse } from "@issue/shared"; import type { IssueResponse } from "@issue/shared";
import Avatar from "@/components/avatar"; import Avatar from "@/components/avatar";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
export function IssuesTable({ export function IssuesTable({
project,
issuesData, issuesData,
columns = {}, columns = {},
issueSelectAction, issueSelectAction,
className, className,
}: { }: {
project: ProjectResponse;
issuesData: IssueResponse[]; issuesData: IssueResponse[];
columns?: { id?: boolean; title?: boolean; description?: boolean; assignee?: boolean }; columns?: { id?: boolean; title?: boolean; description?: boolean; assignee?: boolean };
issueSelectAction?: (issue: IssueResponse) => void; issueSelectAction?: (issue: IssueResponse) => void;

View File

@@ -1,4 +1,4 @@
import * as React from "react"; import type * as React from "react";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";

View File

@@ -1,22 +1,19 @@
import * as React from "react" import * as LabelPrimitive from "@radix-ui/react-label";
import * as LabelPrimitive from "@radix-ui/react-label" import type * as React from "react";
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils";
function Label({ function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
className, return (
...props <LabelPrimitive.Root
}: React.ComponentProps<typeof LabelPrimitive.Root>) { data-slot="label"
return ( className={cn(
<LabelPrimitive.Root "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
data-slot="label" className,
className={cn( )}
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", {...props}
className />
)} );
{...props}
/>
)
} }
export { Label } export { Label };

View File

@@ -1,4 +1,4 @@
import { Loader2Icon, Loader } from "lucide-react"; import { Loader } from "lucide-react";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";

View File

@@ -1,4 +1,4 @@
import * as React from "react"; import type * as React from "react";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";

View File

@@ -3,6 +3,6 @@ export * as organisation from "./organisation";
export * as project from "./project"; export * as project from "./project";
export type ServerQueryInput = { export type ServerQueryInput = {
onSuccess?: (data: any, res: Response) => void; onSuccess?: (data: unknown, res: Response) => void;
onError?: (error: any) => void; onError?: (error: unknown) => void;
}; };

View File

@@ -1,10 +1,10 @@
{ {
"compilerOptions": { "compilerOptions": {
"composite": true, "composite": true,
"skipLibCheck": true, "skipLibCheck": true,
"module": "ESNext", "module": "ESNext",
"moduleResolution": "bundler", "moduleResolution": "bundler",
"allowSyntheticDefaultImports": true "allowSyntheticDefaultImports": true
}, },
"include": ["vite.config.ts"] "include": ["vite.config.ts"]
} }

View File

@@ -1,9 +1,8 @@
import path from "path"; import path from "node:path";
import tailwindcss from "@tailwindcss/vite"; import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
// @ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST; const host = process.env.TAURI_DEV_HOST;
// https://vite.dev/config/ // https://vite.dev/config/
@@ -23,8 +22,8 @@ export default defineConfig(async () => ({
server: { server: {
port: 1420, port: 1420,
strictPort: true, strictPort: true,
allowedHosts: ["issue.ob248.com"], allowedHosts: ["issue.ob248.com"],
host: host || false, host: host || false,
hmr: host hmr: host
? { ? {
protocol: "ws", protocol: "ws",

View File

@@ -1,37 +1,32 @@
// Drizzle tables
export { User, Project, Issue, Organisation, OrganisationMember } from "./schema";
// Types
export type { export type {
UserRecord,
UserInsert,
OrganisationRecord,
OrganisationInsert,
OrganisationMemberRecord,
OrganisationMemberInsert,
ProjectRecord,
ProjectInsert,
IssueRecord,
IssueInsert, IssueInsert,
} from "./schema"; IssueRecord,
// Zod schemas
export {
UserSelectSchema,
UserInsertSchema,
OrganisationSelectSchema,
OrganisationInsertSchema,
OrganisationMemberSelectSchema,
OrganisationMemberInsertSchema,
ProjectSelectSchema,
ProjectInsertSchema,
IssueSelectSchema,
IssueInsertSchema,
} from "./schema";
// Responses
export type {
IssueResponse, IssueResponse,
ProjectResponse, OrganisationInsert,
OrganisationMemberInsert,
OrganisationMemberRecord,
OrganisationRecord,
OrganisationResponse, OrganisationResponse,
ProjectInsert,
ProjectRecord,
ProjectResponse,
UserInsert,
UserRecord,
} from "./schema";
export {
Issue,
IssueInsertSchema,
IssueSelectSchema,
Organisation,
OrganisationInsertSchema,
OrganisationMember,
OrganisationMemberInsertSchema,
OrganisationMemberSelectSchema,
OrganisationSelectSchema,
Project,
ProjectInsertSchema,
ProjectSelectSchema,
User,
UserInsertSchema,
UserSelectSchema,
} from "./schema"; } from "./schema";