This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-17
Channels
- # adventofcode (3)
- # announcements (1)
- # babashka (25)
- # beginners (55)
- # calva (12)
- # cider (40)
- # clj-kondo (13)
- # clojure-australia (2)
- # clojure-dev (11)
- # clojure-europe (67)
- # clojure-france (6)
- # clojure-nl (16)
- # clojure-uk (9)
- # clojuredesign-podcast (9)
- # clojurescript (17)
- # conjure (7)
- # cursive (3)
- # datomic (3)
- # emacs (8)
- # figwheel-main (7)
- # fulcro (21)
- # google-cloud (21)
- # graphql (8)
- # helix (1)
- # honeysql (32)
- # instaparse (2)
- # jobs (2)
- # jobs-discuss (2)
- # meander (80)
- # mount (1)
- # off-topic (25)
- # pathom (31)
- # polylith (1)
- # rdf (24)
- # re-frame (21)
- # reagent (29)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (16)
- # slack-help (6)
- # sql (5)
- # tools-deps (23)
- # uncomplicate (2)
- # wasm (2)
- # xtdb (4)
Today I show you how to use babashka and clj-kondo to find var usages in the current project. https://youtu.be/TvBmtGS0KJE
Any mitigation or advice concerning the following false warning report? Seems to be down to the use of the reader condition #?@
in a cljc
file:
you can add a comment to instruct clj-kondo to ignore that problem for :clj
#_{:clj-kondo/ignore #?(:clj [:unused-binding] :cljs [])}
(defn foo
[x]
#?(:clj 1 :cljs x))
in fact this is not a false warning report. for cljc files clj-kondo is trying to analyze all contexts (clj and cljs) and your snippet has unused binding for clj scope
more info — https://cljdoc.org/d/clj-kondo/clj-kondo/2021.02.13/doc/configuration#ignore-warnings-in-an-expression
Thanks for the input @U04V4KLKC. It would be nice if I could configure the lint reports so that:
#_{:clj-kondo/ignore #?(:clj [:unused-binding] :cljs [])}
(defn foo
[x]
#?(:clj 1 :cljs x))
style "ignoring" is applied across the board for my .cljc
files and their associated vars, as I see similar reports quite often in my work project.@U191H9E5C Why would you disable the warning for one language and not the other?
We have a tree of cljc
code containing uix
components, which we render server-side and subsequently render in a "rehydrated" context where cljs
logic kicks-in. A number of our functions have parameters that are only referenced in the :cljs
expressions within the functions, hence the clj-kondo warnings I showed in the example above are prevalent.
Most of the time I don't care if a parameter is used in either clj
or cljs
land, I only care if it isn't used anywhere in a function. Hopefully it makes sense.
If you are interested in clojure-lsp (powered by clj-kondo), @ericdallo will be presenting at the Dutch Clojure Meetup in 5 minutes. Welcome to join. Details here: https://www.meetup.com/en-AU/The-Dutch-Clojure-Meetup/events/trmqnpyccdbnb/