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
Rule proposal: Collapsible if-statements #819
Comments
Accepted. PR welcome. |
Rule name? |
This can only work if it’s not followed by Can’t be flattened: if (x) {
if (y) {}
} else {} Can be flattened if (x) {
} else if (x) {
if (y) {}
} |
I think this comment make sense, let's name it as |
Hasn’t eslint stopped adding rules to core? |
No, but @sindresorhus made this proposal here. I guess he want have this rule in |
Anyway, the rule is ready #936 |
According to their rule suggestion issue template:
But I suppose this rule could still be accepted as a modification of the existing one. |
Yeah, I have given up bothering proposing stuff over at ESLint. The process there is way too slow and they reject almost everything anyway. |
The rule should identify nested if-statements that can be combined into one.
Would be useful if the rule could be auto-fixable.
From: typescript-eslint/typescript-eslint#279
The text was updated successfully, but these errors were encountered: