This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-13
Channels
- # aleph (8)
- # announcements (3)
- # beginners (36)
- # calva (1)
- # cider (1)
- # circleci (3)
- # clj-kondo (9)
- # cljdoc (58)
- # clojars (7)
- # clojure (70)
- # clojure-europe (13)
- # clojure-japan (1)
- # clojure-nl (8)
- # clojure-russia (2)
- # clojure-uk (7)
- # clojuredesign-podcast (4)
- # clojurescript (67)
- # clojureverse-ops (14)
- # cursive (6)
- # data-science (1)
- # datahike (3)
- # datomic (6)
- # docker (1)
- # events (2)
- # figwheel-main (9)
- # fulcro (4)
- # graalvm (33)
- # graphql (8)
- # helix (1)
- # jobs (1)
- # leiningen (3)
- # lsp (39)
- # malli (9)
- # minecraft (31)
- # nextjournal (7)
- # off-topic (6)
- # portal (22)
- # re-frame (5)
- # reitit (5)
- # remote-jobs (1)
- # shadow-cljs (55)
- # sql (22)
- # tools-build (3)
- # tools-deps (4)
- # xtdb (6)
Does anyone have a suggestion for fixing warnings for unsued bindings in cljs anonymouse fns? Example:
(hooks/use-callback
[]
(util/debounce
(fn [ev]
(let [{:keys [input-value]} (util/->clj ev)]
(when on-change
(on-change input-value))))
debounce-time))
I tried using the lsp action resolves as clojure.core/defn but that didn't help. That also seems like it shouldn't be needed so probably not a good plan
Similarly in this example I get used binding on the second arg, item, but not the first...
(chakra/List
(->clj (getMenuProps))
(when isOpen
(map-indexed
(fn [i item]
(chakra/ListItem
(merge
{:key i
:bg (if (= highlightedIndex i)
"#bde4ff"
"#F7FAFC")
:borderBottom "solid 1px #E2E8F0"}
(->clj (getItemProps (->js {:item (->js item)
:index i
:key i}))))
(render-item
{:hover? (= highlightedIndex i)
:item item})))
items)))
Yup, in both examples the vars are for sure used. It seems like somehow any anonymous fn arg is having this happen in my cljs code...
Here is my config.edn
{:linters {:unresolved-symbol {:exclude [_]}
:invalid-arity {:skip-args [mxv.client.react/defrc]}
:unused-binding {:exclude-destructured-keys-in-fn-args true
:exclude-destructured-as true}}
:lint-as {mxv.client.react/defrc clojure.core/defn
com.wsscode.pathom.connect/defmutation clojure.core/defn}
:skip-comments true
:config-paths ["clj-kondo/helix"]}