Skip to content

Catch useless type aliases #33

Description

@kubk

Recently I started noticing models introducing aliases that only rename another type:

  type SearchResultType = "deck" | "folder" | "card";
  type SearchTab = SearchResultType;

This makes sense because models often optimize for the smallest change, avoiding edits across multiple files that would properly consolidate the types. Yet direct aliases can still be useful for public API compatibility or intentional domain terminology. Derived aliases should also remain valid:

type NestedValue = Source["nested"]["value"];
type Selected = Pick<Source, "id">;

It was relatively easy to prompt AI to create slop-scan plugin to catch such issues.

Thoughts on including it in the core repo? Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions