New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to print out the list of top disabled rules #14597
Comments
This is an interesting idea. I’m not sure if this exact proposal is complete enough to dig in too deep, but I think we can at least discuss the overall direction and if the team is interested, we could progress to an RFC. |
The reasons you listed for this being potentially useful are compelling. For codebases that don't configure globals, envs, or rule options inline, |
Thanks for reviewing. Are there any areas to discuss/elaborate on before I start writing an RFC? Note: I updated the output format to match that of the |
@bmish i think you can start on the RFC. 👍 |
Oops! It looks like we lost track of this issue. @eslint/eslint-tsc what do we want to do here? This issue will auto-close in 7 days without an update. |
I still plan to work on this hopefully in the near future. |
Great, adding you as an assignee on this issue so the bot won't pick it up. |
Is the idea to count directives or suppressed problems? In the latter case, this could be closely related to eslint/rfcs#82 - once we merge #15459, I believe the data required for this table will be already available in |
@mdjermanovic good call out. If I had to choose one, my guess is that actual suppressions are more important to analyze than just the disable directives. But I could see both being useful. This raises the possibility that we could expose multiple metrics and so ideally we would come up with a scalable solution that would unify them all under a single framework. The initial per-rule metrics I'm envisioning are:
Here's how it could work:
And then there's another question of whether we show a separate table for each metric, or whether we try to combine the displayed metrics into one table like this:
Or we could put values and relative percentages in the same column for better aesthetics and space-savings (my preference):
The table would be sorted in descending order based on the first column. The first column would default to violations but the ordering / columns could be controlled by To summarize, a new CLI feature for displaying multiple metrics has the potential to expose powerful new data to users, as well as providing a better home for the existing rule performance metrics. Let me know what people think. |
The problem you want to solve.
In a large codebase, there can easily be hundreds or even thousands of places where inline disable directive comments (like
// eslint-disable-line no-console
) have been used.There is not currently a convenient method to find out what rules developers are disabling like this other than manually searching the codebase or writing a custom regexp parsing script. In fact, I put together a custom script for exactly this purpose, but it's a bit buggy and not easily available across different projects.
Gaining an understanding / summary statistics of what rules are being most frequently disabled by contributors can be useful for a variety of reasons:
Your take on the correct solution to problem.
I'm proposing a new CLI option
--list-disable-directives
(or similar name) that would show the complete list of inline-disabled rules by count (descending order).This matches the output format of the TIMING environment variable which can be used to see summary statistics about rule performance.
Are you willing to submit a pull request to implement this change?
Yes
The text was updated successfully, but these errors were encountered: