Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [javascript]

for the use (typically editing) of JavaScript code in Emacs.

0
votes
1answer
441 views

Enable JSX folding in web-mode

I'm using web-mode to edit jsx files and I'm wondering what minor-mode can I use to add folding support. Is there anything out there that works? Thanks
0
votes
0answers
214 views

Strange tabbing behaviour in .erb files

Note that I use spaces for tabs. When I am working in erb files for rails such as example.js.erb or example2.html.erb, I am getting some very odd (and annoying) auto-tabbing behaviour, which I can't ...
0
votes
1answer
173 views

Is there any way to get tabs to align relative to the previous line?

Currently I have this javascript code in a js2-mode buffer after I press tab: const entries = state.get('entries') .concat(getWinners(state.get('vote'))); and I would like for it to look ...
3
votes
1answer
3k views

Cannot jump to definition in js2-mode or Tern

I am performing Nodejs development in emacs, but my environment seems incorrect. For example, when I run ac-js2-jump-to-definition, I get "no jump location found" in the minibuffer. Also when I run '...
11
votes
1answer
5k views

Javascript mode compatible with es6

Does anyone know of a javascript editing mode that supports the es6 syntax additions (arrow functions, extends, imports, generators, etc.)? I've done some quick searching but it looks like so far ...
1
vote
3answers
2k views

Flycheck with eslint doesn't use ~/.eslintrc

I'm having trouble getting flycheck to use the .eslintrc file in the root of the current project, and I'm struggling to find any documentation that will tell me how to configure it to use the ...
7
votes
2answers
2k views

How prettify (newlines and indentation) an optimized HTML/JS file?

For example, I have the following bunch of characters (HTML): http://pastebin.com/pwTPp8wd I thought everyone stumbled it upon a processed file, especially when someone would speed up the processing ...
5
votes
1answer
596 views

How to set temporary file directory for flycheck eslint (outside of current directory)

flycheck-mode creates temporary files in the current directory. That is annoying. How can I disable/set the default place for these temporary files. I use javascript eslint syntax checker for react ...
3
votes
1answer
1k views

Receive error when trying to use tern mode

I have installed tern use npm and install tern.el from melpa. I put the path of tern.el in my init file as per instructions on the emacs section of the tern homepage. However when I enable tern mode ...
4
votes
0answers
360 views

Web mode -indentation is misaligned on skipping semicolons

When i indent javascript code (inside html - web mode) that has no semicolons in it, the next statements are indented right with two extra spaces, <script> function processTemplates(){ ...
0
votes
1answer
1k views

Angular and Tern.js - ReferenceError in angular.js

I'm trying to configure Emacs with Tern.js to use AngularJS in it. When add angular to .tern-project like: { "plugins": { "node": { }, "angular": { } } } and type app.| I get ...
2
votes
1answer
1k views

Javascript not autocompleting with Yasnippet and Auto-complete

I really want to use emacs as a Javascript IDE. I have followed all the directions I can, includings Yasnippets and Autocomplete, but I still have some issues. If you look at the differences, in ...
1
vote
2answers
177 views

js-comint mode (node) returning too many undefined responses?

I am using js2-mode and comint-mode to run the Node REPL in emacs. For some reason the prompt is returning a lot of undefined and ...undefined responses, which it wouldn't do normally. for instance, ...
0
votes
0answers
121 views

Set javascript mode indents to (1-based) columns 5, 9, 13, 17,

When setting the js-indent-level to 4, my code is aligned in (1-based) columns 4, 8, 12, 16, ... To me this makes perfect sense, but unfortunately I'm sharing code with others whose editors ...
1
vote
1answer
71 views

How can I modify a variable in a javascript file that meets specific conditions?

Lets say I'm editing a javascript file in emacs that has objects as such scattered through out the file: foo: [1], foo: [2], foo: [3], foo: [4], foo: [5], foo: [6], foo: [7] obo: [1], obo: [2], obo: [...
2
votes
2answers
384 views

Define key to toggle between javascript implementation and test file

I have been trying to set up a shortcut for jumping between a JavaScript implementation and test. I have particular requirements that are making examples I see harder to apply. I currently work with ...
1
vote
1answer
633 views

js2-mode customizations not applying

No matter what I do, the customizations I apply to js2-mode are not going into effect. The mode is on and working, but with default settings. I've tried changing the default-tab-width to 2 and ...
2
votes
2answers
379 views

Can't get a Node REPL with swank-js

I have followed the instructions on Github for setting up swank-js. I installed slime and slime-js from github and have the following in my .emacs file: (add-to-list 'load-path "~/slime/") (...
8
votes
1answer
3k views

How to navigate a JavaScript project?

I'm currently working on a JavaScript project using Backbone.js and I wonder how can I navigate between files, based on method and object definitions. For example, I keep references to some of my ...
2
votes
2answers
1k views

How to display the list of functions in iMenu and collapse/uncollapse functions in angular js file

I use js2-mode with emacs-prelude, imenu displays the list of functions and I can collapse and uncollapse the functions defined in a regular js file like this function testFunction1(){ console....
19
votes
3answers
5k views

How to use skewer-mode?

I am currently struggling to use skewer-mode in Emacs. I downloaded and installed skewer-mode via MELPA, so all the dependencies should be inplace. For testing purposes I even downloaded the boidsjs ...