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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBG1wnuRfJKCstGB8Fekr8
This commit is contained in:
2026-09-18 15:54:55 +05:30
parent 34acd63a80
commit 78f1b44c2e
2 changed files with 12 additions and 7 deletions

View File

@@ -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 });
/**

5
src/vite-env.d.ts vendored
View File

@@ -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,