Skip to content

Commit 21b3315

Browse files
committed
Commit clj-kondo settings
1 parent ad504f7 commit 21b3315

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{:hooks
2+
{:analyze-call
3+
{next.jdbc/with-transaction
4+
hooks.com.github.seancorfield.next-jdbc/with-transaction}}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
(ns hooks.com.github.seancorfield.next-jdbc
2+
(:require
3+
[clj-kondo.hooks-api :as api]))
4+
5+
(defn with-transaction
6+
"Expands (with-transaction [tx expr opts] body)
7+
to (let [tx expr] opts body) pre clj-kondo examples."
8+
[{:keys [:node]}]
9+
(let [[binding-vec & body] (rest (:children node))
10+
[sym val opts] (:children binding-vec)]
11+
(when-not (and sym val)
12+
(throw (ex-info "No sym and val provided" {})))
13+
(let [new-node (api/list-node
14+
(list*
15+
(api/token-node 'let)
16+
(api/vector-node [sym val])
17+
opts
18+
body))]
19+
{:node new-node})))

0 commit comments

Comments
 (0)