Rule for banner/Ratliff style indentation
See original GitHub issueEnvironment: latest ESLint in Visual Studio Code.
I’ve read the indent rule’s guide.
I don’t understand whether it’s possible to setup a rule to allow me to use “banner” AKA “Ratliff” style indentation? That’s when the closing brace is indented to the same level as the code block.
// eg control block
if (foo) {
doSomething();
}
// eg array declaration
var foo = [
bar,
baz,
qux
];
// same for arrays, expressions, etc...
Right now ESLint complains that Expected indentation of 0 spaces but found 2. (indent)
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Indentation style - Wikipedia
In computer programming, an indentation style is a convention governing the indentation of blocks of code to convey program structure.
Read more >Artistic Style 3.1
Ratliff style uses attached, indented braces. Switch blocks and class blocks are indented to prevent a 'hanging indent' with following case statements and...
Read more >Formatting braces: Ratliff / "Banner" style : RSRP-455769
Basically like K&R, except the closing brace matches the body, not the head. for (i = 0; i < ...
Read more >impact of indentation in programming - arXiv
This paper describes about different indentation styles used in Programming and also describes context of each indentation style. It also describes indentation.
Read more >Indent style - Informatics Engineering | Wiki eduNitas.com
Indent style Informatics Engineering Indent style In computer programming an indent ... 3.7 Pico style; 3.8 Banner style; 3.9 Lisp style; 3.10 Ratliff...
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 Free
Top 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
I just issued a pull request for this, hopefully this can serve as a basis for the new feature.
On Sat, Dec 2, 2017 at 08:48 grokky1 notifications@github.com wrote:
–
https://icon.me/jeanrene?from=emailsignature&access=65b8b3e1677d51e77b65c69e8bd3fdc30ecbebb6 Jeanrene Bouvier Head of Facts Haven jeanrene.bouvier@gmail.com View my Icon https://icon.me/jeanrene?from=emailsignature&access=65b8b3e1677d51e77b65c69e8bd3fdc30ecbebb6
@platinumazure I just played with a local version so far and I didn’t write any corresponding tests beyond checking on some of my own code that it produced the right results. Here’s the diff: