fix(astro): support stricter optional property checking (#5070)

Omit absent className values when calling the shared icon builder so
shipped Astro source passes exactOptionalPropertyTypes without changing
rendered classes.

Enable exactOptionalPropertyTypes and noUncheckedIndexedAccess in the
package tsconfig so the existing CI typecheck catches regressions.

Background: https://github.com/withastro/astro/issues/18471

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
This commit is contained in:
Hikari Hayashi
2026-10-29 17:38:53 +01:00
committed by GitHub
co-authored by Codex Eric Fennis
parent 4a21c1617e
commit 81875c8c42
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ const [, builtIconAttributes, builtIconNode = []] = buildLucideIconNode(icon, {
strokeWidth,
absoluteStrokeWidth,
nonScalingStroke,
className,
...(className !== undefined && { className }),
hasA11yProp: hasA11yProp(rest),
});
+2
View File
@@ -4,6 +4,8 @@
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"useDefineForClassFields": true,
"allowImportingTsExtensions": true,
"resolveJsonModule": true,