avh4 / elm-format

elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
BSD 3-Clause "New" or "Revised" License
1.31k stars 148 forks source link

feature request: Automatically convert snake_case to camelCase #637

Open showell opened 5 years ago

showell commented 5 years ago

I think the title here mostly explains what I want. Feel free to close if this is out of scope of the formatter.

My experience coming to Elm is that I have a lot of muscle_memory that makes me type out names like get_previous_locations, and I'd be happy to just have the formatter fix it for me.

The only exceptions are edge cases like can_go_n_spaces, where camel case is kinda ugly (canGoNSpaces), but not terrible. (I'd possibly want names with only one character between underscores to be a warning, so I could come up with a nicer name, rather than auto-convert.)

miniBill commented 5 years ago

The problem I see with this is that it changes the API of the code you write, so I think it's out of scope. OTOH this looks like a perfect fit for https://github.com/jfmengels/elm-review