Skip to content

Shrink the any boundary: extend schema coverage, then promote no-explicit-any to error #86

Description

@rebaserHEAD

ESLint (PR #83) reports ~186 no-explicit-any warnings, deliberately left as warnings. Nearly all of them are the YAML ingest boundary: mapImporter internals, prototypeResolver, structural component handling. Hand-typing casts there would churn 200 sites without making anything safer.

The honest fix is the one started in PR #83: typed validation at the boundary (src/import/mapSchema.ts covers the map document shell), extended inward so downstream code inherits real types instead of any.

Sequence that makes sense:

  • Chunk/tilemap/meta shapes inside mapImporter (typed by the existing schema, currently still traversed as any).
  • Prototype shells in prototypeDiscovery (RawEntityPrototype & friends are honest interfaces already; the parse path just is not narrowed onto them).
  • Component-editor payloads in componentEditors/.
  • When the count is near zero, flip @typescript-eslint/no-explicit-any to error in eslint.config.js and remove the carve-out comment.

Same posture as the schema gate: type what the code actually assumes, never reject data the round-trip contract must preserve. The react-hooks v7 compiler diagnostics (also warn-only, see eslint.config.js) can ride along here — each one is either a documented-deliberate pattern to keep suppressed or a small refactor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions