Integrate jshint in ionic starter project

So adding jsLint/Hint isn’t a too difficult,

  1. make a project and cd into it
  2. run npm install
  3. run npm install gulp-jshint jshint-stylish --save-dev
  4. edit gulpfile.js to include var jshint = require('gulp-jshint');
  5. then add this gulp taks:
gulp.task('lint', function() {
  return gulp.src('./www/js/*.js')
    .pipe(jshint())
    .pipe(jshint.reporter('jshint-stylish'));
});

Note that jshint-stylish isn’t required, but make the output much more legible.

Now you can run gulp lint and see where your errors are.