Skip to content

vaibhavguptaIITD/eclipse-formatter-profiles

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

google-style-guide-javascript-eclipse

Eclipse JavaScript Code Formatter profile based on Google's Style Guide.

This was created by first importing Google's C++ profile and applying minor fixes to bring it closer to their JavaScript guide (some of the C++ settings weren't correctly imported).

Installation

  1. open Eclipse IDE
  2. open the Preferences window
  3. drill down: JavaScript -> Code Style -> Formatter
  4. click Import and select the provided XML file
  5. done!

Known Issues

Wrapping Binary and Ternary Operators

Google's JavaScript Style Guide states that when wrapping long lines with binary (e.g. +) and ternary operations (e.g. ? :), "Always put the operator on the preceding line, so that you don't have to think about implicit semi-colon insertion issues. Otherwise, line breaks and indentation follow the same rules as in other Google style guides."

Good

blah ?
    blah :
    blah;

Bad

blah
    ? blah
    : blah;

There doesn't seem to be an Eclipse setting to enforce this, so it is probably good practice to try and keep these lines short if you don't want Eclipse to break the rules.

About

Eclipse JavaScript Code Format profile based on Google's Style Guide

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published