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

[no-unused-disable] incorrect reporting on single line with multi disable rules #57

Open
JounQin opened this issue Mar 2, 2021 · 2 comments

Comments

@JounQin
Copy link

JounQin commented Mar 2, 2021

export const getAvailableIPs = (subnet: Subnet) => {
  const protocol = subnet?.spec?.protocol;
  const { availableIPs, v4availableIPs, v6availableIPs } = subnet?.status || {};
  switch (protocol) {
    case 'IPv4':
    // eslint-disable-next-line default-case-last, no-fallthrough
    default: {
      return v4availableIPs ?? availableIPs;
    }
    case 'IPv6':
      return v6availableIPs ?? availableIPs;
    case 'Dual': {
      if (v4availableIPs == null) {
        return v4availableIPs ?? availableIPs;
      }

      if (v6availableIPs == null) {
        return v4availableIPs ?? availableIPs;
      }

      return Math.min(v4availableIPs, v4availableIPs);
    }
  }
};
✘  eslint-comments/no-unused-disable

     'no-fallthrough' rule is disabled but never reported

Of course, it helps me to move 'IPv4' and 'default' to the last case. 🤣

But it indeed a bug of this rule.


Additionally, this rule seems unsafe to use, because we can not disable this rule itself inline.

related #50

@Delagen
Copy link

Delagen commented Mar 16, 2021

The same

error: 'eslint-comments/no-unused-disable' rule is disabled but never reported (eslint-commen
ts/no-unused-disable) at src\types\services\type-registry.loader.ts:4:20:
> 4 | /* eslint-disable  eslint-comments/no-unused-disable -- автосгенерированный код */

@MichaelDeBoey
Copy link

Hi @JounQin!

Since this repo is unmaintained, you might want to re-open this issue in the @eslint-community fork https://github.com/eslint-community/eslint-plugin-eslint-comments

For more info about why we created this organization, you can read https://eslint.org/blog/2023/03/announcing-eslint-community-org

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

No branches or pull requests

3 participants