Fork me on GitHub
#clj-kondo
<
2019-10-15
>
borkdude08:10:17

@martinklepsch I looked at the README and found this snippet:

(ns foo
  (:require [rum.core :as rum]))

(rum/defcs stateful < (rum/local 0 ::key)
  [state label]
  (let [local-atom (::key state)]
    [:div { :on-click (fn [_] (swap! local-atom inc)) }
     label ": " @local-atom]))

(rum/mount (stateful "Click count") js/document.body)
I think I would config that as:
{:lint-as {rum.core/defcs clojure.core/def}
 :linters {:unresolved-symbol {:exclude [(rum.core/defcs)]}}}

borkdude08:10:01

so you will lint the macro as def because it defs a var, but you will ignore all unresolved symbols in the call to it

borkdude09:10:50

created a project board for clj-kondo here: https://github.com/borkdude/clj-kondo/projects/1

martinklepsch09:10:38

I see, thanks @borkdude! would it be in scope for clj-kondo to support custom macros like defc and friends more completely?

borkdude09:10:32

could implement support for it. is rum considered a widely used lib and does the author plan to support it long term? (I noticed he recently removed the patreon link for it)

martinklepsch09:10:25

I would consider it among the more popular libs for sure. I think there’s not much active development but people use it and its stable.

borkdude09:10:34

alright. could you make an issue for it and describe some variations of macros that you think should be supported?

borkdude09:10:35

it's not that hard probably. clj-kondo also supports other defn like macros like schema.core/defn