Home > front end >  how can I fix the warning "Replace this union type with a type alias"
how can I fix the warning "Replace this union type with a type alias"

Time:10-06

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

variable sample img

CodePudding user response:

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

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