Tslint: Feature request: summary report

Created on 28 Feb 2017  ·  20Comments  ·  Source: palantir/tslint

Bug Report

  • __TSLint version__: 4.50
  • __TypeScript version__:
  • __Running TSLint via__: CLI

Could be nice to be able to see the files being linted like eslint can do with:
DEBUG=eslint:* eslint .

perhaps a tslint --showfiles option?

TypeScript code being linted

// code snippet

with tslint.json configuration:


Actual behavior

Expected behavior

In Discussion Needs Proposal Enhancement 🌹 R.I.P. 🌹

Most helpful comment

Some update about this? I would like at least some simple report like @chrismbarr sample...

All 20 comments

You can show the file name by using the verbose formatter (https://palantir.github.io/tslint/formatters/verbose/)

are you sure of this. Verbose only seem to show files with errors. I want to show every files that is linted, regardless of it has errors or not

ah, sorry, I misunderstood the request.

I'm ok with the flag, but I'm not sure if printing to console without going through a formatter is the right approach.

Perhaps we could add another function to IFormatter and formatters could optionally implement printing them in their own manner.

yes that sounds like a good idea

so another function besides:
format(failures: RuleFailure[], fixes?: RuleFailure[]): string;

like
show(files: Files[]): string;

??

I'm not a big expect here. Can you provide code or?

hmm, how about format(failures: RuleFailure[], fixes?: RuleFailure[], files?: string[]): string;

I still don't see why you need this feature. Are you just verifying your glob expansion?

I use this in CI automation to make sure that all ts files were linted and that the glob and any ignores etc works

Given that we don't have https://github.com/palantir/tslint/issues/73... I don't think we need this implemented in TSLint itself. Can you verify your tslint file list config outside of the tslint command in CI?

I was using:
tslint src/**/*.ts

but apparently no files were linted
I should have used:
tslint 'src/**/*.ts'

so here a list of linted files would have been really nice :)

What if it just had a final summary that said something like:

TSLint finished linting 25 files, 3 have errors.

could be ok. a list of files would be better IMHO

Some update about this? I would like at least some simple report like @chrismbarr sample...

A report would be great. It was working on my Windows box but every other developer here uses Mac/Linux, including the build server, so tslint errors were going unnoticed!

Adding the single quotes (as @gemal said) fixed the issue, but a report would have helped me spot the underlying cause much faster.

Looks like this issue has morphed into a version of #3941: Feature request: summary report. Changing the title here to preserve the deeper discussion.

Would love to see a more detailed proposal of exactly what we'd be adding here.

Edit: linked here as duplicates...

  • Logging the duration of individual rules
  • Reporting number of tslint:disable occurrences
  • Logging all known TSLint rules
  • Logging all _enabled_ TSLint rules

I want to show every files that is linted, regardless of it has errors or not

@gemal to achieve this, you could write a custom tslint rule, that console logs each file it processes.

I had a similar requirement, so I wrote this rule:

https://www.npmjs.com/package/tslint-log

Perhaps relevant to the discussion: https://github.com/karfau/tslint-report

@JoshuaKGoldberg thx for brigning my attention to this issue.
As far as I understand the issue description/conversation the original intention was about the number of files that have been linted. Which is not what tslint-report provides.
Instead it is more related to the following topics:

  • Logging all known TSLint rules
  • Logging all enabled TSLint rules

That you added to this thread. But in that message it is not clear to me how you think the lined issues ask for such a thing.

For the sake of completeness: This rule set uses tslint-report and adds it's reports to it's repository:

💀 _It's time!_ 💀

TSLint is being deprecated and no longer accepting pull requests for major new changes or features. See #4534. 😱

If you'd like to see this change implemented, you have two choices:

  • Recommended: Check if this is available in ESLint + typescript-eslint
  • _Not Recommended: Fork TSLint locally_ 🤷‍♂️

👋 It was a pleasure open sourcing with you!

_If you believe this message was posted here in error, please comment so we can re-open the issue!_

🤖 Beep boop! 👉 TSLint is deprecated 👈 _(#4534)_ and you should switch to typescript-eslint! 🤖

🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zewa666 picture zewa666  ·  3Comments

rajinder-yadav picture rajinder-yadav  ·  3Comments

CSchulz picture CSchulz  ·  3Comments

ypresto picture ypresto  ·  3Comments

DanielKucal picture DanielKucal  ·  3Comments