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.

brace-style ignores braces around class body

See original GitHub issue

Not 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:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
platinumazurecommented, Dec 20, 2016

Rule enhancement Bugfix proposal

What 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:

/* eslint-env es6 */
/* eslint brace-style: ["error", "allman"] */

class Foo {
}

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.

0reactions
fasttimecommented, Jan 5, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

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