Fork me on GitHub

Looking for a JS setup... I come to javascript from clojurescript and not the other way round, so I find it hard to give up on my emacs experience... pointers?


The Spacemacs layer should give you some ideas, for packages used and configuration.

👍 4

If at all possible, attempt to use typescript over javascript. The typescript tooling for emacs (specifically tide) is miles better than the js equivalent.


I use JS at work with spacemacs, I've added RJSX package manually as it's great for react, though it has missing gaps/bugs.


@U5DEC96P7 is it backwards compatible, as in, does it provide a lot of syntax functionality to just js or does it bug out at certain points in es6 syntax? Also does it support react?


Typescript is a superset of javascript, so any valid es6 is valid typescript. And it does support react, I'm using it for a react project at work right now. The files simply change from js/jsx to ts/tsx


ah, I have to trigger the modes manually when it detects import React at the top of a buffer.


since at my job our react files are just .js


I'll try it out. though


@UBGH0Q0H4 glad we could help. I don't use JavaScript myself, I use ClojureScript and reagent (react.js wrapper). I would be interested to hear if the JavaScript layer or others has helped you. Thanks.


I will let you know @U05254DQM, I was sent a link to download visual-studio and immediately turned pale.. 😱 So I will give it my best shot...


VSCode is quite a nice editor and a world appart from Visual Studio. So if you don't get what you need from Spacemacs in terms of JavaScript, it could be a good alternative. There is also a nice Clojure plugin called Calva.


I would like to see a nice Spacemacs experience for VSCode, maybe called Spacecode :)

🙂 4

Sorry for the late response but you may find this Reddit thread of relevance: I've been recently trying to build up a nice JavaScript experience on top of Spacemacs (coming from Clj/Cljs just like you) and this helped me a lot. RJSX with Tide, flycheck/eslint, prettier and flow. It's the best of VSCode on top of Emacs so it has been great so far. I only wish I could find work with CLJS forever and never touch a line of JS again though.

👍 4

hey, I started using orchestra along with clojure specs and looks like defn-spec macro fools clojure mode in a way that all docstrings are treated as strings (and displayed in different color). is there any way to instruct clojure mode (which I guess is responsible for syntax highlighting) to recognize a syntax of defn-spec, which looks more or less like this:

(defn-spec my-add integer?
  "Returns the sum of `a` and `b`."
  [a integer?, b integer?]
  (+ a b))


I think you have to put a property onto the elisp symbol defn-spec for that to happen


something like (put 'defn-spec 'clojure-doc-string-elt 3) where 3 is the index of the docstring in the sexp


Any good tutorials on developing an emacs package? I've found a coupl that touch on it but nothing really comprehensive.


@theeternalpulse - Not comprehensive, but maybe a start: the "Extending Emacs" series here:


@qythium awesome! works perfectly. thanks.