ClojureScript currently doesn't warn on private var usage, but there is a ticket to have it do that.
Launch a node
ClojureScript REPL with an experimental change that triggers private var use warnings by using this command:
clj -Sdeps '{:deps {github-mfikes/clojurescript {:git/url "https://github.com/mfikes/clojurescript" :sha "6eb6c7e77afac5307ddfb6e6a7c9c3d5367d4e8c"}}}' -m cljs.main -re node
Try out using private vars:
cljs.user=> (defn- bar [x] (inc x))
#'cljs.user/bar
cljs.user=> (ns foo.core)
nil
foo.core=> (cljs.user/bar 3)
WARNING: var: cljs.user/bar is not public at line 1 <cljs repl>
4
foo.core=> (#'cljs.user/bar 3)
4
foo.core=> (require '[cljs.tools.reader :refer [char-code]])
nil
foo.core=> (char-code "0xA3" 16)
WARNING: var: cljs.tools.reader/char-code is not public at line 1 <cljs repl>
163
foo.core=> (#'char-code "0xA3" 16)
163
foo.core=> (^:private-var-access-nowarn char-code "0xA3" 16) ; suppress warning w/o using var
163
If you'd like to try it on your own ClojureScript deps.edn
-based project, just use a deps.edn
entry for ClojureScript as in the following:
{:deps {github-mfikes/clojurescript
{:git/url "https://github.com/mfikes/clojurescript"
:sha "6eb6c7e77afac5307ddfb6e6a7c9c3d5367d4e8c"}}}
You will see how many private var usage instance occur in your own code or in libraries you use!