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

[docs] Use immediate export when there is no HOC #16005

Merged
merged 2 commits into from
Jun 3, 2019

Conversation

merceyz
Copy link
Member

@merceyz merceyz commented Jun 2, 2019

  • Use immediate export if there is no HOC
  • Consistent spacing between const classes = useStyles(); and return

Only applied to demos with a typescript version

See #16003 (comment)

@merceyz
Copy link
Member Author

merceyz commented Jun 2, 2019

Should I update formattedTSDemos.js to apply this when running from the CI to make sure it stays consistent?

@mui-pr-bot
Copy link

No bundle size changes comparing 4fccafb...ef33478

Generated by 🚫 dangerJS against ef33478

@joshwooding joshwooding added the docs Improvements or additions to the documentation label Jun 2, 2019
@merceyz
Copy link
Member Author

merceyz commented Jun 3, 2019

Consistent spacing between const classes = useStyles(); and return

While we're on the topic of consistency, perhaps we should enable https://palantir.github.io/tslint/rules/ordered-imports/

@eps1lon
Copy link
Member

eps1lon commented Jun 3, 2019

While we're on the topic of consistency, perhaps we should enable palantir.github.io/tslint/rules/ordered-imports

Not a fan of these kind of rules i.e. stylistic rules. What's the rationale for using it?

@eps1lon eps1lon merged commit b0c846a into mui:master Jun 3, 2019
@merceyz
Copy link
Member Author

merceyz commented Jun 3, 2019

What's the rationale for using it?

Just keeping things in the same order across all the demos, doesn't really matter though.

@merceyz merceyz deleted the docs/cleanup branch June 3, 2019 11:40
@oliviertassinari
Copy link
Member

@merceyz I love it 😍!

@merceyz
Copy link
Member Author

merceyz commented Jun 3, 2019

@merceyz I love it !

@oliviertassinari Here is the regex if you want it

(function )(?<functionName>\w*)((.|\r?\n)*?)(\r?\n*export default \k<functionName>;\r?\n)

Replace with: export default function $2$3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants