Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/main_kooktime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ on:
- main

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: "Checkout Github Action"
uses: actions/checkout@master

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: src/CookTime/client-app/package-lock.json

- name: Install dependencies
run: cd src/CookTime/client-app && npm ci

- name: Lint
run: scripts/test --lint

test:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## 2026-02-14

### Fixed

- Fix crash when switching ingredient units caused by reading the event target inside a deferred React state updater

### Changed

- Add `ESLint` to CI/CD for frontend code
- More prompt tuning

## 2026-02-13
Expand Down
14 changes: 13 additions & 1 deletion scripts/test
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
#!/bin/bash
set -e

SCRIPT_DIR="$(dirname "$0")"
REPO_ROOT="$SCRIPT_DIR/.."

# --lint: run frontend linting only, then exit
if [ "$1" = "--lint" ]; then
echo "Running frontend lint..."
cd "$REPO_ROOT/src/CookTime/client-app"
npx eslint src/
echo "Lint passed!"
exit 0
fi

API_URL="${API_BASE_URL:-http://localhost:5001}"
MAX_WAIT=30

Expand All @@ -23,6 +35,6 @@ echo "API is healthy!"

echo ""
echo "Running tests..."
cd "$(dirname "$0")/../src/CookTimeTests"
cd "$REPO_ROOT/src/CookTimeTests"
dotnet build -v minimal
dotnet test --verbosity normal --no-build --logger "trx;LogFileName=test-results.trx" -- RunConfiguration.DisableParallelization=true
32 changes: 32 additions & 0 deletions src/CookTime/client-app/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";

export default tseslint.config(
{ ignores: ["build/**", "node_modules/**", ".react-router/**"] },
js.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
// Relaxed for existing codebase — tighten over time
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/no-empty-object-type": "warn",
"react-hooks/static-components": "warn",
"react-hooks/set-state-in-effect": "warn",
},
}
);
Loading
Loading