Skip to content

Formatter adds spaces around a hyphen, but only if it is followed by a variable #847

Closed
@exchange12rocks

Description

@exchange12rocks

Unformatted code:

$Var = 6
(Get-Date).AddDays(-6)
(Get-Date).AddDays(-$Var)

Formatted code:

$Var = 6
(Get-Date).AddDays(-6)
(Get-Date).AddDays( - $Var)

As you can see, the formatter adds spaces around a hyphen which is followed by a variable but does not add them if a hyphen is followed by a number. I think, the behavior should be consistent.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions