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

padding-line-between-statements: add generic multiline option #9642

Closed
hotforfeature opened this issue Nov 20, 2017 · 6 comments
Closed

padding-line-between-statements: add generic multiline option #9642

hotforfeature opened this issue Nov 20, 2017 · 6 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules

Comments

@hotforfeature
Copy link

What rule do you want to change?
padding-line-between-statements

Does this change cause the rule to produce more or fewer warnings?
More

How will the change be implemented? (New option, new default behavior, etc.)?
Add a multiline statement type that detects all multiline statements. This will be identical to multiline-block-like but match on any type instead of just block-like statements.

As a side effect, this would also match unknown multiline block-like statements, such as TypeScript interface declarations.

Please provide some example code that this change will affect:

foo(
  a,
  b
);
foo(a, b);

What does the rule currently do for this code?
Nothing

What will the rule do after it's changed?
Enforce newlines for the first multiline function statement.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Nov 20, 2017
@aladdin-add aladdin-add added enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Nov 20, 2017
@aladdin-add
Copy link
Member

aladdin-add commented Nov 20, 2017

thanks for the proposal, however I'm 👎 to add this:

  • in foo(a, b), a and b are not statements.
  • padding-line-between-statements aims to enforce padding, not linebreak. so the option would enforce code like:
foo(
a,

b
);

can rule function-paren-newline work for this?

@hotforfeature
Copy link
Author

That is not the use case I am proposing.

Before:

foo(
  a,
  b
);
foo(a, b);

After:

foo(
  a,
  b
);

foo(a, b);

The statement is the multiline foo() function invocation.

@aladdin-add
Copy link
Member

ψ(._. )>sorry for misunderstanding! 😄

it seems a generic case. 👍 to make the change.

@platinumazure
Copy link
Member

I think I could get behind this. 👍 from me.

@not-an-aardvark
Copy link
Member

This seems similar to #9491. Would one of the proposals be better than the other?

@not-an-aardvark
Copy link
Member

Thanks for your interest in improving ESLint. Unfortunately, it looks like this issue 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 the rule yourself, rather than using a bundled rule that is packaged with ESLint.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jul 19, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

4 participants