From 0bcd26b1a883a7ab9cd7471f852add6760eb62b5 Mon Sep 17 00:00:00 2001 From: c0mrade Date: Tue, 26 May 2026 15:27:03 +0300 Subject: [PATCH] chore(types): replace any with i18next TFunction in AdminAuditLog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit translateAction took 't: any' with an eslint-disable on top — the only explicit 'any' annotation in the entire src/ tree. Inline TFunction from i18next; same call sites, full type safety on the i18n lookup. Now zero 'any' annotations in src/. --- src/pages/AdminAuditLog.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pages/AdminAuditLog.tsx b/src/pages/AdminAuditLog.tsx index 5573251..85197bd 100644 --- a/src/pages/AdminAuditLog.tsx +++ b/src/pages/AdminAuditLog.tsx @@ -2,6 +2,7 @@ import { useState, useCallback, useMemo } from 'react'; import { useNavigate } from 'react-router'; import { useQuery } from '@tanstack/react-query'; import { useTranslation } from 'react-i18next'; +import type { TFunction } from 'i18next'; import { rbacApi, AuditLogEntry, AuditLogFilters } from '@/api/rbac'; import { PermissionGate } from '@/components/auth/PermissionGate'; import { usePlatform } from '@/platform/hooks/usePlatform'; @@ -137,11 +138,7 @@ const INITIAL_FILTERS: FiltersState = { // === Utility functions === -function translateAction( - action: string, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - t: any, -): string { +function translateAction(action: string, t: TFunction): string { return action .split(',') .map((perm: string) => {