Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
o-l-a-v opened this issue May 20, 2025 · 0 comments
Open

Comments

@o-l-a-v
Copy link

o-l-a-v commented May 20, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant