The trick is to use JSCS and its latest features. If you want to follow a long, here is a step-by-step recipe.
First, you need to have JSCS installed. This is as easy as:
npm install -g jscs
Let’s pick an example project, for this illustration I use my kinetic scrolling demo:
git clone https://github.com/ariya/kinetic.git cd kinetic
jscs --auto-configure .
Once you choose a preset, JSCS will ask you a couple of self-explained questions. At the end of this step, the configuration file
.jscsrc will be created for you. With the configuration, the real magic happens. You just to invoke JSCS this way:
jscs -x .
With JSCS, you can comfortably ensure code style consistency throughout your project!