GUI: Added ESLint to gulp tasks. ONOS-6521
Commented out gulp tasks making this change uneffective
Fixed an error in the build script

Change-Id: I4f4f9762aa1a66304aa74b3ab208095b9c1d4515
diff --git a/tools/gui/gulp-tasks/lint/index.js b/tools/gui/gulp-tasks/lint/index.js
new file mode 100644
index 0000000..f864c6b
--- /dev/null
+++ b/tools/gui/gulp-tasks/lint/index.js
@@ -0,0 +1,33 @@
+import gulp from 'gulp';
+import eslint from 'gulp-eslint';
+import gulpIf from 'gulp-if';
+import path from 'path';
+
+const files = [
+    '../../web/gui/src/main/webapp/app/**/*.js'
+];
+
+function isFixed(file) {
+    // Has ESLint fixed the file contents?
+    return file.eslint != null && file.eslint.fixed;
+}
+
+const lint = () => {
+    return gulp.src(files)
+        .pipe(eslint({
+            configFile: path.join(__dirname, 'esconfig.json'),
+            useEslintrc: false,
+            // Automatically fix trivial issues
+            // fix: true,
+        }))
+        .pipe(eslint.format())
+        .pipe(gulpIf(isFixed,
+            gulp.dest('../../web/gui/src/main/webapp/app')
+        ));
+};
+
+const tasks = () => {
+    gulp.task('lint', () => lint());
+};
+
+export default tasks();
\ No newline at end of file