Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a built-in config for clj-kondo #18

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))