question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to print out the list of top disabled rules

See original GitHub issue

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:

  • determining what kinds of tech debt exist in a codebase
  • determining what rules may be buggy and in need of improvements
  • determining what issues developers need more education about
  • etc

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

yarn eslint --list-disable-directives .

[normal eslint output goes here]

Rule                   | Count | Relative 
:----------------------|------:|--------:
no-console             |   125 |    40.1%
no-unused-vars         |   104 |    33.3%
radix                  |    43 |    18.8%
node/no-missing-import |    22 |     7.1%
import/order           |    15 |     4.8%
prettier/prettier      |     2 |     0.6%
no-undef               |     1 |     0.3%

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
btmillscommented, May 29, 2021

The reasons you listed for this being potentially useful are compelling. For codebases that don’t configure globals, envs, or rule options inline, --no-inline-config can do this today: the new errors with that option would be the ones that were disabled inline.

1reaction
nzakascommented, May 28, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Guide to Disability Rights Laws - ADA.gov
June 16, 2022. This guide provides an overview of Federal civil rights laws that ensure equal opportunity for people with disabilities.
Read more >
Guidelines for Writing About People With Disabilities
This factsheet provides guidelines for portraying individuals with disabilities in a respectful and balanced way by using language that is accurate, ...
Read more >
Rules for the Accessibility Checker - Microsoft Support
Use the Accessibility Checker to find potential problems for people with disabilities. Learn about rules, errors, warnings, and tips.
Read more >
Protecting Students With Disabilities - Department of Education
Frequently Asked Questions about Section 504 requirements for the education by school districts of students with disabilities.
Read more >
Convention on the Rights of Persons with Disabilities - OHCHR
Preamble (a) Recalling the principles proclaimed in the Charter of the United ... of Action concerning Disabled Persons and in the Standard Rules...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found