Fork me on GitHub
#clj-kondo
<
2023-02-03
>
DrLjótsson05:02:23

Is anyone aware of a clj-kondo hook for Plumatic Schema's defn?

(s/defn stamped-names :- StampedNames
  [names :- [s/Str]]
  (StampedNames. (str (System/currentTimeMillis)) names))

DrLjótsson05:02:23

Nevermind, upgrading to the latest version fixed it for me.

DrLjótsson05:02:43

Latest version of schema that is

borkdude09:02:53

I'm not sure what the problem was since schema.core/defn is supported by default in clj-kondo

DrLjótsson10:02:28

You're right. I’m new to clj-kondo... I don't use schema.core/defn itself, but I have my own macro with the same argument syntax. So I thought that I needed to locate the hook for schema.core/defn to apply it to my macro. But then I just tried :lint-as and it worked fine.

borkdude10:02:56

yes, lint-as works for that purpose

🙌 2
henrik15:02:30

Is there a way to elide warnings from stuff like ["@heroicons/react/24/outline" :refer [XMarkIcon Bars3BottomLeftIcon MagnifyingGlassIcon]] and its usages? Edit: Sorry, Kondo is not complaining, Cursive is. 😅

escherize18:02:22

Not sure where to write this, but a linter for docstrings would be nice. This might exist, but anyway: docstrings can reference vars, and checking if the vars are defined would add value. example in 🧵

escherize18:02:14

(ns here)
(def a 3)
(defn return-a "returns [[hare/a]]" [] a)
^ could result in a linter error in the doc string, since the ns is spelled wrong, and there is no hare/a