mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Auto format: no space between closing parenthesis and string template
This commit is contained in:
1 parent
f7a0e0cb42
commit
d9bc436788
2 files changed
+13
No files matched your search
@@ -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