Skip to content

Fix formatting between for and await - #21254

Merged
Mohamed Hegazy (mhegazy) merged 2 commits into
microsoft:masterfrom
esakkiraj:issue-21084
Jan 21, 2018
Merged

Fix formatting between for and await#21254
Mohamed Hegazy (mhegazy) merged 2 commits into
microsoft:masterfrom
esakkiraj:issue-21084

Conversation

@esakkiraj

Copy link
Copy Markdown
Contributor

Fixes #21084

@msftclas

Microsoft Contribution License Agreements (msftclas) commented Jan 18, 2018

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread src/services/formatting/rules.ts Outdated

// Remove extra space between for and await
rule("SpaceAfterFor", SyntaxKind.ForKeyword, anyToken, [ isNonJsxSameLineTokenContext ], RuleAction.Space),
rule("NoSpaceBeforeAwait", anyToken, SyntaxKind.AwaitKeyword, [ isNonJsxSameLineTokenContext ], RuleAction.Delete),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i do not think this rule is needed.

Comment thread src/services/formatting/rules.ts Outdated
rule("SpaceAfterSemicolon", SyntaxKind.SemicolonToken, anyToken, [isNonJsxSameLineTokenContext], RuleAction.Space),

// Remove extra space between for and await
rule("SpaceAfterFor", SyntaxKind.ForKeyword, anyToken, [ isNonJsxSameLineTokenContext ], RuleAction.Space),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

call this SpaceBetweenForAndAwaitKeyword. also make it between SyntaxKind.ForKeyword and SyntaxKind.AwaitKeyword, the others are already covered by other rules.

Comment thread src/services/formatting/rules.ts Outdated
rule("SpaceAfterSemicolon", SyntaxKind.SemicolonToken, anyToken, [isNonJsxSameLineTokenContext], RuleAction.Space),

// Remove extra space between for and await
rule("SpaceAfterFor", SyntaxKind.ForKeyword, anyToken, [ isNonJsxSameLineTokenContext ], RuleAction.Space),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: formatting, please remove space before and after [ and ]

@mhegazy Mohamed Hegazy (mhegazy) changed the title Fix issue 21084 Fix formatting between for and await Jan 18, 2018
@esakkiraj

Esakki Raj (esakkiraj) commented Jan 21, 2018

Copy link
Copy Markdown
Contributor Author

Mohamed Hegazy (@mhegazy) Updated the pull request with the changes mentioned.

@mhegazy
Mohamed Hegazy (mhegazy) merged commit 92bde08 into microsoft:master Jan 21, 2018
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jul 3, 2018
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.

3 participants