fix(57590): [Formatting] Remove spaces between ... and type name in tuple spread (#57604)

This commit is contained in:
idango10 2024-03-04 19:48:48 +02:00 committed by GitHub
parent 1d6d962d31
commit 64edd07330
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View File

@ -398,6 +398,9 @@ export function getAllRules(): RuleSpec[] {
// Remove extra space between for and await
rule("SpaceBetweenForAndAwaitKeyword", SyntaxKind.ForKeyword, SyntaxKind.AwaitKeyword, [isNonJsxSameLineTokenContext], RuleAction.InsertSpace),
// Remove extra spaces between ... and type name in tuple spread
rule("SpaceBetweenDotDotDotAndTypeName", SyntaxKind.DotDotDotToken, typeNames, [isNonJsxSameLineTokenContext], RuleAction.DeleteSpace),
// Add a space between statements. All keywords except (do,else,case) has open/close parens after them.
// So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any]
rule(

View File

@ -0,0 +1,12 @@
/// <reference path="fourslash.ts"/>
//// let a: [... any[]];
//// let b: [... number[]];
//// let c: [... string[]];
format.document();
verify.currentFileContentIs(
`let a: [...any[]];
let b: [...number[]];
let c: [...string[]];`
);