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

Option to enforce padded blocks only over a certain line threshold #7146

Closed
alphanull opened this issue Sep 13, 2016 · 9 comments
Closed

Option to enforce padded blocks only over a certain line threshold #7146

alphanull opened this issue Sep 13, 2016 · 9 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

@alphanull
Copy link

alphanull commented Sep 13, 2016

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. Maybe something like: { minLines: n }

Please provide some example code that this change will affect:

if (condition) {
    doSomething();
}

What does the rule currently do for this code?

Warning / Error: "Block must be padded by blank lines."

What will the rule do after it's changed?

No warning when using padded-blocks with the option: { minLines: 2 } since the block only contains one line. Should also work in confunction with fix.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Sep 13, 2016
@btmills btmills added the needs info Not enough information has been provided to triage this issue label Sep 13, 2016
@eslintbot
Copy link

Hi @alphanull, thanks for the issue. It looks like there's not enough information for us to know how to help you.

If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

Requesting a rule change? Please see Proposing a Rule Change for instructions.

If it's something else, please just provide as much additional information as possible. Thanks!

@alphanull
Copy link
Author

I actually did look up the "Proposing a Rule Change" page but the link to the template seems to generate a "404": https://github.com/eslint/eslint/blob/master/templates/rule-change-proposal

Otherwise, I think I have provided all information that is actually needed. So what could be missing?

@btmills
Copy link
Member

btmills commented Sep 13, 2016

@alphanull sorry about the broken link, we're working to fix that. Here's the template. You got most of it, you should be able to tweak your existing posts a bit.

@alphanull
Copy link
Author

No problem, I have updated my initial post. Hope its OK now.

@btmills btmills added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed needs info Not enough information has been provided to triage this issue triage An ESLint team member will look at this issue soon labels Sep 13, 2016
@btmills
Copy link
Member

btmills commented Sep 13, 2016

Thanks @alphanull, looks good now.

I don't have any strong opinions on this, let's see what the rest of the team thinks.

@platinumazure
Copy link
Member

I don't use padded-blocks myself (my style is to add padding to the outside of blocks), but this seems like a reasonable request. I'll endorse (:+1:).

@alphanull
Copy link
Author

Thank you platinumazure! Imho, the ability to add padding outside of blocks as well is also useful.

@alphanull
Copy link
Author

In addition, I think the following restrictions should apply to minLines:

  • has to be an integer
  • has to be greater than zero

@kaicataldo
Copy link
Member

I'm closing this issue because it looks like consensus couldn't be reached. While we wish we could accommodate all requests, we have limited resources and do need to prioritize. We've found that issues failing to reach consensus after 21 days tend to never reach consensus, and as a team have decided to close such issues. This doesn't mean the idea isn't interesting or valuable, only that it's not something the team can commit to at the moment.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 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 Feb 6, 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

5 participants