Open Deraen opened 3 years ago
Alternatives (not necessarily better than what's already mentioned):
(defmacro f [& args] `[~@args])
(r/f component 1 2 3)
This solution doesn't need any changes to other code in Reagent, but allows static analysis to detect reagent calls accurately.
[foo 1 2 3]
as a function call in .cljs files. False positives should be handled by users.Form-2 components are marked by clj-kondo as unused binding
(defn outer
[a b c] ;; <--- those parameters will get marked by clj-kondo as unused-binding
;; ....
(fn [a b c] ;; <--- they are repeated here
[:div
(str a b c)]))
@Kaspazza The way to solve this is to write:
(defn outer [_a _b _c] ...)
@borkdude Hmmm, I was in a mindset it is used so there should be no warning... But it makes sense... Thanks!
https://github.com/borkdude/clj-kondo/issues/25
:n>
:$
. Would work the same way as[comp]
, but the keyword would make it possible to find the calls.