Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Feature request: summary report #2267

Closed
gemal opened this issue Feb 28, 2017 · 20 comments
Closed

Feature request: summary report #2267

gemal opened this issue Feb 28, 2017 · 20 comments

Comments

@gemal
Copy link

gemal commented Feb 28, 2017

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

@nchen63
Copy link
Contributor

nchen63 commented Feb 28, 2017

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

@nchen63 nchen63 closed this as completed Feb 28, 2017
@gemal
Copy link
Author

gemal commented Mar 1, 2017

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

@nchen63
Copy link
Contributor

nchen63 commented Mar 1, 2017

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.

@nchen63 nchen63 reopened this Mar 1, 2017
@gemal
Copy link
Author

gemal commented Mar 1, 2017

yes that sounds like a good idea

@gemal
Copy link
Author

gemal commented Mar 1, 2017

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?

@nchen63
Copy link
Contributor

nchen63 commented Mar 1, 2017

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

@adidahiya
Copy link
Contributor

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

@gemal
Copy link
Author

gemal commented Mar 1, 2017

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

@adidahiya
Copy link
Contributor

Given that we don't have #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?

@gemal
Copy link
Author

gemal commented Mar 1, 2017

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 :)

@ChrisMBarr
Copy link
Contributor

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

TSLint finished linting 25 files, 3 have errors.

@gemal
Copy link
Author

gemal commented Mar 6, 2017

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

@guilhermejcgois
Copy link

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

@massimonewsuk
Copy link

massimonewsuk commented May 3, 2018

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.

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Nov 4, 2018

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

@mrseanryan
Copy link

mrseanryan commented Nov 4, 2018

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

@JoshuaKGoldberg
Copy link
Contributor

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

@karfau
Copy link

karfau commented Dec 8, 2018

@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:

@JoshuaKGoldberg
Copy link
Contributor

💀 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!

@JoshuaKGoldberg
Copy link
Contributor

🤖 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! 👋

@palantir palantir locked and limited conversation to collaborators Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants