Fork me on GitHub
#calva
<
2023-10-15
>
thomas14:10:41

So I played around a bit with the Rama and I copied over the code from the blog post about the Clojure API and I got it working (yeah), but I see errors just about everywhere:

thomas14:10:50

is there a way to turn this off? or since it works make them go away in some other way? (I assume these things are defined in macro's etc)

Bobbi Towers15:10:02

You can silence the warnings by adding a bit in your namespace declaration:

(ns core {:clj-kondo/ignore true})

🙏 1
thomas15:10:07

that worked

Bobbi Towers15:10:07

There's finer controls, but that's the catch-all. The rest are documented here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md

👍 1
thomas15:10:56

{:clj-kondo/config '{:linters {:unresolved-symbol {:level :off}}}}

thomas15:10:03

seems to be a good one

Kelvin15:10:37

Is it just me, or does indentation not work properly in cljs files? Whenever I define a function, for example, with the arglist on a new line the default indent is this:

(defn foo
      []
instead of this (which is what it is in clj files):
(defn foo
  []
The same can be seen with s/def and ns

Kelvin15:10:27

Okay I opened another cljs project and it indents properly (the second way). So it looks like there’s some bad config somewhere in my first project.

Kelvin16:10:23

Ah I see the issue: I had a .cljfmt.edn file in my project root, with the following (for context when-loaded is a custom macro):

{:indents {when-loaded [[:inner 0]]}}

Kelvin16:10:35

Aha: I should have put :extra-indents instead of :indents since the latter overwrites the pre-existing indent config for all forms, not just my custom macro.

Kelvin16:10:23

So problem solved; hopefully this thread will be helpful for anyone else who needs custom formatting

pez16:10:45

This changed recently. You probably just missed the memo. 😃 I agree it’s good with another thread about it.

Kelvin16:10:50

Ah I just saw the cljfmt changelog. Yes I indeed missed the memo (plus I haven’t opened that project in many months)

pez18:10:43

I missed the memo at first too, and broke Calva formatting when upgrading to latest cljfmt. Here’s the changelog item for when I fixed it: https://github.com/BetterThanTomorrow/calva/blob/published/CHANGELOG.md#20385---2023-08-15 There’s also a note attached here: https://calva.io/formatting/#indentation-rules