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.

Make ending bracket on a new line

See original GitHub issue

Is it possible to format HTML/JSX like this:

<div
    className="test"
    style={{
        height: "100px"
    }}
>                               <----- on a new line
    Something
</div>

At the moment I get

<div
     className="test"
     style={{
                height: "100px"                    <----- too much indentation
            }}>                                  <--- ">" symbol not on a new line
  Something
</div>

I use the esformatter-jsx, which uses js-beautify to format JSX.

Many thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
miguelmotacommented, May 19, 2016

+1 for make ending bracket on a new line feature

2reactions
bitwisemancommented, May 17, 2016

Ah. Okay. 😄 Well, the formatting you suggest is not currently part of the beautifier. I’ve marked it as a future enhancement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

clang-format closing bracket on a new line - c++ - Stack Overflow
I'd like my multi-line function invocations (although EXPECT_EQ is a macro in this case) to have the closing round bracket on its own...
Read more >
Why should we not put end brackets on the same line?
One reason I can think of is that putting the closing brackets on individual lines makes it easier to (un)comment the whole block...
Read more >
PEP 8: Hanging Indentation and Closing Brackets in Python
According to the PEP 8 standard, there are two ways to line up the closing braces, brackets, or parentheses. First, line it up...
Read more >
Do you put braces ("{") in a new line or on the same line? : r/java
I personally prefer putting the opening bracket at the end of line because it makes my code look more compact. I'm less disturbed...
Read more >
object-curly-newline - ESLint - Pluggable JavaScript Linter
Options. This rule has either a string option: "always" requires line breaks after opening and before closing braces; "never ...
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