language-service
language-service copied to clipboard
Convert simple Match.tagsExhaustive() to Match.valueTags()
What is the problem this feature would solve?
This
Match.value(val).pipe(
Match.tagsExhaustive({
TagA: () => "a",
}),
);
can be shortened to
Match.valueTags(val, {
TagA: () => "a",
});
What is the feature you are proposing to solve the problem?
If using the Match.value(val).pipe(Math.tagsExhaustive({ ... })) expression, warn and provide a transformation to Match.valueTags(val, { ... })
What alternatives have you considered?
- Eslint rule - but this package exists and is much more useful than a custom eslint rule
- Not automatically converting this expression, and just doing it whenever I come across it manually (fine for now, but the code could be shorter and it's better to handle it automatically)