Fork me on GitHub
#clj-kondo
<
2022-12-29
>
jkxyz22:12:55

Is there a built-in hook similar to clj-kondo.lint-as/def-catch-all which treats the first arg as a var name and lints the rest of the args as if it's a normal function call? I feel like I run into these kinds of macros pretty often and def-catch-all isn't ideal because it seems to disable most linters. instaparse.core/defparser and devcards.core/defcard come to mind. They just take a name and some data.

borkdude22:12:42

> which treats the first arg as a var name and lints the rest of the args as if it's a normal function call? In that case you can use {:lint-as {... clojure.core/def}}

jkxyz22:12:19

Will that work for an arbitrary number of arguments?

jkxyz22:12:09

Well it seems to work, thanks! I was thinking that :lint-as would make it throw an invalid-arity error when the args don't match clojure.core/def

borkdude22:12:33

I hadn't thought about that, but if it works... :)