This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-13
Channels
- # announcements (1)
- # asami (6)
- # babashka (7)
- # beginners (94)
- # biff (1)
- # calva (18)
- # clj-kondo (35)
- # cljsrn (1)
- # clojure (7)
- # clojure-europe (1)
- # clojure-nl (1)
- # clojure-uk (1)
- # clojurescript (18)
- # core-logic (1)
- # datalog (2)
- # editors (10)
- # exercism (2)
- # figwheel-main (1)
- # fulcro (2)
- # introduce-yourself (1)
- # lsp (33)
- # malli (7)
- # off-topic (3)
- # pedestal (1)
- # portal (2)
- # re-frame (16)
- # releases (1)
- # shadow-cljs (10)
- # specter (3)
- # tools-deps (8)
What is the correct syntax for specifying configuration in the (ns ...)
form?
I'm trying to turn of clojure-lsp warning messages about unused public vars in Calva IDE
So the config would be something like:
(ns foo
{:clj-kondo/config '{:linters {clojure-lsp/unused-public-var {:level :warning}}})
should that be a commented form with #_?
okay, good to know. Is it basically an attrib map for the ns? I don't think I'd seen a map in the ns form before.
thanks
I’m wondering about determining if a macro is part of a cljs api from clj-kondo analysis 🧵
I’m looking into this as part of https://github.com/cljdoc/cljdoc/issues/543 but it would also apply to tools like https://github.com/borkdude/api-diff
My current understanding is that if :require-macros
is used from cljs/cljc namespace x on clj/cljc namespace x then namespace x will have those macros available for use from a cljs client. (And there’s also :refer-macros
and :include-macros
sugar syntax but let’s leave that out maybe for the moment).
But… I might be missing some common way folks include macros for consumption from a cljs api…
After I get a grip on how folks do include macros in their cljs apis. I’ll then want to figure out how to glean the cljs API from clj-kondo analysis data.
@UKFSJSM38 did you have to make any similar determinations for your lsp work?
Not at all, clojure-lsp doesn't need to know that, we always rely on what kondo qualifies as macro or not
Ah ok, thanks for letting me know @UKFSJSM38!
@U04V15CAJ, do you have any thoughts/wisdom?
I guess I’m just trying to learn how cljs/cljc library authors typically expose macros for cljs consumption in their APIs.
you cannot statically know if a macro is for public consumption or not, unless it's marked with skip-wiki or whatever
E.g. I'm pretty sure some of these macros are not for public consumption: https://cljdoc.org/d/org.clojure/core.match/1.0.0/api/cljs.core.match Yet they appear in the cljdoc output.
I expect that cljdoc load-time analysis learnt of those because of https://github.com/clojure/core.match/blob/eec02931ead4dd86abe7bedea2d8e15ced6bc3de/src/main/clojure/cljs/core/match.cljs#L1-L2
I don't see why it needs that. Even without that the macros are publically accessible for any other cljs lib.
These macros are even accessible by JVM clojure itself, so you cannot statically infer what is the intention behind those macros