chore(lint): manual cleanup batch 4 — noNonNullAssertion + small fixes
- noNonNullAssertion (42 → 0): replaced ! assertions with explicit null guards across auth.module, storage.service, pl24-auth, categories.service, catalog.service, parts.service, emex.browser, emex.service, parts-catalogs-auth, pl24-ford-legacy, email.service, database.provider, jobs/processors, psa-variant-selector, vehicles/$id/categories, catalog/$brandName - buildTree: skip orphaned items instead of asserting map.get - emex.browser.acquirePage: explicit context check before newPage - pcat-auth.getIstanbulTime: graceful UTC fallback if Intl parts missing - email.send: gate on both postalApiUrl + postalApiKey for type narrowing - categories.service: PSA root-fallback now early-returns when category.vehicleId missing (catalog-only categories don't have a sibling root) - pl24-ford-legacy: createHash from "node:crypto", URL building uses single template literals, useDefaultParameterLast — required modelYear/engine/gearbox params (callers already supply them) - pcat-auth: h.origin / h.referer literal-key access - index.tsx: <button type="button"> on mobile menu toggle - parts-panel + admin/users: keyboard handler for clickable rows (Enter/Space) - ford-legacy: useOptionalChain on item.name?.toUpperCase() Lint count: 155 → 114. Remaining: 121 noExplicitAny + 3 small. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,7 @@ export function PsaVariantSelector({ vehicleId, onSelect }: PsaVariantSelectorPr
|
||||
queryKey: ["psa-engines", vehicleId, selectedBody],
|
||||
queryFn: () =>
|
||||
api.get<VariantItem[]>(
|
||||
`/catalog/vehicles/${vehicleId}/psa-engines?body=${encodeURIComponent(selectedBody!)}`,
|
||||
`/catalog/vehicles/${vehicleId}/psa-engines?body=${encodeURIComponent(selectedBody ?? "")}`,
|
||||
),
|
||||
enabled: !!vehicleId && !!selectedBody,
|
||||
});
|
||||
@@ -41,7 +41,7 @@ export function PsaVariantSelector({ vehicleId, onSelect }: PsaVariantSelectorPr
|
||||
queryKey: ["psa-gearboxes", vehicleId, selectedBody, selectedEngine],
|
||||
queryFn: () =>
|
||||
api.get<VariantItem[]>(
|
||||
`/catalog/vehicles/${vehicleId}/psa-gearboxes?body=${encodeURIComponent(selectedBody!)}&engine=${encodeURIComponent(selectedEngine!)}`,
|
||||
`/catalog/vehicles/${vehicleId}/psa-gearboxes?body=${encodeURIComponent(selectedBody ?? "")}&engine=${encodeURIComponent(selectedEngine ?? "")}`,
|
||||
),
|
||||
enabled: !!vehicleId && !!selectedBody && !!selectedEngine,
|
||||
});
|
||||
@@ -58,7 +58,8 @@ export function PsaVariantSelector({ vehicleId, onSelect }: PsaVariantSelectorPr
|
||||
|
||||
const handleEngineSelect = (code: string | "_all_") => {
|
||||
if (code === "_all_") {
|
||||
onSelect(selectedBody!, "_all_", "_all_");
|
||||
if (!selectedBody) return;
|
||||
onSelect(selectedBody, "_all_", "_all_");
|
||||
return;
|
||||
}
|
||||
setSelectedEngine(code);
|
||||
@@ -67,7 +68,8 @@ export function PsaVariantSelector({ vehicleId, onSelect }: PsaVariantSelectorPr
|
||||
|
||||
const handleGearboxSelect = (code: string | "_all_") => {
|
||||
if (code === "_all_") {
|
||||
onSelect(selectedBody!, selectedEngine!, "_all_");
|
||||
if (!selectedBody || !selectedEngine) return;
|
||||
onSelect(selectedBody, selectedEngine, "_all_");
|
||||
return;
|
||||
}
|
||||
setSelectedGearbox(code);
|
||||
|
||||
Reference in New Issue
Block a user