Skip to content

TypeScript as const is not considered a type #1990

@auscompgeek

Description

@auscompgeek

I wanted to delete a bunch of as const (after updating to TypeScript 5.0 and adding const to my generics) in some statements like

foo(Bar, {
  action: 'baz' as const,
});

foo(Bar, {
  action: 'baz',
} as const);

but there's no convenient way to target the as const.

Related previous discussion:

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang-typescriptTypeScript/JavaScript grammar support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions