This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-14
Channels
- # announcements (9)
- # beginners (49)
- # calva (26)
- # cider (6)
- # clj-kondo (17)
- # cljsjs (1)
- # cljsrn (2)
- # clojure (72)
- # clojure-europe (5)
- # clojure-france (8)
- # clojure-greece (1)
- # clojure-italy (5)
- # clojure-nl (9)
- # clojure-spec (49)
- # clojure-uk (17)
- # clojuredesign-podcast (13)
- # clojurescript (137)
- # cursive (15)
- # data-science (1)
- # datomic (55)
- # duct (2)
- # emacs (5)
- # figwheel-main (11)
- # fulcro (11)
- # graphql (1)
- # hoplon (1)
- # instaparse (1)
- # jobs (12)
- # jobs-rus (1)
- # leiningen (1)
- # nrepl (34)
- # nyc (2)
- # off-topic (1)
- # onyx (1)
- # pedestal (1)
- # re-frame (6)
- # reitit (3)
- # remote-jobs (1)
- # shadow-cljs (196)
- # sim-testing (1)
- # spacemacs (9)
- # sql (1)
- # vim (70)
- # xtdb (31)
(ns foo (:require ["bar" :as Bar])) (Bar.)
gives a warning for unused namespace. That’s a normal use case with shadow-cljs when a js library has module.exports = Bar
.
I’d like to provide a fix but am not sure where to start.
In fact it seems to me like there’s something off with constructor calls…
I think so, but I only work with shadow-cljs right now.
I think there was already a fix for this when using Bar
as a value recently. But interop is pretty much ignored by clj-kondo, so the fix might not be straight forward.
Feel free to post an issue so I can think about it more. I'd be happy to point you in the right direction if you want to do a PR. Please post that in the message as well, if you're interested in doing one.
I think you can avoid the false positive right now, by just having something like (comment Bar)
in your code 😜
this was the fix when using Bar
as a value: https://github.com/borkdude/clj-kondo/commit/a45565de713cc5c510640c247d2f013777eaff54
in fact it might be easy to hack it in in that place, by just stripping the last dot
Ok. I’m reading CLJS docs now to see if this is a shadow-cljs extension and I’m starting to think it is. Still interested in a fix?
> As discussed on Slack: it would be nice to only have this behavior if the user requires the namespace using a string. yes, that would be a good way to do both of these
I remember this feature not being documented well in CLJS but as a value it still worked
Yep, I’ll read it later and make sure this works the same way. Thanks!
Has there been a conversation around Rum + clj-kondo? Rum’s macros trip up some of the analysis and I’m not sure it’s as easy as saying “they’re like defn” because they can take mixins etc