LoginSignup
11

More than 5 years have passed since last update.

gulp-tslintを使ってみた

Posted at

TypeScriptを使い始めているのですが今のとこGulpでタスクを組んでコンパイルしています。で、Lintも当然ほしくなるので入れてみました。

使ったパッケージ

  • gulp-tslint
    • Lint本体
  • gulp-plumber
    • watch時にLintでこけても止まらないように
  • gulp-notify
    • Lintでこけたときに通知する
    • こんな感じで表示される

tslint.png

タスク

gulp.task("tslint", function() {
    gulp.src([
        "./ts/**/*.d.ts"
    ])
    .pipe(plumber({errorHandler: notify.onError('Error: TSLint!!')}))
    .pipe(tslint({
        configuration: "Gulp/tasks/config/tslint.json"
    }))
    .pipe(tslint.report("verbose"));
});

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
11