Skip to content

Formatting JavaScript

Doug Neiner edited this page Apr 30, 2015 · 2 revisions

The gold standard for JavaScript formatting (for us, at least) is jscs. The settings you need to apply for jscs are in the the formatting/JavaScript/ folder in this repo. Each project should have an .jscsrc file appropriate for their project. There is a set of shared rules, and then specific rules for ES6 code as well as JSX. See Setting Up Sublime Text 3 for details on how to use this file in ST3.

The Visual Studio formatting settings require ReSharper - see Setting Up Visual Studio 2013 for more info. (Even though Visual Studio's ReSharper set up is what will format JS when developing in VS, the jscs setup is the real guideline.)

This repo includes an .editorconfig file. This file assists in normalizing how indentation and line breaks are handled across multiple platforms/IDEs. Both ST3 and VS 2013 support consuming the settings in this file. The IDE setup guides for ST3 and VS 2013 cover how to incorporate this file.

Clone this wiki locally