Marcus Cavanaugh
Marcus Cavanaugh

Reputation: 166

Can Emacs js2-mode be forced into not indenting top-level JS when the file is wrapped in a module function?

A lot of JS code I work with contains files that are defined with the following indentation:

define("my_module", function() {

// top-level code is not indented because the whole file
// is wrapped in a giant closure

});

Is there a way to force Emacs (js2-mode) to ignore the outer function for the purposes of indentation (such that it indents the same as if it was not wrapped in a giant function)?

Upvotes: 4

Views: 124

Answers (0)

Related Questions