Skip to content

Commit

Permalink
Add a built-in config for clj-kondo (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhleong committed Jul 10, 2023
1 parent 4b5889b commit 21286a7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
15 changes: 3 additions & 12 deletions .clj-kondo/config.edn
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{:linters {:unresolved-symbol {:exclude [goog.DEBUG
(spade.core/defattrs [at-media])
(spade.core/defclass [at-media])
(spade.core/defglobal [at-media])
(spade.core/defkeyframes [at-media])

(com.rpl.specter/recursive-path)
]}}
(com.rpl.specter/recursive-path)]}}
:lint-as {applied-science.js-interop/defn clojure.core/defn
applied-science.js-interop/let clojure.core/let
applied-science.js-interop/fn clojure.core/fn
reagent.core/with-let clojure.core/let
spade.core/defattrs clojure.core/defn
spade.core/defclass clojure.core/defn
spade.core/defglobal clojure.core/def
spade.core/defkeyframes clojure.core/defn}}
reagent.core/with-let clojure.core/let}
:config-paths ["../resources/clj-kondo.exports/net.dhleong/spade"]}

4 changes: 1 addition & 3 deletions dev/spade/demo.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@
[:div (composed-attrs)
[:div {:class (colorized "red")}]
[:div {:class (colorized "blue")}]
[:div {:class (colorized "green")}]]

])
[:div {:class (colorized "green")}]]])

(defn view []
[:div
Expand Down
14 changes: 14 additions & 0 deletions resources/clj-kondo.exports/net.dhleong/spade/config.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{:linters {:unresolved-symbol {:exclude [(spade.core/defattrs [at-media])
(spade.core/defclass [at-media])
(spade.core/defglobal [at-media])
(spade.core/defkeyframes [at-media])]}

; defglobal needs a name to be bound to, but is unlikely to
; actually be referenced anywhere (because it's, y'know, global).
; So we automatically ignore its public vars by default
:clojure-lsp/unused-public-var {:exclude-when-defined-by #{spade.core/defglobal}}}
:hooks {:expand-macro {spade.core/defglobal hooks.defglobal/as-macro}}
:lint-as {spade.core/defattrs clojure.core/defn
spade.core/defclass clojure.core/defn
spade.core/defglobal clojure.core/def
spade.core/defkeyframes clojure.core/defn}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(ns hooks.defglobal)

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defmacro as-macro [the-name & body]
`(def ~the-name ~@body))

0 comments on commit 21286a7

Please sign in to comment.