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

[JSX] Props ordering #323

Closed
codejunkienick opened this issue Jan 19, 2017 · 3 comments
Closed

[JSX] Props ordering #323

codejunkienick opened this issue Jan 19, 2017 · 3 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Comments

@codejunkienick
Copy link

codejunkienick commented Jan 19, 2017

Is there a chance to have an option for sorting props on JSX elements? Would be great to sort them in alphabetical order and have priority for having true values at the top

<Example
c
d
aFunc={() => console.log('')}
bProp={<Element />}
/>
@bnjmnt4n
Copy link
Contributor

This isn't really suitable for Prettier. Prettier is just a JS formatter, and should not modify the AST like that. This should probably be done by a JS codemod or a Babel plugin.

@lydell
Copy link
Member

lydell commented Jan 19, 2017

This would have execution order issues.

<Example
  b={prepareLunch()}
  a={eatLunch()}
/>

<Example
  a={eatLunch()}
  b={prepareLunch()}
/>

@vramana
Copy link

vramana commented Jan 19, 2017

For the reason pointed out by @lydell, this is not possible. Hence closing this issue.

@vramana vramana closed this as completed Jan 19, 2017
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 8, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

4 participants