clj-codes / docs.frontend

Frontend SPA for docs.clj.codes
https://docs.clj.codes/
The Unlicense
4 stars 0 forks source link

refact: not using dot inside symbols #34

Closed rafaeldelboni closed 6 months ago

rafaeldelboni commented 6 months ago

https://cljs.github.io/api/syntax/dot

Dots inside symbols accidentally work as a technical shortcut in ClojureScript, but this is not valid in Clojure.

foo.bar.baz => foo.bar.baz (not recommended)
(foo.bar.baz) => foo.bar.baz() (not recommended)

Dots inside symbols are not recommended, as they are not detected by :infer-externs. For example, no externs are generated for (foo.bar) if ^js foo is annotated.

Refactor using regex capturing groups in nvim: :%s/\$ \(\w*\)\.\(\w*\)/$ (-> \1 .-\2)/gc