fix(lint): use Route cast in ClientsByCountryWidget so prettier doesn't reflow the eslint-disable
Some checks failed
Build & Push Docker Images / lint (push) Successful in 2m51s
Build & Push Docker Images / build-and-push (push) Failing after 2m10s

The prior fix (c1daed1) collapsed the JSX onto one line so the
eslint-disable-next-line directive correctly targeted the `as any`
cast. Lint-staged's prettier ran on the next commit and reflowed the
attribute back across multiple lines, separating the directive from
the cast and re-triggering @typescript-eslint/no-explicit-any.

Cast to `Route` (typed-routes' own escape hatch) instead of `any`.
No eslint-disable required, and prettier can reflow freely without
breaking the lint contract.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-22 13:42:16 +02:00
parent c1daed1991
commit fcab7745aa

View File

@@ -1,6 +1,7 @@
'use client'; 'use client';
import Link from 'next/link'; import Link from 'next/link';
import type { Route } from 'next';
import { useParams } from 'next/navigation'; import { useParams } from 'next/navigation';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { Globe } from 'lucide-react'; import { Globe } from 'lucide-react';
@@ -93,9 +94,8 @@ export function ClientsByCountryWidget({ limit = 8 }: { limit?: number } = {}) {
return ( return (
<li key={row.country}> <li key={row.country}>
<Link <Link
// eslint-disable-next-line @typescript-eslint/no-explicit-any
href={ href={
`/${portSlug}/clients?nationality=${encodeURIComponent(row.country)}` as any `/${portSlug}/clients?nationality=${encodeURIComponent(row.country)}` as Route
} }
className="group flex items-center justify-between gap-3 rounded-md px-2 py-1.5 -mx-2 hover:bg-foreground/5" className="group flex items-center justify-between gap-3 rounded-md px-2 py-1.5 -mx-2 hover:bg-foreground/5"
title={`${row.count} client${row.count === 1 ? '' : 's'} in ${name}`} title={`${row.count} client${row.count === 1 ? '' : 's'} in ${name}`}