Skip to content

Autoformat option to automatically wrap object properties in single quotes #2104

Open
@o-l-a-v

Description

@o-l-a-v

Summary of the new feature

I prefer to have all $Object.'properties' wrapped in single quotes.

  • Makes it easy to see whats a property and whats a method.
  • Uniformity for all properties: Properties with characters like whitespace must be wrapped in single or double quotes.

Today I do this manually. Would be awesome with an autoformat rule that wraps properties into string single quotes.

Proposed technical implementation details (optional)

Before autoformat:

$Object.property
$Object.method()

After autoformat:

$Object.'property'
$Object.method()

What is the latest version of PSScriptAnalyzer at the point of writing

v1.24.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions