Fork me on GitHub
James Amberger17:04:37

I'm using ALE for linting in vim and it complains about macros from imported libraries, eg:

;;; defnc is from helix
(defnc my-component [{:keys [pdf-path]}] ; E: error: Unresolved symbol: my-component


What ALE uses as it's backend for linting, if it uses Kondo you can create this file:

James Amberger22:04:58

(yes, it's Kondo, and looking into it I find that it also looks for `joker' on one's path)


I searched a lil bit about it and I saw that you have options of those two sources, quite cool, the good part of using kondo, is that if you decide to go using lsp in the future you wont have any extra config to make it work 🙂

James Amberger23:04:40

yeah I am irrational about lsp

James Amberger23:04:55

my editor talking to the world every time I type something...

James Amberger23:04:23

I am glad that this is not yet required to have a great editor experience


But with LSP you don't need internet, is a local process, your computer starts a server that talks in a json protocol.

James Amberger23:04:21

I see... somehow I'd gotten the impression that the default was a public server

James Amberger23:04:54

is there anything more I have to do to get that hook working?


No, I think it's because the json protocol can lead to this, but it's local. The good part is that most of the editors know how to talk this protocol and the "server" is responsible to parser your code and return the editor requests, with cache and all that.

James Amberger23:04:16

It is still complaining of unresolved symbol when i use the defnc macro


No, double check if the file is in the same path root-your-project/.clj-kondo/config.edn


dunno if there is an extra for ALE check this file

James Amberger23:04:13

i put it in .config/clj-kondo, and also tried specifying it on the command line

James Amberger23:04:24

clj-kondo --config ~/.config/clj-kondo/config.edn --lint ./src/dev/fdny/lss/evds.cljs


you having problem with the defnc from helix or a macro wrapper you wrote over it?

James Amberger23:04:08

no, just straightforward use of defnc


this was downloaded automatically by kondo, in my first example I had to write a wrapper over defnc (as helix recomends) so I added that extra config


depending of your project structure it should download helix configs automatically

James Amberger23:04:59

I have a shadow-cljs project, nothing fancy about it

James Amberger23:04:11

let me see if I can coax clj-kondo into downloading something


clj-kondo --lint "$(clojure -Spath)" --copy-configs --skip-lint


in the root of your project should do the trick


you can delete that file you created that I sent you at first (sorry)

James Amberger23:04:50

do you usually commit the .clj-kondo dir?


(lsp downloads those for you automatically, just saying hahaha)

James Amberger23:04:51

ha I may look in to lsp

James Amberger23:04:16

I dunno, I ran your one-liner and my .clj-kondo remains empty


maybe folks in #CHY97NXE2 could help you with this one 🙂

James Amberger23:04:56

thanks for the chat; I'm reading the clj-kondo docs now


Yeah, feel free to ping me, I really like helix as well doing a lot of studies on it

James Amberger23:04:43

looks like I need to include clj-kondo in my deps.edn

James Amberger23:04:47

ok thanks I will


uhm interesting, I didn't knew about it


I would like to know if this will work

James Amberger23:04:52

clj-kondo --lint "$(npx shadow-cljs classpath)" --copy-configs --skip-lint --lang cljs

James Amberger23:04:08

so I needed to specify classpath from shadow-cljs