This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-23
Channels
- # announcements (7)
- # babashka (11)
- # babashka-sci-dev (1)
- # beginners (8)
- # biff (1)
- # calva (8)
- # chlorine-clover (3)
- # cider (9)
- # clj-kondo (16)
- # cljdoc (9)
- # clojure (79)
- # clojure-australia (1)
- # clojure-dev (5)
- # clojurescript (24)
- # data-science (3)
- # datomic (2)
- # emacs (54)
- # fulcro (1)
- # graalvm (1)
- # jobs (5)
- # lsp (25)
- # malli (7)
- # meander (10)
- # off-topic (44)
- # other-languages (8)
- # portal (10)
- # remote-jobs (1)
- # sci (1)
- # shadow-cljs (6)
- # vim (4)
I have a cljs file that wraps a javascript library. I'm using a macro to dynamically generate the functions. When I require those generated functions, clj-kondo complains that those variables are unresolved. Is there a way in my clj-kondo configuration to tell it the methods it exports? macro in question: https://github.com/BerkeleyTrue/crypto-egg/blob/master/src/chalk/macro.cljc#L18
and example calls of those functions? then I might be able to say yes or no, or it depends
Here is the call https://github.com/BerkeleyTrue/crypto-egg/blob/master/src/chalk/core.cljs#L7
oops, that is the macro call. Here is the method calls https://github.com/BerkeleyTrue/crypto-egg/blob/master/src/server/infra/timbre.cljs#L8
another call https://github.com/BerkeleyTrue/crypto-egg/blob/master/src/server/infra/middlewares/logging.cljs#L34
Yes the key becomes the function name in a defn (defn (symbol (name :some-key...
this is doable. you will have to write a macro in the .clj-kondo directory for this, using the :macroexpand
option
The macro in the .clj-kondo dir can be a simplified one, e.g you just map over the keywords, turn them into symbols and produce a declare
call
Unrelated, since you're using Node.js, you might be interested in doing little scripts with #nbb https://github.com/babashka/nbb/tree/main/examples/chalk
Oh sweet! it worked. For those interested https://github.com/BerkeleyTrue/crypto-egg/blob/master/.clj-kondo/chalk/macro.clj#L3
@U04V15CAJ thanks for your help! I appreciate it. Also, neat (regarding nbb)! Definitely excited for that.