brace-style ignores braces around class body
See original GitHub issueNot very sure about this. I’ll post it here anyway so someone can have a look. Feel free to close if I’m horribly wrong.
Using this configuration:
{ 'brace-style': ['error', 'allman'] }
What did you do? Please include the actual source code causing the issue.
class Foo {
}
What did you expect to happen?
According to Allman style rules, the opening brace should appear on a new line, and so the code above should trigger an error.
What actually happened? Please include the actual, raw output from ESLint.
No error.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:10 (8 by maintainers)
Top Results From Across the Web
brace-style - ESLint - Pluggable JavaScript Linter
Brace style is closely related to indent style in programming and describes the placement of braces relative to their control statement and body....
Read more >coding style - Should curly braces appear on their own line?
When I was a student I used to put curly braces on the same line, so that there are fewer lines, and the...
Read more >Code Syntax Style: Braces for Single Nested Statements
C# specification allows you to safely omit braces around single nested statements under some parent statements, for example if-else ...
Read more >Artistic Style 3.1
"One True Brace Style" uses linux braces and adds braces to unbraced one line conditional statements. Opening braces are broken from namespaces, classes,...
Read more >What's the purpose of using braces (i.e. {}) for a single-line if or ...
(Provided, of course, that the indentation is systematic and that you use this style consistently. (And a lot of very good programmers, writing...
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
Rule enhancementBugfix proposalWhat rule do you want to change? brace-style
Does this change cause the rule to produce more or fewer warnings? More
How will the change be implemented? (New option, new default behavior, etc.)? New default behavior, ideally (this is a missed use case)
Please provide some example code that this change will affect:
What does the rule currently do for this code? No error
What will the rule do after it’s changed? Warn for incorrect brace style
Note: This applies to all brace styles, not just Allman.
I’ll champion.
@platinumazure I have zero experience working on the ESLint codebase, just some familiarity with parser logic and ASTs. I’ll leave this one to @not-an-aardvark, but I’d be glad to help out another time.