eslint-plugin-eslint-comments
eslint-plugin-eslint-comments copied to clipboard
[no-unused-disable] incorrect reporting on single line with multi disable rules
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
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 -- автосгенерированный код */
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