Skip to content

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

Merged
gajus merged 1 commit intogajus:masterfrom
pnevyk:require-compound-type-alias
Oct 26, 2018
Merged

feat: Add require-compound-type-alias#365
gajus merged 1 commit intogajus:masterfrom
pnevyk:require-compound-type-alias

Conversation

@pnevyk
Copy link
Copy Markdown
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
Copy Markdown
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