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

JSXEachAttributeInLine doesn't put boolean attributes on their own line #3

Open
DanielFGray opened this issue Apr 16, 2017 · 2 comments

Comments

@DanielFGray
Copy link

<Route exact path="/" component={Home} />

for example becomes

<Route exact
  path="/"
  component={Home} />

instead of

<Route
  exact
  path="/"
  component={Home} />

also I really think that the closing bracket should be at the same column as the opening tag, as in eslint rule for jsx-closing-bracket-location

@samuelsimoes
Copy link
Owner

Hi,

So, what this extension does is get each attribute and swap each catch with the catch value with a \n on the catch's beginning with the RegExp \w+=[{|'|"] (actual implementation).

The problem is, right now I don't know any way to get the boolean values without getting things that I shouldn't. Look the current implementation: http://rubular.com/r/wl5G5a9W7y

If you know some RegExp that can catch just the attribute's beginning on the scenario above, I'll gladly fix this.

About the position of the closing bracket, please create another issue to keep this focused. I have an idea to create a config for this.

@dkarter
Copy link

dkarter commented Jan 5, 2018

I actually prefer the current implementation. You can also try SplitJoin.vim which maps gS to do the same.

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

No branches or pull requests

3 participants