Skip to content

Fix formatting between for and await#21254

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

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

Conversation

@esakkiraj
Copy link
Copy Markdown
Contributor

Fixes #21084

@msftclas
Copy link
Copy Markdown

msftclas commented Jan 18, 2018

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 mhegazy changed the title Fix issue 21084 Fix formatting between for and await Jan 18, 2018
@esakkiraj
Copy link
Copy Markdown
Contributor Author

esakkiraj commented Jan 21, 2018

@mhegazy Updated the pull request with the changes mentioned.

@mhegazy mhegazy merged commit 92bde08 into microsoft:master Jan 21, 2018
@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