question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add outer padding to rule padded-blocks and cover existing jscs functionality

See original GitHub issue

Update: please refer to this pull request for the current status of this issue:

https://github.com/eslint/eslint/pull/8099

1st proposal: updating padded-blocks

{
  inner: "always" | "never" | "before" | "after"
  outer: "always" | "never" | "before" | "after"
  prefer: "inner" | "outer"
  outerExceptions: "inCallExpressions" | "inNewExpressions" | "inArrayExpressions" | "inProperties" | "singleLine"
  innerExceptions: "blocks" | "classes" | "switches"
}

The above doesn’t yet include additional options for backwards compatibility.

related issues:

related / converging rules:

2nd proposal

no modifications to padded-blocks. new rule that has exceptions to allow padded-blocks to work, if there is a conflict an error is thrown (is this even a thing?)

"padding-around-blocks": true | "before" | "after", {
  "exceptions": "inCallExpressions" | "inNewExpressions" | 
                "inArrayExpressions" | "inProperties" | "singleLine" | 
                "afterOpeningBlock" | "beforeEndingBlock"
}

"afterOpeningBlock" and "beforeEndingBlock" specify whether the rule should apply to a block placed at the beginning or end of the inside of another block. If they are both specified, then padded-blocks should work as expected. If they are not specified, then the new rule could potentially result in an error depending how padded-blocks is configured.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:120 (62 by maintainers)

github_iconTop GitHub Comments

9reactions
albertocommented, Feb 16, 2017

Also thanks to everyone who contributed in the discussion or with a PR and helped us flesh this out! special hat tip to @quinn @TheSavior @LinusU @ekmartin

We know it has been painfully slow, and we apologize for that

2reactions
kaicataldocommented, Feb 13, 2017

@alberto Sure thing - I’ll try to get to it tonight. @quinn Thanks for sticking with us and for all the thought you’ve put into this - your help has been invaluable!

Read more comments on GitHub >

github_iconTop Results From Across the Web

add outer padding to rule padded-blocks and cover existing jscs ...
Coming soon: A brand new website interface for an even better experience!
Read more >
padded-blocks - ESLint - Pluggable JavaScript Linter
Rule Details. This rule enforces consistent empty line padding within blocks. Options. This rule has two options, the first one can be a...
Read more >
Adding Margin and Padding to Blocks
In this article we'll have a look at how these elements all work together to control block margins and block padding. The code...
Read more >
padding-block - CSS: Cascading Style Sheets - MDN Web Docs
The padding-block CSS shorthand property defines the logical block start and end padding of an element, which maps to physical padding ...
Read more >
Eslint - Find and fix problems in your JavaScript code.
Once a language feature has been adopted into the ECMAScript standard ... add outer padding to rule padded-blocks and cover existing jscs ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found