From 78f1b44c2ee11d0f5e330430b8b76fd0cc91c28e Mon Sep 17 00:00:00 2001 From: Aravind Date: Fri, 18 Sep 2026 15:54:55 +0530 Subject: [PATCH] chore(ts-migration): remove the now-redundant @ts-ignore in the agent registry `import.meta.glob` needed a suppression while `tsc` modelled only the standard `ImportMeta`. Phase 1 set `types: ["vite/client"]`, which declares Vite's additions, and the directive has had nothing to suppress since. Phase 1 scheduled its removal for Phase 11; this is that. Removing it is the point rather than tidying. `@ts-ignore` suppresses whatever the next line produces, so one that no longer applies is a directive that would silently swallow a real error on that line later. Verified redundant before removing: typecheck is still 0, and the emitted JavaScript is identical. `src/vite-env.d.ts` described this suppression as present, so its comment is corrected too. `src/` now contains no `@ts-ignore` or `@ts-expect-error` at all. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01HBG1wnuRfJKCstGB8Fekr8 --- src/lib/agents/registry.ts | 14 +++++++++----- src/vite-env.d.ts | 5 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/lib/agents/registry.ts b/src/lib/agents/registry.ts index 97841a5..cbf706b 100644 --- a/src/lib/agents/registry.ts +++ b/src/lib/agents/registry.ts @@ -29,11 +29,15 @@ import { normalizeAgent } from './agentConfig'; * disabled list and nothing else, so it can only ever narrow a page. */ -/* `import.meta.glob` is a Vite build-time API. `tsc` models only the standard - `ImportMeta`, so it reports this as a missing property — a false positive - rather than a defect. Suppressed rather than cast: a cast would assert a type - nothing here can verify, and this file is the one place the glob appears. */ -// @ts-ignore -- Vite build-time API, absent from the standard ImportMeta type +/* `import.meta.glob` is a Vite build-time API, and it used to need a + `@ts-ignore` here: `tsc` models only the standard `ImportMeta` and reported + this as a missing property — a false positive rather than a defect. + + It is typed now. `tsconfig.json` sets `types: ["vite/client"]`, which + declares the Vite additions to `ImportMeta`, so the suppression had nothing + left to suppress. Removing it is the point rather than tidying: a directive + that no longer applies is one that would silently swallow a real error on + this line later. */ const FILES = import.meta.glob('/src/agents/**/*.md', { query: '?raw', import: 'default', eager: true }); /** diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index bd336d6..8077921 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -6,8 +6,9 @@ * * The reference above is what supplies `import.meta.env`, `import.meta.glob` * and the `?raw` module shape. Without it the two registries that discover - * agents and skills from the filesystem do not typecheck at all, and one of - * them carries a hand-written `@ts-ignore` saying so. + * agents and skills from the filesystem do not typecheck at all. One of them + * used to carry a hand-written `@ts-ignore` for exactly that reason; this + * reference is what made it redundant, and it has been removed. * * The interface below names the two variables this codebase reads. It does not * restrict `import.meta.env` to them — this declaration MERGES with Vite's,