add outer padding to rule padded-blocks and cover existing jscs functionality
See original GitHub issueUpdate: 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:
- https://github.com/eslint/eslint/issues/3092
- https://github.com/eslint/eslint/issues/5982
- https://github.com/eslint/eslint/issues/5949
related / converging rules:
- http://jscs.info/rule/requirePaddingNewLinesAfterBlocks.html
- http://eslint.org/docs/rules/padded-blocks
- I think jscs has another rule for padding before blocks?
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:
- Created 7 years ago
- Reactions:7
- Comments:120 (62 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
@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!