Fork me on GitHub
#clj-kondo
<
2020-12-08
>
tvaughan17:12:01

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?

borkdude22:12:12

I activated discussions on clj-kondo: https://github.com/borkdude/clj-kondo/discussions. Nice way for archiving Q/A.

borkdude22:12:00

@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)

tvaughan23:12:30

Looks like I'll need to write a hook. Thanks for the pointer @borkdude

Aleksander Rendtslev09:12:18

@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

tvaughan11:12:16

Hey @U01DH13SK8E I won’t get to this until next week. Please go for it. I’ll be happy to play tester if you’d like