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

Invalid shorthand generation #41

Closed
AlanFoster opened this issue Feb 6, 2019 · 2 comments
Closed

Invalid shorthand generation #41

AlanFoster opened this issue Feb 6, 2019 · 2 comments

Comments

@AlanFoster
Copy link
Contributor

When running prettier it seems to break the following code snippet:

-    respond_to do |format|
-      format.xml
-    end
+    respond_to(&:format)

I believe it should've been prettied as respond_to(&:xml) - or leaving it as-is, as it's not idiomatic to use this style within respond_to blocks usually 🤔

@AlanFoster
Copy link
Contributor Author

Another quick example of code that's semantically different after its been prettied:

-          tracker do |t|
-            t.google_analytics :send, { type: 'event', category: 'User', action: 'signup', label: provider }
-          end
+        tracker(&:t)

@kddnewton
Copy link
Member

This should now be fixed in v0.2.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

2 participants