fix(lint): use Route cast in ClientsByCountryWidget so prettier doesn't reflow the eslint-disable
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:
@@ -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}`}
|
||||||
|
|||||||
Reference in New Issue
Block a user