-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Linter error on -> and ->> without forms. #36
Comments
Interesting, I did not realize |
Sure, but it becomes worse with more args: (map #(-> {:foo %2 :bar %1 :baz %4 :qux %3}) coll) vs. (map (fn [a b c d] {:foo b :bar a :baz d :qux c}) coll) Anyway, this is subjective and not really the point. The point is that in this case linter appears to limit the functionality of the language and the "limitations vs. mistakes caught" ratio is not in its favor (unlike, say, checking for things like |
I also didn't know that anyone used threading macros this way, though I've occasionally used |
I've hit bugs where the threaded form updates some stateful thing and the error only crops up at some later point, so I appreciate the linting. (->> things)
(mapv update-in-db!) The |
This is addressed by 5b5375c: you can now turn off linting for this case by setting
Thanks @snoe, @rgdelato and @iafilatov for your input. |
Cool, thanks! |
->
and->>
with one arg could have it's use cases. For ex. mapping "to a structure":which cause "No forms in ->". This has to be written like
I assume the linter wants to guard against mistakes like
but I can't think of any examples where this could go unnoticed and not cause problems immediately.
The text was updated successfully, but these errors were encountered: