I've noticed in some of my projects, .clj-kondo contains an imports folder with the various dependencies' configs and hooks inside, whereas other projects have those dependencies' folders at the top-level. What determines that?
the imports directory is a new feature. if there were already previously imported libraries top level inside of the .clj-kondo dir, it won't create it since you would get duplicates
Ah, so if delete the old stuff and then re-run lsp, it'll create imports instead?
yes. more info here: https://clojurians.slack.com/archives/CHY97NXE2/p1716222464894789
And would you recommend committing imports or ignoring it for git? I'm thinking of cleaning up my projects a bit...
I think it makes sense to commit them so people don't have to imports those first to get a working linting configuration
I tend to not commit those to avoid churn when deps change
in my experience there isn't that much churn in clj-kondo configs from dependencies over the lifetime of a project, but YMMV
As we add hooks and configs to internal libs and update those in services I believe those get reflected in inported configs
I see
It isn't much but since reimporting is dead simple, I just chose to not have the same thing checked into multiple repos as generated code
yeah that makes sense.
For our case this works well at least. Its good to have the option to decide whether to check them in or not
Adopts well to individual needs
At work we only have one repo so committing clj-kondo configs is part of "upgrading dependencies" which is an action associated with a ticket, that affects just "one" thing. I can see how this would become annoying when you have a lot of different repos to deal with -- I only noticed it because I was comparing the structure of several of my OSS repos 🙂