Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Or use the shorthand: brunch w --s

  • IDE: PhpStorm

All front-end developers should use PhpStorm by JetBrains.
JetBrains has granted all contributors of Apache Ambari a free license for PhpStorm and IntelliJ (if you also need to do Java development - IntelliJ is a superset of PhpStorm, but PhpStorm is lighter so it is recommended if you are not modifying Java code).

  • IDE Plugins

Go to Preferences->Plugins->Browse repositories and install “Node.js” and “Handlebars” plugins.
Coding Conventions

...

We will use all default settings for Code Style in the IDE, except for the following:

Code Block

Go to Preferences

...


Code Style->General

...


Line separator (for new files): Unix

...


Make sure “Use tab character” is NOT checked

...


Tab size: 2

...


Indent: 2

...


Continuation indent: 2

...


Code Style->JavaScript:

...


Tabs and Indents

Make sure “use tab character” is NOT checked
Set Tab size, Indent, and Continuation indent to “2”.
Spaces->Other
Turn on “After name-value property separator ‘:’

...

Exceptions to the rule from the above:
We use 2 spaces instead of 4.
Variable Declarations:
“It is preferred that each variable be given its own line and comment. They should be listed in alphabetical order.”
Comment only where it makes sense. No need to do alphabetical sorting.
“JavaScript does not have block scope, so defining variables in blocks can confuse programmers who are experienced with other C family languages. Define all variables at the top of the function.”
This does not need to be followed.

  • Unit Testing

Unit tests are written using Mocha.
Run unit tests via
brunch test

...