S6: Explicit undefined passed to formatSI optional param #11
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Code Smell
File:
web/components/ChartCard/TableViz.tsx:67The second argument
undefinedis explicit where the parameter is already optional:Why it matters
Passing
undefinedexplicitly where optional suffices is redundant. TypeScript will passundefinedfor missing optional params anyway.Suggestion
Or use default parameter:
formatSI(vals.green, undefined, 0)→formatSI(vals.green, 0). Note: this swaps locale and fractionDigits positions — the current call is already correct because locale is second param. Actually the fix is to remove the undefined:This is minor and the current code is technically fine. The smell is semantic only.