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 formatting for component props #113

Open
petermikitsh opened this issue Jun 16, 2020 · 2 comments
Open

JSX formatting for component props #113

petermikitsh opened this issue Jun 16, 2020 · 2 comments

Comments

@petermikitsh
Copy link
Contributor

I have some components that accept a React.Node for props. Example (body, footer, etc):

Screen Shot 2020-06-15 at 5 58 34 PM

It would be nice if they followed the 2-space indentation. If maintainers agree with this change, any pointers on implementing it would be appreciated-- thanks!

@petermikitsh
Copy link
Contributor Author

Expected formatting would be:

<Card
  body={
    <div>
      <Typography color="textSecondary" gutterBottom>
        Word of the Day
      </Typography>
      <Typography component="h2" variant="h5">
        benevolent
      </Typography>
      <Typography color="textSecondary">adjective</Typography>
      <Typography component="p" variant="body2">
        well meaning and kindly.
      </Typography>
    </div>
  }
  footer={
    <Button tooltip="" variant="text">
      Learn More
    </Button>
  }
  header="Trivial Knowledge"
/>

@hipstersmoothie
Copy link
Contributor

Def down for better formatting. maybe it's just getting lost somewhere along the way.

Only tip for dev is let's avoid adding prettier as a dep. Had to remove that and do the formatting myself in storybook-pretty-props because prettier/standalone is 1mb

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

2 participants