Fork me on GitHub
#clj-kondo
<
2023-03-15
>
pavlosmelissinos18:03:10

If I add (user/dev) in a rich comment block clj-kondo complains with warning: Unresolved namespace user. Are you missing a require? I think it's a common pattern and the user namespace should always be available from within a REPL (without the need for a require). Is this intentional/expected?

borkdude18:03:24

you can disable that linter in an RCF with:

:config-in-comment {:linters {:unresolved-namespace {:level :off}}}

👍 2
borkdude18:03:02

or add :exclude [user] to that linter's config

pavlosmelissinos18:03:23

So it's expected, thanks! I wasn't sure if I should create an issue about it on Github.

borkdude18:03:45

it's kind of an edge case. normally clj-kondo expects that you have a require before you use a namespace

pavlosmelissinos18:03:28

Makes sense 🙂

seancorfield19:03:14

You could always write ((requiring-resolve 'user/dev)) 🙂

👍 2
seancorfield19:03:11

(I have a dev ns with that sort of code in -- I avoid user.clj to avoid auto-loading stuff -- and I use ((requiring-resolve 'dev/whatever)) in RCFs for reaching into that ns)

👍 4