In that script
#!/usr/bin/env bb
;; (require '[babashka.classpath])
(babashka.classpath/add-classpath ".")
clj-kondo shows deprecation warning for
clojure.core/add-classpath
is that correct?there is no such warning when I uncomment require
line.
Probably a bug. Can you make an issue?
hmm... or may be it is Calva's mistake
how clj-kondo intended to work with babashka scripts?
Yes. that was when I connect to Clojure repl but open babashka script in editor.
That was a little bit confusing when clj-kond tells about clojure.core/add-classpath
underlining babashka.classpath/add-classpath
But what about ,cljb
extensions? 🙂
it is the time to introduce!
Kondo should know those two things aren't the same :) regardless of file extension for bb or not.
Does the error happen when running kondo from the cli?
@maxp I can't reproduce with the above:
$ clj-kondo --lint /tmp/foo.clj
/tmp/foo.clj:4:2: warning: Unresolved namespace babashka.classpath. Are you missing a require?
linting took 10ms, errors: 0, warnings: 1
Of course if you only write add-classpath
unqualified, clj-kondo is going to think it's from clojure.core and then it's indeed deprecated