fix(frontend): resolve ESLint crash and repair lint configuration

- Scope base JS/TS configs to only JS/TS file extensions, preventing
  TypeError when ESLint applies core rules to markdown/CSS/JSON files
- Remove silent data loss from duplicate JSON keys in five translation
  files where the second dashboard block was overriding the first
- Fix unsafe optional chaining in CredentialManager that would throw
  TypeError when providerTypeInfo is undefined
- Remove stale eslint-disable directive for a rule now handled globally
  by the unused-imports plugin
- Downgrade high-volume lint rules (testing-library, jsx-a11y, import-x,
  vitest) from error to warn to unblock development while preserving
  visibility for incremental cleanup
This commit is contained in:
GitHub Actions
2026-03-08 07:45:01 +00:00
parent c4e8d6c8ae
commit d3ef8d83b3
8 changed files with 195 additions and 108 deletions

View File

@@ -1,6 +1,7 @@
import { Plus, Edit, Trash2, CheckCircle, XCircle, TestTube } from 'lucide-react'
import { useState, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { Plus, Edit, Trash2, CheckCircle, XCircle, TestTube } from 'lucide-react'
import {
Dialog,
DialogContent,
@@ -22,9 +23,10 @@ import {
type DNSProviderCredential,
type CredentialRequest,
} from '../hooks/useCredentials'
import type { DNSProvider, DNSProviderTypeInfo } from '../api/dnsProviders'
import { toast } from '../utils/toast'
import type { DNSProvider, DNSProviderTypeInfo } from '../api/dnsProviders'
interface CredentialManagerProps {
open: boolean
onOpenChange: (open: boolean) => void
@@ -369,7 +371,6 @@ function CredentialForm({
}
}
setErrors((prev) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { zone_filter: _, ...rest } = prev
return rest
})
@@ -393,13 +394,12 @@ function CredentialForm({
// Check required credential fields
const missingFields: string[] = []
providerTypeInfo?.fields
.filter((f) => f.required)
.forEach((field) => {
for (const field of (providerTypeInfo?.fields ?? [])
.filter((f) => f.required)) {
if (!credentials[field.name]) {
missingFields.push(field.label)
}
})
}
if (missingFields.length > 0 && !credential) {
// Only enforce for new credentials