add JavaScript Code Style validation by adding jscs

jscs(http://jscs.info) is a new code style validator utility for
JavaScript, that can be used to enforce specific code style rules.

This change adds configuration and grunt task for jscs. The configuration
is again kept outside of gruntfile for editors with live linting
support. It is currently configured to strictly default to Google's
styleguide as described on
https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml.

This change doesn't affect existing developers on the project as they
are already following Google's styleguide (hopefully), but helps new
developers looking to contribute to JavaScript to conform strictly to
the code style expected of them.

Another change in the 'Improving Developer Experience' series.

Change-Id: I2a8ed38b785a19f379d22abfa99b1a022482bb51
diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 0000000..4b5fa83
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,3 @@
+{
+  "preset": "google"
+}
diff --git a/Gruntfile.js b/Gruntfile.js
index b299cc6..68ecada 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -219,6 +219,16 @@
       },
       uses_defaults: ['<%= meta.src.js_files %>', '!<%= meta.src.js_thirdparty_files %>']
     },
+    jscs: {
+      main: [
+        '<%= meta.src.js_files %>',
+        '!<%= meta.src.js_thirdparty_files %>'
+      ],
+      options: {
+        config: '.jscsrc',
+        reporter: 'inline'
+      }
+    },
     lesslint: {
       src: [
         '<%= meta.src.less_files %>',
@@ -281,6 +291,7 @@
   grunt.loadNpmTasks('grunt-contrib-watch');
   grunt.loadNpmTasks('grunt-lesslint');
   grunt.loadNpmTasks('grunt-plato');
+  grunt.loadNpmTasks('grunt-jscs');
 
   grunt.registerTask('coverage', ['jasmine:coverage']);
   grunt.registerTask('plato_source', ['plato:source_files']);
diff --git a/package.json b/package.json
index cc27ab0..3217a9f 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
     "grunt-contrib-watch": "^0.6.1",
     "grunt-contrib-yuidoc": "~0.4.0",
     "grunt-jasmine-runner": "~0.6.0",
+    "grunt-jscs": "^1.5.0",
     "grunt-lesslint": "~0.8.0",
     "grunt-plato": "~1.0.0",
     "grunt-template-jasmine-istanbul": "~0.2.1",