Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Added "check-type-list" as option to whitespace rule #2884

Closed
wants to merge 2 commits into from
Closed

Added "check-type-list" as option to whitespace rule #2884

wants to merge 2 commits into from

Conversation

JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Jun 4, 2017

It'll now check whitespace around the operators in syntax lists (| and &).
Fixes #2818.

PR checklist

Overview of change:

Also changed references to the const options to use the actual option variable and alphabetized the listings. Figured it'd be a little cleaner this way.
The maxLength for options was listed at 7 despite there originally being 8 options (any particular reason?), so I bumped it to 9 for this 9th option.

CHANGELOG.md entry:

[enhancement] Added type list checking to whitespace

It'll now check whitespace around the operators in syntax lists (`|` and `&`).
Fixes #2818.

Also changed references to the const options to use the actual option variable and alphabetized the listings. Figured it'd be a little cleaner this way.
The `maxLength` for options was listed at 7 despite there originally being 8 options (any particular reason?), so I bumped it to 9 for this 9th option.
@ajafff
Copy link
Contributor

ajafff commented Aug 1, 2017

Fixes #488

Copy link
Contributor

@ajafff ajafff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please enable this new option in all.ts and latest.ts

@@ -96,6 +100,11 @@ function walk(ctx: Lint.WalkContext<Options>) {
checkEqualsGreaterThanTokenInNode(node);
break;

case ts.SyntaxKind.IntersectionType:
case ts.SyntaxKind.UnionType:
checkTypeJoin(node.getChildren()[0] as ts.SyntaxList);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to check if the option is enabled.

@ajafff
Copy link
Contributor

ajafff commented Aug 14, 2017

Closing this, because #3083 was merged with the same functionality.
Nonetheless, thank you for this PR @JoshuaKGoldberg

@ajafff ajafff closed this Aug 14, 2017
@JoshuaKGoldberg
Copy link
Contributor Author

Ah, I took too long. Thanks anyway :)

@JoshuaKGoldberg JoshuaKGoldberg deleted the whitespace-in-typelists branch August 14, 2017 17:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend whitespace rule for pipe check
2 participants