Recently I try to learn clojure.
Here are some problem noted that I face when I play in clojure & clojurescript
what is .cljc file
When Clojure or ClojureScript needs to load a namespace, they first look for the platform-specific file (.class then .clj on Clojure and .cljs on ClojureScript) and if not found, then they look for the .cljc file.
Clojure versions >= 1.7, I can name a file foo.cljc if I want it to be available for loading with require or use both from Clojure and Clojurescript.
ref here
custom macro linter error
ref here
define custom config :lint-as treat custom macro as built-in macro:
{:lint-as {rum.core/defcs clojure.core/def}
:linters {:unresolved-symbol {:exclude [(rum.core/defcs)]}}}Also note from here:
There is four way to setup linter config:
- home dir config in ~/.config/clj-kondo/config.edn (respects XDGCONFIGHOME)
- project config: a
config.ednfile in the.clj-kondodirectory :config-pathsin projectconfig.edn: a list of directories that provide additional config- command line
--configfile or EDN arguments - namespace local config using
:clj-kondo/configmetadata in the namespace form