betajs/betajs-compile

View on GitHub
grunt/lint.js

Summary

Maintainability
A
0 mins
Test Coverage
module.exports = function (taskname, code, eslint, options) {
    this.grunt.loadNpmTasks('grunt-contrib-jshint');
    if (eslint)
        this.grunt.loadNpmTasks('grunt-eslint');
    taskname = taskname || "lint";
    esversion = options.esversion || 3;
    return this.registerTask(taskname, [
        this.addConfigTask("jshint", taskname, {
            options : {
                esversion: esversion,
                smarttabs: true,
                withstmt: true,
                boss: true
            },
            files: {
                src: code
            }
        }),
        eslint ? this.addConfigTask("eslint", taskname, {
            options : {
            },
            files: {
                src: code
            }
        }) : null
    ]);
};