This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-27
Channels
- # announcements (16)
- # architecture (19)
- # beginners (31)
- # calva (2)
- # cider (1)
- # clerk (4)
- # clj-yaml (58)
- # cljdoc (2)
- # cljs-dev (10)
- # clojure (77)
- # clojure-europe (108)
- # clojure-norway (26)
- # clojure-sanfrancisco (2)
- # conjure (1)
- # cursive (2)
- # datahike (5)
- # datomic (13)
- # emacs (7)
- # etaoin (3)
- # hyperfiddle (15)
- # introduce-yourself (3)
- # kaocha (1)
- # off-topic (21)
- # reagent (4)
- # releases (1)
- # shadow-cljs (41)
- # spacemacs (28)
- # specter (8)
- # squint (30)
- # yamlscript (2)
Is there a way to get clj-kondo
to treat e/server
and e/client
as #?(:clj)
and #?(:cljs)
reader conditionals to avoid unresolved namespace warnings?
And potentially a way to get Clojure-LSP to behave similarly to get JS/JVM specific completions in context? (Cider is asking me "Language context at point" which is interesting)
(Just getting started, so forgive me if this is documented somewhere I haven't seen yet.)
i haven’t figured clj kondo out yet, i turned it off
i am feeling more fluent now in vscode though (i switched) so can possibly start figuring it out this week
i’m assuming it would be the same as emacs
I figure I probably could just add a reader conditional around every context switch, though that feels a bit verbose Curious if the two could be done together somehow :thinking_face: Thanks anyways; things are looking very exciting 😁
a good question for #CHY97NXE2 - my guess is you'll need to write a custom hook. I'm not sure if custom hooks can control that context, though
there are some old threads here as well with borkdude comments
You can completely ignore specific forms (and everything inside) like this:
$ clj-kondo --lint - --config '{:config-in-call {shadow.cljs.modern/defclass {:ignore true}}}' <<< "(require '[shadow.cljs.modern :as m]) (m/defclass 1 2 x y z)"
linting took 39ms, errors: 0, warnings: 0
Or if the form replicates some existing clojure form exactly you can do like that:
{:lint-as {shadow.cljs.modern/defclass clj-kondo.lint-as/def-catch-all}}}
I'm yet to try electric so not sure what will work better, but I think one of the approaches will work.some previous discussions https://clojurians.slack.com/archives/C7Q9GSHFV/p1681657983597109 https://clojurians.slack.com/archives/C7Q9GSHFV/p1681657983597109
I'm willing to look into this a bit, I'm not yet sure how support for electric would work
i think a lot of the lint rules simply do not apply (unless the strategy is changed)
that seems to be about the same as shutting it off entirely, because the macros nest
(I think it's fine to shut it off entirely in Electric regions for a while while we learn more from experience, it will at least make the errors go away)