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

padded blocks should allow single lines. #11449

Closed
allanchau opened this issue Feb 27, 2019 · 1 comment
Closed

padded blocks should allow single lines. #11449

allanchau opened this issue Feb 27, 2019 · 1 comment
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion auto closed The bot closed this issue 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

@allanchau
Copy link

I've been following #7145 and other similar issues and thought the option allowSingleLineBlocks would fix this. I am actually looking for a rule which:

  • Disallows padding (new lines) if the code within the block is only a single line.
  • Force padding if the code within the block spans multiple lines.

What rule do you want to change?

padded-blocks

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

Fewer.

How will the change be implemented? (New option, new default behavior, etc.)?

New option.

Please provide some example code that this change will affect:

// correct
if (cond) {
    doSomething();
}

if (cond) {

    doSomething()
        .then(...)
        .catch(...);

}

// incorrect
if (cond) {

    doSomething();

}

if (cond) {
    doSomething()
        .then(...)
        .catch(...);
}

What does the rule currently do for this code?

Warn or nothing depending on the settings.

What will the rule do after it's changed?

Produce less warnings.

Are you willing to submit a pull request to implement this change?

Sure, but I wouldn't know where to get started 😄 .

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

Unfortunately, it looks like there wasn't enough interest from the team
or community to implement this change. While we wish we'd be able to
accommodate everyone's requests, we do need to prioritize. We've found
that issues failing to reach accepted status after 21 days tend to
never be accepted, and as such, we close those issues.
This doesn't mean the idea isn't interesting or useful, just that it's
not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 27, 2019
@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 Sep 27, 2019
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 auto closed The bot closed this issue 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

2 participants