This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-26
Channels
- # announcements (1)
- # aws (6)
- # babashka (1)
- # beginners (109)
- # calva (22)
- # clj-kondo (21)
- # cljsrn (1)
- # clojure (68)
- # clojure-europe (41)
- # clojure-nl (2)
- # clojure-uk (5)
- # clojurescript (7)
- # core-logic (1)
- # data-science (4)
- # datomic (1)
- # events (1)
- # fulcro (25)
- # gratitude (1)
- # juxt (4)
- # keyboards (1)
- # malli (5)
- # minecraft (3)
- # missionary (9)
- # music (1)
- # nextjournal (7)
- # off-topic (7)
- # polylith (31)
- # re-frame (3)
- # reveal (7)
- # ring (11)
- # shadow-cljs (1)
- # spacemacs (4)
- # tools-build (5)
- # tools-deps (5)
- # xtdb (25)
Getting this error while linting datatype.clj :
src/tech/v3/datatype.clj:167:19: error: Unresolved symbol: idx
src/tech/v3/datatype.clj:167:19: warning: Unresolved namespace hooks.datatype. Are you missing a require?
That hooks.datatype file does exist:
https://github.com/cnuernber/dtype-next/tree/clj-kondo-builtin/resources/clj-kondo.exports/cnuernber/dtype-nextcmd line I am using is https://github.com/cnuernber/dtype-next/blob/clj-kondo-builtin/scripts/clj-kondo.
src/tech/v3/datatype.clj:167:19: warning: Unresolved namespace hooks.datatype. Are you missing a require?
This warning just means that you're using the namespace without having required it.Yeah that's the issue. Your macro is defined in a namespace hooks.*
. I recommend renaming this namespace to the same namespace as where the original namespace is occurring.
It's recommended for exported config hook code to use unique namespaces anyway and the convention is <org>/your_lib/file.clj
or so, similar to how you would do it in your lib
I put the config file exactly there, cnuernber/dtype-next/config.edn. Then it will have an entry that is {:macroexpand {tech.v3.datatype/make-reader tech.v3.datatype/make-reader}}
with the code under resources/clj-kondo.exports/cnuernber/dtype-next/tech/v3/datatype.clj.
Is that the recommendation?
Also, I have a few namespaces that simply extend protocols but aren't used directly in the file. Is there a good way to annotate those namespaces or the require itself?
(ns a.b.c
(:require [protocol-defs :as pdef]
[protocol-impls]))
(defs/use-protocol :a)
Something like there where there are protocol or multimethod implementations but the namespace doesn't export anything aside from that.
if you don't add an alias then clj-kondo will assume you are requiring only for side effects