Use biome on the frontend for linting, add to CI

This commit is contained in:
Yiorgis Gozadinos 2026-01-16 14:14:47 +02:00
parent 609cbb78de
commit c1163dc8ff
No known key found for this signature in database
6 changed files with 85 additions and 52 deletions

View file

@ -25,8 +25,25 @@ jobs:
- name: Type check - name: Type check
run: uv run pyright run: uv run pyright
lint-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: app/frontend/package-lock.json
- name: Install dependencies
working-directory: app/frontend
run: npm ci
- name: Lint and format check
working-directory: app/frontend
run: npm run check
test: test:
needs: lint needs: [lint, lint-frontend]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View file

@ -20,3 +20,12 @@ repos:
rev: v1.1.407 rev: v1.1.407
hooks: hooks:
- id: pyright - id: pyright
- repo: local
hooks:
- id: biome
name: biome check
entry: bash -c 'cd app/frontend && npm run check'
language: system
files: ^app/frontend/
types_or: [javascript, jsx, ts, tsx, json]

View file

@ -1,9 +1,9 @@
{ {
"$schema": "https://biomejs.dev/schemas/2.2.6/schema.json", "$schema": "https://biomejs.dev/schemas/2.2.6/schema.json",
"vcs": { "vcs": {
"enabled": false, "enabled": true,
"clientKind": "git", "clientKind": "git",
"useIgnoreFile": false "useIgnoreFile": true
}, },
"files": { "files": {
"ignoreUnknown": false "ignoreUnknown": false
@ -15,7 +15,11 @@
"linter": { "linter": {
"enabled": true, "enabled": true,
"rules": { "rules": {
"recommended": true "recommended": true,
"a11y": {
"noAutofocus": "off",
"noSvgWithoutTitle": "off"
}
} }
}, },
"javascript": { "javascript": {

View file

@ -1,6 +1,5 @@
"use client"; "use client";
import { useCallback, useEffect, useState } from "react";
import { import {
CopilotKit, CopilotKit,
useCoAgent, useCoAgent,
@ -8,6 +7,7 @@ import {
useCopilotAction, useCopilotAction,
} from "@copilotkit/react-core"; } from "@copilotkit/react-core";
import { CopilotChat } from "@copilotkit/react-ui"; import { CopilotChat } from "@copilotkit/react-ui";
import { useCallback, useEffect, useState } from "react";
import "@copilotkit/react-ui/styles.css"; import "@copilotkit/react-ui/styles.css";
import CitationBlock from "./CitationBlock"; import CitationBlock from "./CitationBlock";
import DbInfo from "./DbInfo"; import DbInfo from "./DbInfo";
@ -519,7 +519,11 @@ function ChatContentInner({
type="button" type="button"
className={`settings-btn ${initialContext ? "has-context" : ""}`} className={`settings-btn ${initialContext ? "has-context" : ""}`}
onClick={() => setSettingsOpen(true)} onClick={() => setSettingsOpen(true)}
title={initialContext ? "Background context is set" : "Set background context"} title={
initialContext
? "Background context is set"
: "Set background context"
}
> >
<SettingsIcon /> <SettingsIcon />
Context Context

View file

@ -133,7 +133,6 @@ export default function SettingsPanel({
background: #2563eb; background: #2563eb;
} }
`}</style> `}</style>
{/* biome-ignore lint/a11y/useKeyWithClickEvents: handled via onKeyDown on overlay */}
<div <div
className="settings-modal-overlay" className="settings-modal-overlay"
onClick={onClose} onClick={onClose}

File diff suppressed because one or more lines are too long