refactor: fix and tighten mechanical lint rules
- no-useless-escape: drop needless backslashes in character classes and URL/path regexes (gh-cli, store, task, modelFilter, useFileMention, RoutineEditor, ScheduleForm). - no-case-declarations: wrap case bodies in ProjectOverview and SettingsModal with block scopes. - prefer-const: convert a never-reassigned slug binding in agent-import; annotate legitimate forward-declared let bindings in dashboard.ts that callbacks close over before assignment. - no-fallthrough: add missing break after settings-subcommand error. - no-empty-interface/no-empty-object-type: convert ProjectManifest from empty interface extension to a type alias. - no-unused-expressions: replace `x && x.method()` short-circuits in TerminalModal with optional chaining. Then ratchet these rules from warn → error so regressions are blocked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -108,12 +108,13 @@ export function ProjectOverview({
|
||||
case "name":
|
||||
comparison = a.project.name.localeCompare(b.project.name);
|
||||
break;
|
||||
case "activity":
|
||||
case "activity": {
|
||||
const aTime = a.project.lastActivityAt || a.health?.lastActivityAt || a.project.updatedAt;
|
||||
const bTime = b.project.lastActivityAt || b.health?.lastActivityAt || b.project.updatedAt;
|
||||
comparison = new Date(bTime).getTime() - new Date(aTime).getTime();
|
||||
break;
|
||||
case "status":
|
||||
}
|
||||
case "status": {
|
||||
const statusOrder: Record<ProjectStatus, number> = {
|
||||
errored: 0,
|
||||
initializing: 1,
|
||||
@@ -122,6 +123,7 @@ export function ProjectOverview({
|
||||
};
|
||||
comparison = statusOrder[a.project.status] - statusOrder[b.project.status];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return sortDirection === "asc" ? comparison : -comparison;
|
||||
|
||||
Reference in New Issue
Block a user