Skip to content

refactor(types): drop remaining as-any / ts-ignore in cross-cutting infra (#1989) - #2048

Merged
ariskemper merged 1 commit into
mainfrom
chore/1989-types-final
Jun 2, 2026
Merged

refactor(types): drop remaining as-any / ts-ignore in cross-cutting infra (#1989)#2048
ariskemper merged 1 commit into
mainfrom
chore/1989-types-final

Conversation

@ariskemper

Copy link
Copy Markdown
Contributor

What

Closes the last weak-typing items from the #1989 audit (findings #2 weak typing + #6 @ts-ignore cluster). Pure type-level cleanup — no runtime behavior change.

Changes

src/utils/redis-client.ts — replace 3× Record<string, any> (and their deno-lint-ignore no-explicit-any directives) with a local RedisClientFactoryOptions interface describing the subset of @redis/client's createClient options we actually pass (url, socket.tls, password, username). The npm module is loaded via dynamic import() and is otherwise any, so the typed boundary lives on our side.

src/security/sandbox/project-worker.ts — drop the @ts-ignore on new Worker(...) by making ExtendedWorkerOptions an intersection with the DOM WorkerOptions (WorkerOptions & { deno?: { permissions } }), matching the pattern already used in deno-sandbox.ts. The value is now assignable to the Worker constructor without suppressing the whole line (Deno still reads the extra deno field at runtime).

Tests

Pure type changes — the typecheck is the gate. Existing project-worker.test.ts still passes (it constructs a real Worker), confirming the suppression removal is runtime-safe. No adjacent redis-client test exists; the runtime createClient call is unchanged.

Refs #1989

…nfra (#1989)

Closes the last weak-typing items from the #1989 audit:

- redis-client.ts: replace 3x `Record<string, any>` (+ their
  deno-lint-ignore directives) with a local `RedisClientFactoryOptions`
  interface describing the subset of @redis/client createClient options we
  actually pass (url, socket.tls, password, username).
- security/sandbox/project-worker.ts: drop the `@ts-ignore` on
  `new Worker(...)` by making `ExtendedWorkerOptions` an intersection with
  the DOM `WorkerOptions` (matching deno-sandbox.ts), so the value is
  assignable to the constructor without suppressing the whole line.

Pure type-level changes; no runtime behavior change. project-worker tests
still pass (Worker is constructed at runtime). Refs #1989
@ariskemper
ariskemper marked this pull request as ready for review June 2, 2026 09:56
@ariskemper
ariskemper merged commit d3209b8 into main Jun 2, 2026
19 checks passed
@ariskemper
ariskemper deleted the chore/1989-types-final branch June 2, 2026 18:13
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.

1 participant