refactor(types): eliminate explicit any casts across components (F3.3)

Extend ComponentModelPiece/Product with optional typePiece/typeProduct
nested objects. Replace 12 'as any' casts in assignment node, convert
Promise<any> to Promise<unknown>, use Record<string, unknown> at API
boundaries. ~15 casts eliminated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-02-09 11:13:50 +01:00
parent a6664ce9a2
commit efe1fd2a73
5 changed files with 46 additions and 66 deletions

View File

@@ -115,7 +115,7 @@ const applyCustomFieldOptions = (node: Record<string, any> | null | undefined) =
}
if (Array.isArray(node.customFields)) {
node.customFields = node.customFields.map((field: any) => {
node.customFields = node.customFields.map((field: Record<string, any>) => {
if (!field || typeof field !== 'object') {
return field
}
@@ -145,7 +145,7 @@ const applyCustomFieldOptions = (node: Record<string, any> | null | undefined) =
}
if (Array.isArray(node.subcomponents)) {
node.subcomponents = node.subcomponents.map((sub: any) => {
node.subcomponents = node.subcomponents.map((sub: Record<string, any>) => {
if (!sub || typeof sub !== 'object') {
return sub
}
@@ -246,7 +246,7 @@ watch(
)
onMounted(async () => {
const loaders: Promise<any>[] = []
const loaders: Promise<unknown>[] = []
if (!availablePieceTypes.value.length) {
loaders.push(loadPieceTypes())
}