clj-kondo

https://github.com/clj-kondo/clj-kondo
robert-stuttaford 2020-09-24T07:25:11.000700Z

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

borkdude 2020-09-24T07:45:50.001100Z

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

robert-stuttaford 2020-09-24T07:50:47.001400Z

ok that simple, nice

robert-stuttaford 2020-09-24T07:51:38.001800Z

turns out we are...

borkdude 2020-09-24T07:54:50.002Z

but it doesn't work?

robert-stuttaford 2020-09-24T07:55:24.002200Z

no 😞

robert-stuttaford 2020-09-24T07:56:18.003100Z

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

robert-stuttaford 2020-09-24T07:57:22.003400Z

borkdude 2020-09-24T07:57:30.003900Z

@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-stuttaford 2020-09-24T07:58:00.004200Z

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

borkdude 2020-09-24T07:58:09.004400Z

might be related to your config for defcomp

borkdude 2020-09-24T07:58:17.004600Z

which is probably a custom macro

robert-stuttaford 2020-09-24T07:58:58.005100Z

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

robert-stuttaford 2020-09-24T07:59:55.005500Z

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

robert-stuttaford 2020-09-24T08:00:24.006Z

ok it works, false alarm, sorry for the noise

borkdude 2020-09-24T08:00:42.006300Z

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

robert-stuttaford 2020-09-24T08:01:11.006600Z

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