There are two common ways to tell TypeScript that a literal value should be interpreted as its literal type rather than a general primitive type:
as const: telling TypeScript to infer the literal type automatically
as with an explicit literal type: explicitly telling TypeScript the literal type
as const is generally preferred as it doesn’t require repeating the literal value.
This rule reports when an explicit literal type can be replaced with as const.
If your codebase consistently uses explicit literal types for documentation purposes, or if you don’t have a preference between the two styles, you may disable this rule.