mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Auto format: no space between closing parenthesis and string template
This commit is contained in:
@@ -129,6 +129,9 @@ namespace ts.formatting {
|
||||
// template string
|
||||
rule("NoSpaceBetweenTagAndTemplateString", SyntaxKind.Identifier, [SyntaxKind.NoSubstitutionTemplateLiteral, SyntaxKind.TemplateHead], [isNonJsxSameLineTokenContext], RuleAction.Delete),
|
||||
|
||||
// No space between closing parenthesis and template string
|
||||
rule("NoSpaceBetweenCloseParenAndTemplateString", SyntaxKind.CloseParenToken, SyntaxKind.NoSubstitutionTemplateLiteral, [isNonJsxSameLineTokenContext], RuleAction.Delete),
|
||||
|
||||
// JSX opening elements
|
||||
rule("SpaceBeforeJsxAttribute", anyToken, SyntaxKind.Identifier, [isNextTokenParentJsxAttribute, isNonJsxSameLineTokenContext], RuleAction.Space),
|
||||
rule("SpaceBeforeSlashInJsxOpeningElement", anyToken, SyntaxKind.SlashToken, [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], RuleAction.Space),
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
//// foo() `abc`;
|
||||
//// bar()`def`;
|
||||
|
||||
format.document();
|
||||
verify.currentFileContentIs(
|
||||
`foo()\`abc\`;
|
||||
bar()\`def\`;`
|
||||
);
|
||||
Reference in New Issue
Block a user