Skip to content

astro-check (error): team/previous index signature uses literal type #573

Description

@lsr-explore

team/previous index signature uses literal type

Labels: types
Estimated PR size: 1 file

Note

Ticket description was generated using Claude Code. Review before starting on a fix.

Note

The following issue adds support for npm run astro:check

Summary

src/pages/team/previous.astro:45 declares an interface with an index signature whose key type is a string-literal alias (RoleKey). TypeScript disallows this — index signatures must use string, number, or symbol.

astro check error

src/pages/team/previous.astro:45:4 - error ts(1337): An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead.

45   [index: RoleKey]: TeamOverview;

Suggested fix

Replace the index signature with a mapped object type:

type TeamOverviews = {
  [K in RoleKey]: TeamOverview;
};

Or, if not all keys are guaranteed:

type TeamOverviews = Partial<Record<RoleKey, TeamOverview>>;

Pick whichever matches actual usage in the file.

Acceptance criteria

  • Error clears.
  • team/previous.astro still compiles and the page still renders correctly.

Notes

There's also an unrelated implicit-any warning on line 157 ((member) => ...) — could be fixed in the same small PR if scope allows, since it's in the same file.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions