Skip to content

Conversation

@ryanb
Copy link

@ryanb ryanb commented Apr 5, 2023

This adds a plugin called strip_hash which removes spaces at the beginning and end of hash literals. For example, instead of { foo: "bar" } it generates {foo: "bar"}. This helps distinguish hashes from blocks and brings it more in-line with standard formatter. It is also similar to the deafult Prettier formatting for JS objects.

I understand if you want to keep the built-in plugins to a minimum. I'm just not sure how to accomplish this with an external plugin without monkey patching which is brittle.

Whatever the case, feel free to rename this, or reject it if it's not in line with the project.

Update: I renamed this from compact_hash to strip_hash to parallel String#strip method.

@ryanb ryanb force-pushed the compact-hash-plugin branch 2 times, most recently from 218904d to b79d921 Compare April 5, 2023 16:55
@ryanb ryanb force-pushed the compact-hash-plugin branch 2 times, most recently from dde31da to 61f2fe4 Compare March 18, 2024 17:36
@ryanb ryanb force-pushed the compact-hash-plugin branch from 61f2fe4 to 436c698 Compare March 18, 2024 17:37
@kddnewton
Copy link
Member

I think this is one of those where I want stree to be opinionated to limit the number of configuration options. But thank you for the contribution!

@kddnewton kddnewton closed this Jul 11, 2025
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

Successfully merging this pull request may close these issues.

2 participants