You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
Currently if an error is thrown while applying tslint rule it's logged as warning and only error message is included in log. This complicates debugging such cases. For example see #2696 where tslint printing the following log line:
Warning: Cannot read property 'kind' of undefined
without any details like stacktrace.
I suggest to add debug or verbose option that will enable output of stacktrace.
If that's ok I can submit a PR.
TypedRule used to throw an exception when tslint was not run with --project --type-check. That caused some trouble when using the same tslint.json in CLI and for example in vscode-tslint.
To fix this everything was wrapped in try-catch.
Reverting/changing that behavior was also on my agenda, because I think it causes more trouble than it's actually worth.
There are several options:
Remove the try-catch, replace the throw in TypedRule#apply with showWarningOnce('...'); return [];
still outputs a warning when not type checking
bugs in rules will crash the process
you notice that something when wrong
you get the whole stack trace
otherwise editor plugins might just swallow the warning
easier debugging by pausing at the uncaught exception
log the whole stack trace by default
add an option --debug or --verbose as described above and ...
👍 for printing the whole stack trace. It's pretty cryptic otherwise, since there's no indication that the message is being printed because of an exception.
@andy-hanson printing the stack trace by default doesn't play well will the exception thrown in TypedRule. Instead of throwing there, it should just call showWarningOnce and return.
Bug Report
Currently if an error is thrown while applying tslint rule it's logged as warning and only error message is included in log. This complicates debugging such cases. For example see #2696 where tslint printing the following log line:
without any details like stacktrace.
I suggest to add
debug
orverbose
option that will enable output of stacktrace.If that's ok I can submit a PR.
I'm not alone http://stackoverflow.com/q/43577136/746347
The text was updated successfully, but these errors were encountered: