This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-20
Channels
- # adventofcode (7)
- # announcements (1)
- # aws (1)
- # babashka (127)
- # bangalore-clj (1)
- # beginners (54)
- # calva (8)
- # cider (12)
- # clj-http (2)
- # clj-kondo (8)
- # cljdoc (10)
- # cljs-dev (2)
- # clojure (48)
- # clojure-australia (14)
- # clojure-dev (6)
- # clojure-europe (105)
- # clojure-nl (6)
- # clojure-taiwan (1)
- # clojure-uk (62)
- # clojurebridge (1)
- # clojurescript (112)
- # code-reviews (4)
- # cursive (20)
- # data-science (1)
- # depstar (1)
- # events (8)
- # fulcro (6)
- # graalvm (11)
- # honeysql (2)
- # introduce-yourself (3)
- # jobs (1)
- # jobs-discuss (30)
- # malli (23)
- # nrepl (4)
- # off-topic (47)
- # pedestal (22)
- # polylith (10)
- # portal (3)
- # re-frame (16)
- # reitit (9)
- # releases (3)
- # rewrite-clj (1)
- # ring (1)
- # spacemacs (1)
- # tools-deps (12)
- # xtdb (7)
Does anybody have a config.edn that stops cljs-ajax GET and POST being marked as unresolved vars. I’ve tried variants of this so far to no avail:
linters {:unresolved-symbol
{:exclude [GET POST]}}
@grumplet I think this should be fixed if you do {:lint-as {ajax.macros/easy-api clojure.core/def}}
@borkdude - yep that worked 🙂 - I had convinced myself that :lint-as def wouldn’t work because my source didn’t refer to the easy-api directly - only to GET and POST.
How it works: when it lints the ajax.core namespace clj-kondo collects the vars and stores them in a cache. but with the macro it doesn't know what to do, unless you have some config for it. using the above config, clj-kondo will also treat the macro as def and so it stores the var names in the cache. So when using the ajax.core namespace, clj-kondo now knows about the GET
etc var in the ajax.core namespace and they are no longer unresolved.
Thanks for a great linter! I just added kondo hooks for the macros in https://github.com/IGJoshua/farolero/tree/feature/clj-kondo-config