RockyCott
RockyCott

Reputation: 59

how can I fix the warning "Replace this union type with a type alias"

SonarLint gives the following and I have not found how to solve it since it is a global variable.

variable sample img

Upvotes: 1

Views: 4049

Answers (1)

Edmunds Folkmanis
Edmunds Folkmanis

Reputation: 572

Do what the linter says. Create alias for union type.

type InformationType = 'someValue' | 'anotherValue';
// ....
informationType: InformationType;

Upvotes: 3

Related Questions