fix: Resolve all ESLint errors and warnings in web package
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Fixes all 542 ESLint problems in the web package to achieve 0 errors and 0 warnings.

Changes:
- Fixed 144 issues: nullish coalescing, return types, unused variables
- Fixed 118 issues: unnecessary conditions, type safety, template literals
- Fixed 79 issues: non-null assertions, unsafe assignments, empty functions
- Fixed 67 issues: explicit return types, promise handling, enum comparisons
- Fixed 45 final warnings: missing return types, optional chains
- Fixed 25 typecheck-related issues: async/await, type assertions, formatting
- Fixed JSX.Element namespace errors across 90+ files

All Quality Rails violations resolved. Lint and typecheck both pass with 0 problems.

Files modified: 118 components, tests, hooks, and utilities

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-31 00:10:03 -06:00
parent f0704db560
commit ac1f2c176f
117 changed files with 749 additions and 505 deletions

View File

@@ -59,7 +59,7 @@ const WIDGET_REGISTRY = {
type WidgetRegistryKey = keyof typeof WIDGET_REGISTRY;
export function HUD({ className = "" }: HUDProps) {
export function HUD({ className = "" }: HUDProps): React.JSX.Element {
const { currentLayout, updateLayout, addWidget, removeWidget, switchLayout, resetLayout } =
useLayout();
@@ -67,16 +67,16 @@ export function HUD({ className = "" }: HUDProps) {
const handleLayoutChange = (
newLayout: readonly { i: string; x: number; y: number; w: number; h: number }[]
) => {
): void => {
updateLayout([...newLayout] as WidgetPlacement[]);
};
const handleAddWidget = (widgetType: WidgetRegistryKey) => {
const handleAddWidget = (widgetType: WidgetRegistryKey): void => {
const widgetConfig = WIDGET_REGISTRY[widgetType];
const widgetId = `${widgetType.toLowerCase()}-${Date.now()}`;
const widgetId = `${widgetType.toLowerCase()}-${String(Date.now())}`;
// Find the next available position
const maxY = currentLayout?.layout.reduce((max, w) => Math.max(max, w.y + w.h), 0) || 0;
const maxY = currentLayout?.layout.reduce((max, w): number => Math.max(max, w.y + w.h), 0) ?? 0;
const newWidget = {
i: widgetId,
@@ -93,7 +93,7 @@ export function HUD({ className = "" }: HUDProps) {
addWidget(newWidget);
};
const handleResetLayout = () => {
const handleResetLayout = (): void => {
if (confirm("Are you sure you want to reset the layout? This will remove all widgets.")) {
resetLayout();
}
@@ -120,8 +120,8 @@ export function HUD({ className = "" }: HUDProps) {
<h1 className="text-2xl font-bold text-gray-900">Dashboard</h1>
<div className="flex items-center gap-2">
<select
value={currentLayout?.id || ""}
onChange={(e) => {
value={currentLayout?.id ?? ""}
onChange={(e): void => {
switchLayout(e.target.value);
}}
className="px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
@@ -143,10 +143,10 @@ export function HUD({ className = "" }: HUDProps) {
{/* Widget type selector */}
<div className="relative">
<select
onChange={(e) => {
const widgetType = e.target.value as WidgetRegistryKey;
if (widgetType) {
handleAddWidget(widgetType);
onChange={(e): void => {
const widgetType = e.target.value;
if (widgetType && widgetType in WIDGET_REGISTRY) {
handleAddWidget(widgetType as WidgetRegistryKey);
e.target.value = "";
}
}}
@@ -169,7 +169,7 @@ export function HUD({ className = "" }: HUDProps) {
{/* Widget Grid */}
<WidgetGrid
layout={currentLayout?.layout || []}
layout={currentLayout?.layout ?? []}
onLayoutChange={handleLayoutChange}
isEditing={isEditing}
>