Skip to content

Commit 397cdd9

Browse files
build: add frontend validation and fix lint/TypeScript errors
- Add lint-frontend and validate-frontend targets to Makefile - Include frontend checks in make validate command - Remove unused ChevronDown import from CodebaseExplorerPage - Remove unused navigate import from ConfigEditorPage - Remove width/height props from NetworkGraph in RunDetailPage - Add vite-env.d.ts for CSS module type declarations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d29edd1 commit 397cdd9

5 files changed

Lines changed: 43 additions & 10 deletions

File tree

Makefile

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# FUSION Project Makefile
22
# Provides convenient commands for development and validation
33

4-
.PHONY: help install lint test validate clean check-env precommit-install precommit-run
4+
.PHONY: help install lint test validate clean check-env precommit-install precommit-run lint-frontend validate-frontend
55

66
# Default target
77
help:
@@ -16,8 +16,10 @@ help:
1616
@echo " check-env Check if virtual environment is activated"
1717
@echo ""
1818
@echo "Validation (run before submitting PR):"
19-
@echo " validate Run all pre-commit checks on all files"
19+
@echo " validate Run all checks (backend + frontend + tests)"
2020
@echo " lint Run pre-commit checks on all files"
21+
@echo " lint-frontend Run frontend linting (ESLint)"
22+
@echo " validate-frontend Run frontend lint + TypeScript build"
2123
@echo " precommit-run Run pre-commit on staged files only"
2224
@echo " test Run unit tests with pytest"
2325
@echo ""
@@ -86,13 +88,42 @@ precommit-run: check-env
8688
@echo "🔍 Running pre-commit checks on staged files..."
8789
pre-commit run
8890

91+
# Frontend linting
92+
lint-frontend:
93+
@echo "Running frontend ESLint..."
94+
@if [ -d "frontend" ] && [ -f "frontend/package.json" ]; then \
95+
cd frontend && npm run lint; \
96+
else \
97+
echo "Frontend directory not found, skipping..."; \
98+
fi
99+
100+
# Frontend validation (lint + build)
101+
validate-frontend:
102+
@echo "Running frontend validation (lint + TypeScript build)..."
103+
@if [ -d "frontend" ] && [ -f "frontend/package.json" ]; then \
104+
cd frontend && npm run lint && npm run build; \
105+
else \
106+
echo "Frontend directory not found, skipping..."; \
107+
fi
108+
89109
# Full PR validation - run all pre-commit checks on all files
90110
validate: check-env
91-
@echo "🚀 Running complete validation (pre-commit + tests)..."
92-
@echo "Running pre-commit checks on all files..."
111+
@echo "Running complete validation (backend + frontend + tests)..."
112+
@echo ""
113+
@echo "=== Backend: Pre-commit checks ==="
93114
pre-commit run --all-files
94-
@echo "Running unit tests..."
115+
@echo ""
116+
@echo "=== Frontend: Lint + TypeScript build ==="
117+
@if [ -d "frontend" ] && [ -f "frontend/package.json" ]; then \
118+
cd frontend && npm run lint && npm run build; \
119+
else \
120+
echo "Frontend directory not found, skipping..."; \
121+
fi
122+
@echo ""
123+
@echo "=== Running unit tests ==="
95124
python -m pytest
125+
@echo ""
126+
@echo "Validation complete!"
96127

97128
# Lint only - run all pre-commit checks
98129
lint: check-env

frontend/src/pages/CodebaseExplorerPage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
Cog,
1616
BookOpen,
1717
ArrowLeft,
18-
ChevronDown,
1918
} from 'lucide-react'
2019
import Editor from '@monaco-editor/react'
2120
import { codebaseApi } from '@/api/client'

frontend/src/pages/ConfigEditorPage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect, useRef } from 'react'
2-
import { useSearchParams, Link, useNavigate } from 'react-router-dom'
2+
import { useSearchParams, Link } from 'react-router-dom'
33
import { useQuery, useMutation } from '@tanstack/react-query'
44
import { ArrowLeft, Check, AlertTriangle, Save, FileCode, ChevronDown, FileText } from 'lucide-react'
55
import Editor from '@monaco-editor/react'
@@ -15,7 +15,6 @@ interface ValidationResult {
1515

1616
export function ConfigEditorPage() {
1717
const [searchParams, setSearchParams] = useSearchParams()
18-
const navigate = useNavigate()
1918
const templateName = searchParams.get('template') || 'default'
2019
const { isDark } = useUI()
2120

frontend/src/pages/RunDetailPage.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,6 @@ export function RunDetailPage() {
429429
<NetworkGraph
430430
nodes={topology.nodes}
431431
links={topology.links}
432-
width={700}
433-
height={500}
434432
/>
435433
) : (
436434
<div className="flex h-[500px] items-center justify-center rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800">

frontend/src/vite-env.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference types="vite/client" />
2+
3+
declare module '*.css' {
4+
const content: string
5+
export default content
6+
}

0 commit comments

Comments
 (0)