Skip to content

chore: enable type-aware oxlint with --type-check - #56

Merged
bhouston merged 2 commits into
mainfrom
chore/55-type-aware-oxlint
Nov 6, 2026
Merged

bhouston merged 2 commits into
mainfrom
chore/55-type-aware-oxlint

Conversation

@bhouston

Copy link
Copy Markdown
Owner

Closes #55

Changes

  • pnpm lint now runs oxlint --type-aware --type-check .; added oxlint-tsgolint.
  • tsgolint only type-checks files covered by the nearest tsconfig.json, and tests/test/ were excluded (checked with default options, no three shims). Split each of three-ntc and three-ntc-trainer into tsconfig.build.json (previous config: build, project references, excludes tests, so published output is unchanged) and a lint/IDE tsconfig.json (no emit, includes src, tests and test/). Root references, cli/website references and package build/dev scripts point at tsconfig.build.json.
  • website tsconfig no longer excludes tests (and includes test/performance-metrics.ts); new test/tsconfig.json and test/vitest-commands.d.ts (types the custom recordMetric/benchmarkConfig browser commands); three/addons/* shim added for three-ntc.

Fixed (real issues surfaced)

  • no-redundant-type-constituents (26): X | null where X is the repo's deliberate any alias for untyped three; redundant constituent dropped.
  • floating promises: void main(), void test(...) in release.test.mjs, one in NTCEndToEnd.gpu.test.
  • Stale types now visible: NTCCpuModel.wrap is never read, now optional; MLPLayer weights/biases accept number[] (trainer models use plain arrays); NTCTrainer quantization accepts the partial NTCQuantizationOptions it already resolves; channelActivations accepts undefined entries (NTCActivation includes undefined and consumers handle it); NTCTrainProgress.cpuModel typed as NTCGridPyramidModel instead of any.
  • Test fixes: typed renderer, (url: string), one targeted @ts-expect-error for the deliberately invalid activation in NTCLoader.test.

Validation

pnpm build && pnpm tsc && pnpm lint && pnpm exec oxfmt --check . && pnpm test + release:check pass locally (61 unit tests; verified dist has no test files). Lint: 0 errors, 164 warnings. CI already runs lint after build.

tsc vs lint

  • tsc -b --force ~1.3s; pnpm lint ~1.7s (warm).
  • Injected a type error in three-ntc, three-ntc-trainer, website, cli, test/gpu-helpers.ts and a gpu test: lint caught all six.
  • Nothing tsc reports that lint misses; lint additionally covers gpu tests and test/, which tsc never saw. --type-check could replace pnpm tsc for checking if the build-only config stays for emit.

Closes #55. Adds oxlint-tsgolint; lint-time tsconfigs now cover tests and test/.
@codecov-commenter

codecov-commenter commented Oct 31, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bhouston

Copy link
Copy Markdown
Owner Author

CI note: all checks pass except GPU (WebGPU in headless Chromium), which also fails on main (push run 41155676999) and on the other recent PRs (#51 and #52 branches), so it is pre-existing and unrelated (SwiftShader CI timeouts). Not merging until that is addressed or the owner says to proceed.

Rework onto main (no project references, TS 7.1, vitest 5, typed trainer):
tsconfig.build.json for emit, tsconfig.json (noEmit, includes tests) for lint
and IDE, root references so tsgolint finds every program, and fixes for the
type errors the check now surfaces in tests.
@bhouston
bhouston merged commit b22d27a into main Nov 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: enable type-aware oxlint with --type-check

2 participants