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-30 00:38:53 +08:00 committed by GitHub
parent 4a21c1617e
commit 81875c8c42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -28,7 +28,7 @@ const [, builtIconAttributes, builtIconNode = []] = buildLucideIconNode(icon, {
strokeWidth,
absoluteStrokeWidth,
nonScalingStroke,
className,
...(className !== undefined && { className }),
hasA11yProp: hasA11yProp(rest),
});

View file

@ -4,6 +4,8 @@
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"useDefineForClassFields": true,
"allowImportingTsExtensions": true,
"resolveJsonModule": true,