LoginSignup
6
6

More than 5 years have passed since last update.

gulp をごっくんごくごく #ESLint 編

Last updated at Posted at 2015-05-08

環境

  • OS X Yosemite 10.10.3

前提

  • Node.js v0.11.16
  • npm 2.3.0
  • Gulp 3.8.11

gulp-eslint をインストール

$ npm install gulp-eslint

gulpfile.js のサンプル

var gulp = require('gulp');
var eslint = require('gulp-eslint');


gulp.task('lint',function(){
    return gulp.src(['./*.js'])
        .pipe(eslint())
        .pipe(eslint.format())
        .pipe(eslint.failOnError());
});

gulp.task('watch',function(){
    gulp.watch('./*.js',function(event){
        gulp.run('lint');
    });
});

gulp.task('default',['lint'],function(){
    gulp.run('watch');
});

gulpを実行

$ gulp
6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6