Fork me on GitHub
#clj-kondo
<
2023-05-22
>
mkvlr06:05:39

Seeting this with the latest clj-kondo release. Should it say what var is unresolved? src/nextjournal/clerk/viewer.cljc:299:27: warning: Unresolved var:

mkvlr06:05:00

offending expression is with line 299 being the middle one

(defn inspect-fn []
  #?(:clj (->viewer-eval 'nextjournal.clerk.render/inspect-presented)
     :cljs (eval 'nextjournal.clerk.render/inspect-presented)))

mkvlr07:05:10

can’t repro with a single file

mkvlr07:05:33

ah, it’s the hook we have on ->viewer-eval . Is there a way for me to tell kondo that that’s a cljs var, not a clj one in the hook?

borkdude07:05:28

I'll look into this in about an hour :)

🙌 2
🙏 2
borkdude09:05:06

@U5H74UNSF Here is a potential fix but I'm not sure if this is the right one. What I'm doing here is just ignore the contents of ->viewer-eval in the clj branch and expand to syntax-quote in the cljs branch: https://github.com/nextjournal/clerk/pull/494

mkvlr09:05:12

would be awesome to get validations in clj as well, is that possible?

borkdude09:05:33

Thinking.... When you write

(->viewer-eval 'nextjournal.clerk.render/inspect-presented)
in .clj , what would be "validations"?

borkdude09:05:35

The quoted expression in clj always points to .cljs vars right?

mkvlr09:05:27

yes, so looking up that var in cljs would be a validation

borkdude10:05:11

I pushed a better solution now