Tslint: Prevent creation of npm-debug.log

Created on 23 Mar 2016  路  4Comments  路  Source: palantir/tslint

Bug Report

  • TSLint version: 3.6.0
  • TypeScript version: 1.8.9
  • Running TSLint via: NPM Script (via ./node_modules/.bin/tslint)

I'm not sure if this is really a bug or even possible to fix. When running tslint via npm scripts,
I always get an error thrown by npm when tslint finds rules that are violated. This produces a npm-debug.log file every time.
My code compiles and is syntactically correct. When running tslint via command line (i.e. without npm), everything is fine.

Is is possible to prevent this behavior, since it is a little bit annoying?

Actual behavior

src/index.ts[57, 11]: missing whitespace

npm ERR! Darwin 14.5.0   
npm ERR! argv "/usr/local/Cellar/node/5.9.0/bin/node" "/usr/local/bin/npm" "run" "tslint" 
npm ERR! node v5.9.0
npm ERR! npm  v3.7.3
npm ERR! code ELIFECYCLE
npm ERR! <mypackage>@1.0.0 tslint: `tslint src/*.ts  
npm ERR! Exit status 2
npm ERR!
....

With Exit code -1, producing a npm-debug.log

Expected behavior

The output when run with tslint src/*.ts, e.g.

src/index.ts[57, 11]: missing whitespace

Without producing a npm-debug.log

Question

Most helpful comment

Fixed by #1062 and #1073; the --force option will be available in the next release

All 4 comments

This looks like a fundamental problem with npm scripts... the same thing happens when your TS compilation fails via an npm script right?

I had this same issue when I was running TSLint through npm scripts on a project of my own. Unfortunately NPM is quite unhappy whenever a script exits with a non-zero status, and I'm not sure there's anything we can do about it on the end of TSLint. Let me know if you have any suggestions though @teekaay. (I suppose we could make a --force flag or something that causes it to always exit with a status of 0? This could be a little useful actually)

@JKillian sounds useful, I guess if you don't want linting to fail your build... should be an easy command line flag to add

Fixed by #1062 and #1073; the --force option will be available in the next release

Was this page helpful?
0 / 5 - 0 ratings