Skip to content

refactor: enable typescript/no-explicit-any lint rule and fix violations (stage 3) #40

Open

Description

@bhouston

What

Stage 3 of the v2 repo standard: set typescript/no-explicit-any to error in .oxlintrc.json (canonical value) and fix every resulting violation with real types or unknown + narrowing. eslint/no-unused-private-class-members and unicorn/no-new-array are already error from stage 1 (#37).

Why

Close out the last documented stage-1 deviation from the canonical .oxlintrc.json.

Scope

~60 call sites flagged when this rule was tested during stage 1, concentrated in:

  • packages/three-ntc/src/NTCDecoderTSL.ts
  • packages/three-ntc/src/NTCMLPTSL.ts
  • packages/three-ntc/src/NTCShaderBudget.gpu.test.ts
  • packages/three-ntc-trainer/src/NTCGPUKernelsTSL.ts
  • packages/three-ntc-trainer/src/materialx/MaterialXSurfaceMappings.ts

Acceptance criteria

  • .oxlintrc.json byte-identical to canonical except ignorePatterns
  • pnpm lint passes with zero errors
  • pnpm build, pnpm tsc, pnpm test pass
  • Any unavoidable any (e.g. untyped third-party surface) gets an inline // oxlint-disable-next-line typescript/no-explicit-any -- <reason>, listed in the PR

Activity

  1. bhouston commented on Sep 25, 2026

    @bhouston
    OwnerAuthor

    Scoped this out before touching source: enabling `typescript/no-explicit-any` as `error` currently flags 790 call sites across ~55 files, not the ~60 estimated when this rule was spot-checked during stage 1 (that check's output was truncated to the last 60 lines).

    Distribution is heavily concentrated in the numerically-sensitive GPU/TSL/MaterialX internals:

    • packages/three-ntc-trainer/src/materialx/MaterialXNodeLibrary.ts — 152
    • packages/three-ntc/src/NTCFormat.ts — 97
    • packages/three-ntc-trainer/src/materialx/compile/MaterialXCompileRegistry.ts — 93
    • packages/three-ntc-trainer/src/materialx/MaterialXDocument.ts — 38
    • packages/three-ntc/src/NTCDecoderTSL.ts — 31
    • packages/three-ntc/src/NTCMLPTSL.ts — 30
    • plus ~49 more files with smaller counts (full breakdown available on request)

    This isn't a mechanical "swap in unknown" job — it's real typing work across TSL node-graph builders, the MaterialX document/node-library/compile-registry model, and GPU buffer/texture code, where a rushed or incorrect type risks silently breaking shader/GPU correctness rather than just failing to compile. Doing it "properly" (the standard's own bar — real types or unknown + narrowing, disables only for true necessities) is a multi-file, domain-specific refactor, not something to force through in one pass.

    Leaving this open rather than merging a half-working pass or a PR full of blanket oxlint-disable comments (which would defeat the point of turning the rule on). Recommend splitting into follow-up issues per subsystem (MaterialX parsing/compile, TSL shader code, GPU trainer internals, website) so each can be typed and tested properly on its own.

    No source changes were made in this pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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