Convert build sources to TypeScript
Context
Our block theme and feature-plugin skeletons are authored in JavaScript. We want them to be TypeScript-first so consuming projects get type safety, editor IntelliSense, and earlier error detection. @wordpress/scripts already supports TypeScript, so this is a build-time change only — runtime behavior and shipped assets stay the same.
Goal
All source under src/ is written in TypeScript (.ts/.tsx), type-checked in CI, with no change to compiled output or runtime behavior.
Scope
- Block theme
- Feature-plugin skeleton
(Both should end up with an identical TypeScript + lint setup.)
Deliverables
- TypeScript tooling configured (
tsconfig, ambient type declarations, a type-check script).
- All
src/ JavaScript converted to .ts/.tsx, including blocks and components.
- Linting and type-checking run in CI for TypeScript on every relevant PR.
Definition of done
Considerations
- Use first-party
@wordpress types where available; fall back to community type stubs only where a package ships none.
- Keep the runtime React version and its type definitions aligned to avoid duplicate/incompatible React types.
- Type-checking is additive — it must not alter the built assets or block registration.
Convert build sources to TypeScript
Context
Our block theme and feature-plugin skeletons are authored in JavaScript. We want them to be TypeScript-first so consuming projects get type safety, editor IntelliSense, and earlier error detection.
@wordpress/scriptsalready supports TypeScript, so this is a build-time change only — runtime behavior and shipped assets stay the same.Goal
All source under
src/is written in TypeScript (.ts/.tsx), type-checked in CI, with no change to compiled output or runtime behavior.Scope
(Both should end up with an identical TypeScript + lint setup.)
Deliverables
tsconfig, ambient type declarations, a type-check script).src/JavaScript converted to.ts/.tsx, including blocks and components.Definition of done
src/with a reasonably strict config.buildandstartwork unchanged; compiled JS output is equivalent to before.src/(root build-config files may stay JS).Considerations
@wordpresstypes where available; fall back to community type stubs only where a package ships none.