I'm trying to come up with an appropriate clj-kondo config for Fulcro mutations, https://book.fulcrologic.com/#_mutations. Specifically this form:
(defmutation add-person [params]
(action [env] ...)
(remote [env] ...)
(rest [env] ...)
(ok-action [env] ...)
(error-action [env] ...))
Currently my config looks like:
{:lint-as
{clojure.test.check.properties/for-all clojure.core/let
com.fulcrologic.fulcro.components/defsc clojure.core/defn
com.fulcrologic.fulcro.mutations/defmutation clojure.core/defn
com.wsscode.pathom.connect/defresolver clojure.core/defn}
:linters
{:unresolved-symbol
{:exclude
[(com.fulcrologic.fulcro.mutations/defmutation [action error-action ok-action remote])]}}}}
This works, but I also want to have action, error-action, etc. treated like defn too. Is this possible?I activated discussions on clj-kondo: https://github.com/borkdude/clj-kondo/discussions. Nice way for archiving Q/A.
@tvaughan Hmm, that looks similar to defprotocol
or defrecord
but not quite. I think your best best is to exclude all unresolved symbols or better, write a hook for fulcro and submit it to https://github.com/clj-kondo/config or the fulcro repo itself (https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#exporting-and-importing-configuration)
Looks like I'll need to write a hook. Thanks for the pointer @borkdude
@tvaughan let me know if you're jamming on this. I might take a stab at it today with the documentation borkdude posted below, but you'll probably get there faster if you're going for it
Hey @aleksander990 I won’t get to this until next week. Please go for it. I’ll be happy to play tester if you’d like