Fork me on GitHub
#clj-kondo
<
2022-08-11
>
jcoyle00:08:13

Hi! I would like to lint hiccup that exists within cljs or cljc source code. A contrived example of a linting target would be:

[:div {:id :foo} {:class :bar} "hi"]
The linting logic would surface that there are maps at index 1 and 2 in the hiccup vector, which might be helpful in the case the 2nd map is, in fact, a mistake. Wondering if something (similar) already exist for this? If not, is clj-kondo Hooks the right approach to roll my own solution? If so does anyone know of some examples that might be helpful?

rolt06:08:32

i guess one question is: how can you distinguish hiccup vectors from regular vectors ?

rolt06:08:25

zprint has some logic for it for instance, but there are quite a few false positive

borkdude09:08:07

Unfortunately you can't hook into vectors yet with hooks