This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-04
Channels
- # announcements (13)
- # asami (68)
- # babashka (19)
- # beginners (51)
- # calva (4)
- # cider (3)
- # clj-kondo (13)
- # clojure (161)
- # clojure-australia (3)
- # clojure-europe (21)
- # clojure-nl (4)
- # clojure-spec (9)
- # clojure-sweden (13)
- # clojure-uk (9)
- # clojured (14)
- # clojurescript (7)
- # conjure (4)
- # cursive (16)
- # data-science (2)
- # datalog (1)
- # figwheel-main (7)
- # graalvm (18)
- # helix (14)
- # introduce-yourself (1)
- # jackdaw (9)
- # jobs (1)
- # kaocha (1)
- # malli (8)
- # meander (8)
- # off-topic (7)
- # pathom (11)
- # proletarian (3)
- # shadow-cljs (29)
- # tools-deps (106)
- # xtdb (8)
Just reviewing the docs on custom defnc and reflecting on this line: ~(merge default-opts opts)
. One major downside to this is that you can't do a partial override of the options, e.g. {:helix/features {:define-factory true}}
will accidentally turn off fast-refresh. I was thinking of instead using ~(assoc (merge default-opts opts) :helix/features (merge (:helix/features default-opts) (:helix/features opts)))
on the basis that all the helix features can be turned off as easily as on (e.g. the replace mode isn't required)
Just spotted https://github.com/lilactown/helix/blob/master/resources/clj-kondo.exports/lilactown/helix/config.edn#L1. This didn't work for us, and we ended up expanding to:
(defn ~name [& ~@args] ~@body)
This fixed the factory usage, where you might have (defnc foo [props ref])
But you're supposed to call it as (foo {:ref …})
which then upsets kondo about missing arguments.
Just one to ponder, no real action.@dominicm @lilactown not sure if is the issue here, but I have two things that help me to make the foreign clj-kondo config works:
1. on the Helix side, make sure resources
is present on classpath
2. on the project client side, use clj-kondo --copy-configs --dependencies --lint "$(clojure -Spath -A:provided:dev)" --parallel
to make kondo copy over the configs
to fix 1
, Helix needs to add resources
here: https://github.com/lilactown/helix/blob/master/deps.edn#L1
I think @dominicm’s point was that even once he was able to use the config I tried to ship with helix, clj-kondo was complaining due to the fact that they're using defnc's factory function feature flag
@lilactown You'll need to use hooks. Although for usage via $
clj-kondo only cares that there's a var in place (e.g. it could be expanded to (def name nil)
). It depends how much you care about finding mistakes vs just making the warnings go away 🙂