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
Update: Add "multiline" type to padding-line-between-statements #8668
Update: Add "multiline" type to padding-line-between-statements #8668
Conversation
LGTM |
Seems reasonable (and useful), 👍 from me. |
@eslint/eslint-team Looks like this just needs a champion to move forward. |
Thanks for your interest in improving ESLint. Unfortunately, it looks like this proposal didn't get consensus from the team, so I'm closing it. We define consensus as having three 👍s from team members, as well as a team member willing to champion the proposal. This is a high bar by design -- we can't realistically accept and maintain every feature request in the long term, so we only accept feature requests which are useful enough that there is consensus among the team that they're worth adding. Since ESLint is pluggable and can load custom rules at runtime, the lack of consensus among the ESLint team doesn't need to be a blocker for you using this in your project, if you'd find it useful. It just means that you would need to implement this as a custom rule yourself, rather than using a bundled rule that is packaged with ESLint. |
since #9491 has been accept, shall we reopen this PR, and marked accepted? |
I've reopened this PR, thanks! @Lobstrosity If you're still willing to work on this, here's what we need:
Thanks for your patience as we worked through our process! |
…expression-statement-type
@platinumazure: Thank you for re-evaluating. I have signed the CLA. And I have added test cases to confirm that with this rule: { blankLine: "always", prev: "multiline-expression", next: "return" } The following are correct: () => {
someArray.forEach(x => doSomething(x));
return theThing;
} () => {
someArray.forEach(
x => doSomething(x)
);
return theThing;
} But this is incorrect: () => {
someArray.forEach(
x => doSomething(x)
);
return theThing;
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! (It'd be nice to make the test cases span multiple lines using template strings, but that could be done in a future PR.)
@Lobstrosity Thanks, awesome work! I apologize for letting this sit so long. Not sure we can get this into today's release (at least, I'd like one more reviewer before merging); but if we miss today's, it should definitely get in next release. Thanks for contributing! |
Thanks for contributing, @Lobstrosity! And I'm glad we could finally get this in-- thanks for your patience! |
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[X] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
Adds
multiline-expression
statement type to existingpadding-line-between-statements
rule.Is there anything you'd like reviewers to focus on?
n/a
What rule do you want to change?
padding-line-between-statements
Does this change cause the rule to produce more or fewer warnings?
More (or at least never fewer)
How will the change be implemented? (New option, new default behavior, etc.)?
Adds
multiline-expression
property to existingStatementTypes
object (basically a copy/paste of the existingexpression
property and a copy/paste of the line numbers check from existingmultiline-block-like
property).Please provide some example code that this change will affect:
Given the following rule:
The following code (single-line expression without padding line) is correct:
The following code (multi-line expression with padding line) is correct:
The following code (multi-line expression without padding line) is incorrect:
What does the rule currently do for this code?
Currently, no warnings/errors emitted for any of the samples above.
What will the rule do after it's changed?
No warnings/errors will be produced for the correct samples. An error will be produced for the incorrect sample.