Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file.tslint.failureCount and such are not populated #95

Closed
unional opened this issue Nov 21, 2016 · 3 comments
Closed

file.tslint.failureCount and such are not populated #95

unional opened this issue Nov 21, 2016 · 3 comments

Comments

@unional
Copy link

unional commented Nov 21, 2016

Thanks for wanting to report an issue you've found in gulp-tslint. Please make sure it's an issue in gulp-tslint, not tslint. Otherwise please submit an issue to tslint: https://github.com/palantir/tslint/issues/new. Please delete this text and fill in the template below.

gulp-tslint version: 7.0.1
tslint version: 4.0.1
Operating system: OSX

Example gulp configuration (if applicable):

function negativeTest(config) {
  return gulp.src(`spec/${config}/*.fail.ts`)
    .pipe(gulpTslint({
      configuration: tslint.Configuration.findConfiguration(`./${config}.js`)
    }))
    .pipe((function () {
      var hasError = false;
      return through(function (file) {
        if (file.tslint.failureCount === 0) {
          gutil.log(
            `[${gutil.colors.cyan('gulp-tslint')}]`,
            gutil.colors.red(`error: ${file.tslint.failureCount}`),
            `(negative) ${file.relative}`);
          hasError = true;
        }
      }, function () {
        if (hasError) {
          this.emit('error', new PluginError('gulp-tslint', 'Failed negative test(s).'));
        } else {
          this.emit('end');
        }
      });
    })());
}

The file.tslint.failureCount is 0 even thou there are failures.
It used to work before. Currently, that tslint object is always:

{ failureCount: 0,
  failures: [],
  fixes: [],
  format: 'prose',
  output: '' }
@unional
Copy link
Author

unional commented Nov 21, 2016

Nevermind. The tslint.Configuration.findConfiguration() doesn't work correctly.

@unional unional closed this as completed Nov 21, 2016
@panuhorsmalahti
Copy link
Owner

What do you mean it doesn't work correctly?

@unional
Copy link
Author

unional commented Nov 22, 2016

// works
gulpTslint({
  configuration: './custom.js'
})

// doesn't work
gulpTslint({
  configuration: tslint.Configuration.findConfiguration('./custom.js')
})

I didn't print out the result of findConfiguration() to see why it doesn't work, but it doesn't. 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants