Fork me on GitHub
#clj-kondo
<
2020-09-24
>
robert-stuttaford07:09:11

hi @borkdude 🙂 do you know if anyone has a reagent.core/with-let linter, that shows you unused bindings?

borkdude07:09:50

@robert-stuttaford I think you can just use :lint-as + clojure.core/let for that

robert-stuttaford07:09:47

ok that simple, nice

robert-stuttaford07:09:38

turns out we are...

borkdude07:09:50

but it doesn't work?

robert-stuttaford07:09:18

it does correctly warn that symbols are not defined when used on the right side of the binding, but it doesn't warn that bindings in the form are unused

borkdude07:09:30

@robert-stuttaford This warns that x is unused for me:

(ns foo
  {:clj-kondo/config '{:lint-as {reagent.core/with-let clojure.core/let}}}
  (:require [reagent.core :refer [with-let]]))

(with-let [x 1]
  (fn []))

robert-stuttaford07:09:00

ok, i'll dig and see if i can figure out what's going on, thank you!

borkdude07:09:09

might be related to your config for defcomp

borkdude07:09:17

which is probably a custom macro

robert-stuttaford07:09:58

lol :unused-binding {:level :off} in config.edn is prrrrrrobably why

robert-stuttaford07:09:55

there's a comment citing this issue https://github.com/borkdude/clj-kondo/issues/885 which is now fixed yay

robert-stuttaford08:09:24

ok it works, false alarm, sorry for the noise

borkdude08:09:42

np :) btw, you use both Rum and Reagent?

robert-stuttaford08:09:11

i'm helping a different team out with some stuff 🙂