whats wrong with ":refer :all"? #1797
Replies: 3 comments 4 replies
-
It is possible to disable this check, like with any checks in clj-kondo, but it makes linting less reliable since it's less clear where symbols that you are using are coming from. And this is exactly the thing that is wrong with In summary:
|
Beta Was this translation helpful? Give feedback.
-
thanks for the reply. it's a tiny project so i'm happy to disable it. i don't mind a warning about it, but its unfortunate that it necessarily creates errors for all other functions. |
Beta Was this translation helpful? Give feedback.
-
thanks for the extra info. what i meant about errors is that i would get errors from the linter from any functions that were under the namespace that had been required with but you're right, in the playground it works: it's all good, i'm just getting the hang of my environment, takes a while... thanks for sharing the details too. |
Beta Was this translation helpful? Give feedback.
-
editing the first lines of the playground:
reports "use alias or :refer".
because it trips up here, the linter doesn't recognise any functions from the required namespace later in the code, as they aren't prepended with any ns alias or anything. it reports errors for all of them.
i'm a clj novice, i got to using
:refer :all
from an auto-generated compojure skeleton.here is compojure's hello world example:
i figure there's nothing wrong with such a declaration, and the linter is just being overly sensitive?
it's also here:
https://clojuredocs.org/clojure.core/ns#example-542692d4c026201cdc327014
https://guide.clojure.style/#prefer-require-over-use
reports it is "acceptable as warranted"
is it possible to disable this check, or otherwise work around it? i would still like to be able to use clj-kondo to improve my still shoddy code.
Beta Was this translation helpful? Give feedback.
All reactions