• Search form is empty!

  • 019 Gulp - tslint

    http://robertdunaway.github.io

    Gulp code kata list

    All code katas lists

    Smiley face

    019 Gulp - tslint

    Duration

    5 minutes

    Brief

    Add a linter to run over our TypeScript code.

    For more information

    BING/GOOGLE: “Gulp typescript lint”

    Book:
    Gulp - Quick guide to getting up and running today

    Smiley face

    Instructions

    Get tutorial folder or the entire katas-Gulp repo.
    Open the [before/*.sln] file and execute the kata.
    Feel free to execute this kata multiple times because repetition creates motor memory.

    Github

    Kata

    Add a linter to run over our TypeScript code.

    Review

    Add the required plugins.

    
    npm install gulp-tslint --save-dev
    
    


    Add references

    
    , tslint = require('gulp-tslint')
    
    Add the task
    gulp.task('tslint', function () {
        return gulp.src(['./wwwroot/**/*.ts', '!wwwroot/lib/**/*.*'])
            .pipe(tslint())
            .pipe(tslint.report('verbose', {
                emitError: true,
                sort: true,
                bell: true
            }));
    });
    
    


    Add the new task to the default task.

    
    gulp.task('default', function () {
        runSequence('clean-wwwroot', 'copy-to-wwwroot', 'tscompile', 'tslint');
    });
    
    


    NOTE: This needs a good reporter that writes to a HTML file similar to jshint.

    Next

    Take a few minutes and imagine more examples.


    Smiley face

    0 comments:

    Post a Comment