Use biome on the frontend for linting, add to CI
This commit is contained in:
parent
609cbb78de
commit
c1163dc8ff
6 changed files with 85 additions and 52 deletions
19
.github/workflows/test.yml
vendored
19
.github/workflows/test.yml
vendored
|
|
@ -25,8 +25,25 @@ jobs:
|
|||
- name: Type check
|
||||
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:
|
||||
needs: lint
|
||||
needs: [lint, lint-frontend]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
|
|||
|
|
@ -20,3 +20,12 @@ repos:
|
|||
rev: v1.1.407
|
||||
hooks:
|
||||
- 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]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.2.6/schema.json",
|
||||
"vcs": {
|
||||
"enabled": false,
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": false
|
||||
"useIgnoreFile": true
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": false
|
||||
|
|
@ -15,7 +15,11 @@
|
|||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
"recommended": true,
|
||||
"a11y": {
|
||||
"noAutofocus": "off",
|
||||
"noSvgWithoutTitle": "off"
|
||||
}
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
"use client";
|
||||
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import {
|
||||
CopilotKit,
|
||||
useCoAgent,
|
||||
|
|
@ -8,6 +7,7 @@ import {
|
|||
useCopilotAction,
|
||||
} from "@copilotkit/react-core";
|
||||
import { CopilotChat } from "@copilotkit/react-ui";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import "@copilotkit/react-ui/styles.css";
|
||||
import CitationBlock from "./CitationBlock";
|
||||
import DbInfo from "./DbInfo";
|
||||
|
|
@ -519,7 +519,11 @@ function ChatContentInner({
|
|||
type="button"
|
||||
className={`settings-btn ${initialContext ? "has-context" : ""}`}
|
||||
onClick={() => setSettingsOpen(true)}
|
||||
title={initialContext ? "Background context is set" : "Set background context"}
|
||||
title={
|
||||
initialContext
|
||||
? "Background context is set"
|
||||
: "Set background context"
|
||||
}
|
||||
>
|
||||
<SettingsIcon />
|
||||
Context
|
||||
|
|
|
|||
|
|
@ -133,7 +133,6 @@ export default function SettingsPanel({
|
|||
background: #2563eb;
|
||||
}
|
||||
`}</style>
|
||||
{/* biome-ignore lint/a11y/useKeyWithClickEvents: handled via onKeyDown on overlay */}
|
||||
<div
|
||||
className="settings-modal-overlay"
|
||||
onClick={onClose}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue