Skip to content
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

Plugin to remove spaces in hash #360

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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
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.

1 participant