oakmac / standard-clojure-style-js

Standard Clojure Style in JavaScript
ISC License
84 stars 1 forks source link

bug with moving comma at the end of a line #104

Closed oakmac closed 1 month ago

oakmac commented 1 month ago

Follow-up from Issue #102

This is incorrect behavior. The comma at the end of the line should not be moved.

oakmac commented 1 month ago

The current behavior is clearly buggy, but I wonder if Standard Clojure Style should remove commas at the end of lines entirely? Not sure of a case where it makes a lot of sense to keep a comma at the end of a line.

oakmac commented 1 month ago

I wonder if Standard Clojure Style should remove commas at the end of lines entirely?

trailing-whitespace

oakmac commented 1 month ago

I am leaning toward "Standard Clojure Style should treat eol commas as whitespace and remove them"

NoahTheDuke commented 1 month ago

Yes, and imo this aligns with the Clojure Style Guide. The "Optional Commas in Maps" section has a map with each entry on separate lines and no commas, and a map with both entries on one line and a comma between. Regardless of thoughts on the latter, the former indicates that commas shouldn't be at the end of the line.

oakmac commented 1 month ago

Fixed with PR-107