Skip to content
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

Option to report / remove unused disable comments #197

Open
scripthunter7 opened this issue Jan 26, 2024 · 0 comments
Open

Option to report / remove unused disable comments #197

scripthunter7 opened this issue Jan 26, 2024 · 0 comments

Comments

@scripthunter7
Copy link
Member

  • For example, in the following case, the rule is valid, so the disable comment is unnecessary:

    ! aglint-disable-next-line
    example.com##.ad

    ↓↓↓ should be fixed as ↓↓↓

    example.com##.ad
  • This is true even if certain linter rules are disabled, but not all of them are violated. For example, turning off the duplicated-modifiers rule is unnecessary in the following example:

    ! aglint-disable-next-line duplicated-modifiers, invalid-modifiers
    ||example.com^$script,unknown

    ↓↓↓ should be fixed as ↓↓↓

    ! aglint-disable-next-line invalid-modifiers
    ||example.com^$script,unknown
  • Also, if none of the rules are violated, we can remove the entire comment:

    ! aglint-disable-next-line duplicated-modifiers
    ||example.com^$script,unknown

    ↓↓↓ should be fixed as ↓↓↓

    ||example.com^$script,unknown

Note: this setting reduces the performance of the linter, so we have to turn it off by default

Inspired by https://eslint.org/docs/latest/use/configure/rules#report-unused-eslint-disable-comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants