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

feat: Add require-compound-type-alias #365

Merged
merged 1 commit into from
Oct 26, 2018

Conversation

pnevyk
Copy link
Contributor

@pnevyk pnevyk commented Oct 25, 2018

I added a rule which enforces to use type aliases for union and intersection types. I found myself that when I use them in their "raw" or "explicit" (or how to call it?) form I ended up with copy&pasting them all over the code where they were needed. This was true especially when I didn't know they will be needed somewhere else first and this requirement came afterwards. I know that not using copy&paste of code is kind of developer's responsibility and elementary "skill" but laziness sometimes wins.

The name of the rule can be discussed. We have already union-intersection-spacing rule so using compound type phrase is a little inconsistency. Also I don't know if it is clear what is meant by compound type for the first look.

@gajus gajus merged commit 6585121 into gajus:master Oct 26, 2018
@gajus
Copy link
Owner

gajus commented Oct 26, 2018

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants