gulp-tslint-teamcity
raw JSON → 1.1.1 verified Fri May 01 auth: no javascript deprecated
A reporter for gulp-tslint that formats lint results for TeamCity using tslint-teamcity-reporter. Deprecated since tslint 4.x and gulp-tslint 7.x, as the reporter can now be used directly. Version 1.1.1 is the latest and final release. No longer maintained.
Common errors
error TypeError: Cannot read property 'emitError' of undefined ↓
cause Passing teamcity as a formatter to tslint() instead of as a reporter to tslint.report().
fix
Use .pipe(tslint.report(teamcity, { emitError: false }))
error Error: Cannot find module 'tslint-teamcity-reporter' ↓
cause Missing peer dependency tslint-teamcity-reporter.
fix
Run npm install --save-dev tslint-teamcity-reporter
Warnings
deprecated Package is deprecated. Since tslint 4.x and gulp-tslint 7.x, you can use tslint-teamcity-reporter directly as a formatter. ↓
fix Use gulp-tslint with formatter: 'tslint-teamcity-reporter' directly; see README for example.
gotcha Must be passed to tslint.report() as the reporter argument, not as a formatter to tslint(). ↓
fix Use .pipe(tslint.report(teamcity, { emitError: false })) instead of .pipe(tslint({ formatter: teamcity })).
gotcha Requires both gulp-tslint and tslint-teamcity-reporter as peer dependencies; missing either will cause runtime errors. ↓
fix Install gulp-tslint and tslint-teamcity-reporter as devDependencies.
Install
npm install gulp-tslint-teamcity yarn add gulp-tslint-teamcity pnpm add gulp-tslint-teamcity Imports
- default wrong
import teamcity from 'gulp-tslint-teamcity';correctvar teamcity = require('gulp-tslint-teamcity'); - default wrong
gulp.task('lint', function () { gulp.src('*.ts') .pipe(tslint({ formatter: teamcity }))); });correctgulp.task('lint', function () { gulp.src('*.ts') .pipe(tslint()) .pipe(tslint.report(teamcity, { emitError: false })); }); - default wrong
import gulp from 'gulp'; import tslint from 'gulp-tslint'; import teamcity from 'gulp-tslint-teamcity';correctvar gulp = require('gulp'); var tslint = require('gulp-tslint'); var teamcity = require('gulp-tslint-teamcity');
Quickstart
var gulp = require('gulp');
var tslint = require('gulp-tslint');
var teamcity = require('gulp-tslint-teamcity');
gulp.task('lint', function () {
return gulp.src('**/*.ts')
.pipe(tslint())
.pipe(tslint.report(teamcity, { emitError: false }));
});