This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-06
Channels
- # announcements (7)
- # aws (8)
- # babashka (9)
- # babashka-sci-dev (11)
- # beginners (37)
- # calva (50)
- # cider (15)
- # clj-kondo (30)
- # clj-otel (3)
- # cljdoc (16)
- # cljs-dev (26)
- # cljsrn (4)
- # clojure (168)
- # clojure-doc (1)
- # clojure-europe (17)
- # clojure-gamedev (4)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-spec (17)
- # clojure-uk (16)
- # clojurescript (27)
- # community-development (3)
- # css (3)
- # cursive (9)
- # datomic (25)
- # emacs (1)
- # events (4)
- # fulcro (2)
- # google-cloud (2)
- # graphql (11)
- # gratitude (9)
- # humbleui (16)
- # hyperfiddle (2)
- # jobs (1)
- # london-clojurians (1)
- # lsp (16)
- # malli (2)
- # off-topic (71)
- # pedestal (4)
- # polylith (9)
- # portal (94)
- # reagent (6)
- # reitit (2)
- # releases (1)
- # remote-jobs (2)
- # sci (9)
- # shadow-cljs (49)
- # spacemacs (8)
- # tools-build (2)
- # tools-deps (39)
- # vim (7)
- # xtdb (6)
Hello y'all! I made a small documentation tool based on clj-kondo output. Example: https://github.com/babashka/sci/blob/master/API.md Repo: https://github.com/borkdude/quickdoc
Hi! I'm using transit-cljs for the first time in this codebase, and I'm getting this unexpected error from clj-kondo:
⢠cognitect.transit/reader is called with 1 arg but expects 2 or 3
⢠cognitect.transit/read is called with 2 args but expects 1
With the linted function being:
(defn get-transit-var [x]
(let [json (gobj/get js/window x)
reader (transit/reader :json)]
(transit/read reader (js/JSON.stringify json))))
And the require
being [cognitect.transit :as transit]
@orestis The issue might be that clj-kondo has an older version of transit in its built-in cache
I'm starting with linting dependencies and clearing the cache, but perhaps I need to look into the classpath generated for that.
No worries, I was preparing the classpath without the cljs alias. There was a mismatch between what VSCode/Calva was linting and what I was linting from the command line.
Hi y'all. I'm looking to disable clojure linting in a .cljc file since I'm only wanting to lint it for cljs and nbb. I tried #?(:clj {:clj-kondo/config ^:replace {:linters {}}})
per https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#disable-all-linters-but-one but that doesn't seem to work. Any advice?
@cldwalker try on the project level:
{:cljc {:features [:cljs]}}
That works great for all files but unfortunately I have other cljc files that do need clj linting enabled. I tried it at the namespace level but no dice. Would namespace groups support it?
Ok. Should ^:replace work for namespace level configs or is that more for commandline usage per the example? I was hoping to disable all linters at once. For now I have a workaround that I disable new clj linter keys as they come up
> Maybe you're able to get away with a .cljs
extension?
Unfortunately I can't because because nbb and cljs have different require semantics for this example e.g.:
#?(:org.babashka/nbb ["mldoc$default" :refer [Mldoc]]
:default ["mldoc" :refer [Mldoc]])
@cldwalker Is one target the browser and the other Node.js, or both Node.js?
@cldwalker in nbb you can cheat by doing: (def mldoc (js/require "mldoc"))
probably but this probably doesn't work for the browser
@cldwalker I solved this problem in a different project by moving these differences to one spot and then use the required libraries from there.
(ns deps (:require #?(:org.babashka/nbb ["mldoc$default" :refer [Mldoc]]
:default ["mldoc" :refer [Mldoc]])))
(def Mldoc Mldoc)
You could also consider target :esm for both Node.js and browser and have everything the same as nbb
Thanks a lot for the quickdoc tool @borkdude! I've wanted a reasonable doc tool for a while that produces something readable for my projects that can't be read by cljdoc or that I don't want to publish. I'd been using codox before, but even that's a pain to set up for some projects. I think this'll be a great tool to add to my toolbox. š