Fork me on GitHub
#clj-kondo
<
2021-11-06
>
Adam Helins09:11:17

Whatever file I lint in this CLJS project, I get this same error:

src/salus/client/util.cljc:0:0: error: Can't parse src/salus/client/util.cljc, Configuration error. Expected fully qualified symbol, got: salus.client.js.citizen.domain.language
Now, salus.client.js.citizen.domain.language is a real namespace, but I can't figure out what's really wrong

borkdude09:11:56

@adam678 this error is about a misconfig in your .clj-kondo config.edn

borkdude09:11:11

You’re expected to put a fully qualified symbol somewhere where you’ve only used an unqualified one

Adam Helins09:11:34

Ah right, someone hard a brain fart it seems, it shouldn't even be in there Thanks!

lilactown15:11:17

I am feeling a bit dumb. I'm trying to setup https://github.com/lilactown/helix so that consuming projects will be able to automatically get clj-kondo config for its macros. I haven't been able to get it to work yet

lilactown15:11:58

in my consuming project, I can see the config file on the classpath:

user=> (slurp (io/resource "clj-kondo.exports/lilactown/helix/config.edn"))
"{:lint-as {helix.core/defnc clojure.core/defn\n           helix.core/defhook clojure.core/defn\n           helix.core/fnc clojure.core/fn}}\n"

lilactown15:11:18

is lilactown/helix right? or does it need to be just helix

lilactown15:11:30

since the require is helix.core helix.dom etc.

borkdude15:11:40

@lilactown this is correct. but you need to lint your classpath with --copy-configs

borkdude15:11:51

and then clj-kondo will copy the config to the .clj-kondo directory if that directory exists

borkdude15:11:07

and then you need to add it to your :config-paths in your .clj-kondo/config.edn

lilactown15:11:48

I see. I thought I just needed to run the command to copy the config and nothing more

borkdude15:11:53

no need to feel dumb, it's not so obvious with several steps that you need to do

lilactown15:11:59

it sounds like there's some manual config as well

borkdude15:11:19

correct, this is to prevent problems with config that people don't want in their project for some reason, safety, etc

borkdude15:11:49

you should explicitly opt into the configuration

lilactown15:11:43

whaddaya know it works 🙂 ty for help!

lilactown15:11:12

also glad that I did the right thing in my lib for everyone else

lilactown16:11:00

in an app or service, do people commit just their .clj-kondo/config.edn and let individual devs run the copy command? or do people commit the copied configs from libs too?

borkdude16:11:56

@lilactown I'd say commit in the entire directory except .cache so your team mates have the exact same config

borkdude16:11:11

and this will work in CI then too

lilactown16:11:21

I'll do that then