Fork me on GitHub
#clj-kondo
<
2023-03-28
>
igrishaev09:03:55

Can anyone remind me please how to fix/bypass this message: "unsupported binding form". The code I have is:

(let [{promoter-oid :oid}
        (system/with-tx [tx :admin-db]
          (system/create-resource tx
                                  "Promoter"
                                  {:name "Test"}))

borkdude09:03:16

@U1WAUKQ3E This is presumably because you have:

:lint-as {system/with-tx clojure.core/let}
?

igrishaev09:03:08

ah, right, I haven't check that! Thank you!

borkdude09:03:18

hmm, no that isn't it

borkdude09:03:33

can you provide a full self-contained example and your corresponding config?

borkdude09:03:58

This works fine for me:

(ns scratch
  {:clj-kondo/config '{:lint-as {system/with-tx clojure.core/let}}}
  (:require [system :as system]))



(let [{promoter-oid :oid}
      (system/with-tx [tx :admin-db]
        (system/create-resource tx
                                "Promoter"
                                {:name "Test"}))])

igrishaev10:03:58

Iā€™m afk for a while, will post updates soon

šŸ‘ 2
igrishaev13:03:50

So I removed this macro from the lint-as sections and it worked. Then I added it into the unresolved-symbol section to mute warning for tx vars and similar. Thank you again!

borkdude13:03:39

Why did it not work for you?

igrishaev13:03:33

Hm, I don't know for sure, the but the current approach is completely fine to me. I'm not sure that linting this macros as let would be fine as it might accept up to three arguments in the first vector.

borkdude13:03:54

oh I see :)

igrishaev09:03:11

So the linter doesn't like the :admin-db key