erlef / setup-beam

Set up your BEAM-based GitHub Actions workflow (Erlang, Elixir, Gleam, ...)
MIT License
378 stars 51 forks source link

Eliminate ret in sortVersions #205

Closed wingyplus closed 1 year ago

wingyplus commented 1 year ago

Use if with return instead of set to ret.

paulo-ferraz-oliveira commented 1 year ago

Thanks for the pull request.

When I coded that I wanted to avoid early returns, so the function was easier to reason on (defect of using FP too much? 😆).

Sorry if the code isn't explicit in that sense.

Closing...

wingyplus commented 1 year ago

I think declaring ret at the beginning of the function is also hard to read. But when I use if/else if/else, it got reported by eslint. T_T So I ended up like this.

paulo-ferraz-oliveira commented 1 year ago

Not sure how you're running eslint but we usually do as:

npm install
npm run jslint

or

npm run build-dist

if you wanna run everything required for contributing.