Fork me on GitHub

how can I disable warning for unused imports? have user.clj with:

(ns user
  (:require [integrant.repl :refer [clear go halt prep reset reset-all]]
            [integrant.repl.state :as state]))
, which causes (for all of the unused ones):
... warning: #'integrant.repl/clear is referred but never used



{:config-in-ns {user {:linters {:unused-referred-var {:level :off}}}}}


that’s good, thanks!


This would probably be more obvious if I had a dependency that provided a clj-kondo config as I could see what the steps are doing but do steps 3 and 4 of the section only need to be done with a dependency changes? Results of both committed to your own repo or only step 3?

Joshua Suskalo21:06:55

Has there been a lint considered for putting type hint for return values of protocol definitions on the arglist instead of on the method name like you're supposed to do?


@suskeyhose There is a linter which does this for normal functions - perhaps it already works for protocol implementations? not sure

Joshua Suskalo21:06:47

yeah, but it has kinda the opposite requirement

Joshua Suskalo21:06:20

(defn blah ^return [arg1 arg2] ...)
(extend-protocol Blah
  (^return method [arg1 arg2] ...))


@didibus already posted an issue about this. References to official Clojure docs would be useful and then we can make a linter

Alex Miller (Clojure team)21:06:43

deftype and defrecord inline method impls for sure

Alex Miller (Clojure team)21:06:48

Method definitions take the form:

(methodname [args*] body)

The argument and return types can be hinted on the arg and
methodname symbols.

Alex Miller (Clojure team)21:06:31

yeah, also in reify docstring

👍 1
Alex Miller (Clojure team)21:06:33

not sure what happens with extend-... - those get expanded into extend calls which don't really have the method name as a symbol anymore, not sure if that type hint is retained anywhere, probably not by just glancing at the code

Alex Miller (Clojure team)21:06:23

I guess there's not really any need for protocols, only for Java interfaces to satisfy the type gods