Fix conflict between formatting rules (#21038)
This commit is contained in:
parent
e78ac47208
commit
e35585b938
2 changed files with 8 additions and 1 deletions
|
@ -80,7 +80,7 @@ namespace ts.formatting {
|
|||
rule("SpaceAfterSubtractWhenFollowedByUnaryMinus", SyntaxKind.MinusToken, SyntaxKind.MinusToken, [isNonJsxSameLineTokenContext, isBinaryOpContext], RuleAction.Space),
|
||||
rule("SpaceAfterSubtractWhenFollowedByPredecrement", SyntaxKind.MinusToken, SyntaxKind.MinusMinusToken, [isNonJsxSameLineTokenContext, isBinaryOpContext], RuleAction.Space),
|
||||
|
||||
rule("NoSpaceAfterCloseBrace", SyntaxKind.CloseBraceToken, [SyntaxKind.CloseBracketToken, SyntaxKind.CommaToken, SyntaxKind.SemicolonToken], [isNonJsxSameLineTokenContext], RuleAction.Delete),
|
||||
rule("NoSpaceAfterCloseBrace", SyntaxKind.CloseBraceToken, [SyntaxKind.CommaToken, SyntaxKind.SemicolonToken], [isNonJsxSameLineTokenContext], RuleAction.Delete),
|
||||
// For functions and control block place } on a new line [multi-line rule]
|
||||
rule("NewLineBeforeCloseBraceInBlockContext", anyTokenIncludingMultilineComments, SyntaxKind.CloseBraceToken, [isMultilineBlockContext], RuleAction.NewLine),
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
///<reference path="fourslash.ts"/>
|
||||
|
||||
////[{}]
|
||||
|
||||
format.setOption("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets", true);
|
||||
format.document();
|
||||
verify.currentFileContentIs("[ {} ]");
|
Loading…
Reference in a new issue