TsLint PreCommit hook failing with [email protected]
> overcommit --version
overcommit 0.42.0
> tslint --version
5.9.1
Expected result
with tslint semicolon rule enabled overcommit would stop a commit missing a semi colon from proceeding
Actual result
it lets you commit no problem
Debugging
I've tracked it down and it appears that it's related to the default flag option on the TsLint rule --t=prose. As far back as I checked that flag should apparently NOT work, it's either -t or --format. But as of [email protected] --t=prose appears to have the same effect as either -t prose or --format prose. With the latest version, [email protected] you get a good exit status but an error is shown:
error: unknown option '--t=prose'
I can't find anything on tslint saying there were changes, I'm guessing that the downstream dependency on commander updated in the interim and how commander parsed args changed.
The workaround for now is to remove the flags, as prose is the default formatter:
TsLint:
enabled: true
flags: []
The weird thing, and why I didn't just do a PR, is that for whatever reason, while -t prose and --format prose both work with [email protected] from the cli, changing the flag argument to either of those still fails with the error that it's an unknown option. Hopefully someone with more knowledge than I knows the reason and in the meantime, this workaround is out there.
Hey @garrinmf, thanks for the report.
Tagging @jhuiting as they added support for tslint in #421. Happy to accept a pull request fixing this. Thanks!
This was fixed in #594.