Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: reduces duplication in sort-union-types and sort-intersection-types #439

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hugop95
Copy link
Contributor

@hugop95 hugop95 commented Jan 3, 2025

Description

The differences between the source code of sort-union-types and sort-intersection-types are minimal (https://www.diffchecker.com/NZ9LSvo7/). Outside meta-related information (rule name, error IDs, etc), the only logic-related differences are

This PR creates a sortUnionOrIntersectionTypes function that puts all of this logic in common to greatly reduce code duplication.

No test impacted.

What is the purpose of this pull request?

  • Other

@hugop95 hugop95 changed the title refactor: merges code in common between sort-union-types and sort-intersection-types refactor: reduces duplication in sort-union-types and sort-intersection-types Jan 3, 2025
@hugop95 hugop95 marked this pull request as ready for review January 3, 2025 22:09
@hugop95 hugop95 force-pushed the refactor/sort-union-types branch from b5f56c1 to 93a62e0 Compare January 4, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant