fix(ai-triage): WP-9 lint fixes — non-null assertions, a11y labels, array keys, deps

Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
Sondre Engebråten
2026-02-12 18:50:21 +01:00
co-authored by Claude Opus 4.6
parent f6c2663fd5
commit c698bb142e
4 changed files with 10 additions and 8 deletions
@@ -105,7 +105,7 @@ export function registerAITriageHandlers(
return;
}
const backendPath = validation.backendPath!;
const backendPath = validation.backendPath ?? '';
const { model, thinkingLevel } = getGitHubIssuesSettings();
const args = buildRunnerArgs(
@@ -141,7 +141,7 @@ export function registerAITriageHandlers(
return;
}
sendComplete(result.data!);
sendComplete(result.data as AIEnrichmentResult);
});
} catch (error) {
sendError(error instanceof Error ? error.message : 'Failed to run enrichment');
@@ -182,7 +182,7 @@ export function registerAITriageHandlers(
return;
}
const backendPath = validation.backendPath!;
const backendPath = validation.backendPath ?? '';
const { model, thinkingLevel } = getGitHubIssuesSettings();
const args = buildRunnerArgs(
@@ -218,7 +218,7 @@ export function registerAITriageHandlers(
return;
}
const suggestion = result.data!;
const suggestion = result.data as SplitSuggestion;
// Cap sub-issues at MAX_SPLIT_SUB_ISSUES
if (suggestion.subIssues.length > MAX_SPLIT_SUB_ISSUES) {
@@ -46,7 +46,7 @@ export function IssueSplitDialog({ suggestion, progress, onConfirm, onCancel }:
{/* Sub-issues */}
<div className="space-y-3">
{subIssues.map((sub, index) => (
<div key={index} className="border border-border/50 rounded p-3 space-y-2">
<div key={`sub-${sub.title}-${index}`} className="border border-border/50 rounded p-3 space-y-2">
<input
type="text"
value={sub.title}
@@ -81,8 +81,9 @@ export function ProgressiveTrustSettings({ config: initialConfig, onSave, onCanc
{/* Batch size */}
<div className="flex items-center gap-3">
<label className="text-sm min-w-[120px]">{t('common:progressiveTrust.batchSize')}</label>
<label htmlFor="trust-batch-size" className="text-sm min-w-[120px]">{t('common:progressiveTrust.batchSize')}</label>
<input
id="trust-batch-size"
type="number"
value={config.batchSize}
onChange={(e) => setConfig((prev) => ({ ...prev, batchSize: Number.parseInt(e.target.value, 10) || 0 }))}
@@ -94,8 +95,9 @@ export function ProgressiveTrustSettings({ config: initialConfig, onSave, onCanc
{/* Confirm above */}
<div className="flex items-center gap-3">
<label className="text-sm min-w-[120px]">{t('common:progressiveTrust.confirmAbove')}</label>
<label htmlFor="trust-confirm-above" className="text-sm min-w-[120px]">{t('common:progressiveTrust.confirmAbove')}</label>
<input
id="trust-confirm-above"
type="number"
value={config.confirmAbove}
onChange={(e) => setConfig((prev) => ({ ...prev, confirmAbove: Number.parseInt(e.target.value, 10) || 0 }))}
@@ -59,7 +59,7 @@ export function useAITriage(projectId: string) {
cleanup();
}
};
}, [projectId, store]);
}, [store]);
const runEnrichment = useCallback(
(issueNumber: number) => {