This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-29
Channels
- # announcements (5)
- # beginners (25)
- # calva (53)
- # clj-kondo (9)
- # clojure (25)
- # clojure-europe (14)
- # clojure-nl (1)
- # clojure-norway (21)
- # clojure-uk (1)
- # conjure (2)
- # data-science (1)
- # datalevin (4)
- # datascript (6)
- # deps-new (5)
- # emacs (5)
- # etaoin (6)
- # figwheel-main (1)
- # fulcro (46)
- # gratitude (3)
- # hyperfiddle (8)
- # introduce-yourself (13)
- # lsp (13)
- # nextjournal (5)
- # off-topic (2)
- # pathom (4)
- # polylith (11)
- # re-frame (16)
- # releases (4)
- # scittle (67)
- # shadow-cljs (38)
- # slack-help (4)
- # specter (13)
- # sql (29)
- # squint (21)
- # test-check (3)
- # vim (13)
- # xtdb (15)
Hey.
I used function format
in cljc
file and it complains that it's unresolved. It would be a little more helpful if it would say that it doesn't exist in all implementations :thinking_face:
@invertisment_clojuria There is an open issue for this, to say for which branch the error applies
✅ 1
I recently ran into this as well, when making a namespace compatible with clojure and bb. I ended up with this so that the spit
inside my-fn
is properly resolved:
(ns test
(:refer-clojure :exclude [spit format]))
(def spit #?(:clj clojure.core/spit))
(def format #?(:clj clojure.core/format))
(defn my-fn
[]
(spit "output.txt" (format "yay %s" "format")))
(my-fn)
Is there a better way to accomplish this?@nate Try: {:cljc {:features [:clj]}
in config.edn
: this will only activate linting for the :clj branches
hm, should it be possible to put that in the namespace config?
(ns test
{:clj-kondo/config '{:cljc {:features [:clj]}}})
(defn my-fn
[]
(spit "output.txt" (format "yay %s" "format")))
(my-fn)
clj-kondo --lint test.cljc
test.cljc:6:4: error: Unresolved symbol: spit
test.cljc:6:23: error: Unresolved symbol: format
linting took 40ms, errors: 2, warnings: 0