Skip to content

Convert simple Match.tagsExhaustive() to Match.valueTags() #496

@bigpopakap

Description

@bigpopakap

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions