jfmengels / elm-review-simplify

Provides elm-review rules to simplify your Elm code
https://package.elm-lang.org/packages/jfmengels/elm-review-simplify/latest/
BSD 3-Clause "New" or "Revised" License
20 stars 9 forks source link

Report immediately invoked anonymous functions #124

Closed jfmengels closed 1 year ago

jfmengels commented 1 year ago

Fixes #111

This reports but does not autofix anonymous functions that get directly invoked.

I'd love feedback on this. The message and details are more important than for other errors because there is no autofix. Let me know if you have any feedback (on this aspect or another) cc @lydell. PR can be reviewed commit by commit.

jfmengels commented 1 year ago

I added pipeline support to this branch in the way that was mentioned above.

You can try out the change using:

elm-review --template jfmengels/elm-review-simplify/preview#direct-lambda-calls

Let me know what you think!

lydell commented 1 year ago

Awesome!

It found 8 errors at work, and all of them became better when rewritten, either by switching to let-in or by extracting a function.

jfmengels commented 1 year ago

Awesome, then it's time to merge :blush: