Fork me on GitHub
#clj-kondo
<
2020-05-01
>
dominicm16:05:41

What's the status of carve & cljs? I have some very obviously in-use vars being highlighted by carve.

borkdude17:05:18

When I put this in a file foo.cljs and run carve over it:

(defn foo [])
(identity foo)
it doesn't report anything. But when I remove (identify foo) it reports foo as unused.

borkdude17:05:41

Invoked as:

clojure -A:carve --opts '{:paths ["/tmp/foo.cljs"]}'

borkdude17:05:23

so I can't repro what you are saying

dominicm16:05:43

Does it maybe struggle with fns used as vars?

(defn foo [] )

(identity foo)
?

borkdude21:05:26

Responded in the other message. With this code I couldn't repro your problem. If you have another piece of code that can reproduce it, I'd be happy to take another look

dominicm22:05:30

I will take a look with a real repro, thanks for going so far with it.

dominicm22:05:48

I suspect it might be due to the use of foreign libs in clojurescript

dominicm22:05:11

So instead of identity, it's a function that uses a npm namespace

dominicm12:05:24

@ I think it's upset because I do (defonce init (mount)) to mount the application... which is unused, which then everything is transitiviely unused too...

dominicm12:05:08

Adding that ns to the ignored ns seems to have sorted it!

dominicm12:05:39

40 unused vars to clean up :)