Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ending bracket on a new line #937

Closed
fab1an opened this issue May 14, 2016 · 9 comments
Closed

Make ending bracket on a new line #937

fab1an opened this issue May 14, 2016 · 9 comments

Comments

@fab1an
Copy link

fab1an commented May 14, 2016

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.

@bitwiseman
Copy link
Member

It looks like that project does not use js-beautify. Have you filed an issue in that project?

@fab1an
Copy link
Author

fab1an commented May 16, 2016

Oh, I use a plugin for that project esformatter-jsx. I filed an issue there: royriojas/esformatter-jsx#67

The README says it forwards all html-formatting to js-beautify though…

@bitwiseman
Copy link
Member

I think the README is out of date.

@fab1an
Copy link
Author

fab1an commented May 17, 2016

Why do you think that?

@callmevlad
Copy link

@bitwiseman It does look like that projects depends on js-beautify: https://github.com/royriojas/esformatter-jsx/blob/master/package.json#L60

@bitwiseman
Copy link
Member

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

@fab1an
Copy link
Author

fab1an commented May 18, 2016

Thanks!

@fab1an
Copy link
Author

fab1an commented May 18, 2016

Oh, nevermind I just found out that eslint has a rule for exactly this: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md

@miguelmota
Copy link

+1 for make ending bracket on a new line feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants