From d00dc71e134d9ad71f51225238c67a7d2dce6f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Vachon?= Date: Thu, 15 Jan 2015 11:54:23 -0500 Subject: [PATCH] Added coding style linter --- Gruntfile.js | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index c7e0252..1f02afc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,8 +1,8 @@ 'use strict'; module.exports = function(grunt) { - grunt.initConfig({ + grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), @@ -30,12 +30,43 @@ module.exports = function(grunt) { files: '<%= project.assets %>/sass/{,*/}*.{scss,sass}', tasks: ['sass:dev'] } + }, + + jslint: { // configure the task + + client: { + src: [ + 'app/app.js', + 'app/**/*.js' + ], + exclude: [ + 'app/bower_components/**/*.js', + 'app/assets/**/*' + ], + directives: { // example directives + node: true, + todo: true + }, + options: { + edition: 'latest', // specify an edition of jslint or use 'dir/mycustom-jslint.js' for own path + junit: 'out/client-junit.xml', // write the output to a JUnit XML + log: 'out/client-lint.log', + jslintXml: 'out/client-jslint.xml', + errorsOnly: true, // only display errors + failOnError: false, // defaults to true + checkstyle: 'out/client-checkstyle.xml' // write a checkstyle-XML + } } + } }); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-jslint'); + + grunt.registerTask('default', 'jslint'); grunt.registerTask('default', [ 'watch' ]); + };