Skip to content

Code style update (const, arrow functions) #1731

New issue

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

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

Already on GitHub? # to your account

Closed
tuchk4 opened this issue Mar 6, 2017 · 3 comments
Closed

Code style update (const, arrow functions) #1731

tuchk4 opened this issue Mar 6, 2017 · 3 comments

Comments

@tuchk4
Copy link
Contributor

tuchk4 commented Mar 6, 2017

Started here - #1433 (comment)

(only for packages/react-scripts)

  • If arrow functions are already used maybe switch others functions to arrow ?
  • Same for var -> const. For example:
@gaearon
Copy link
Contributor

gaearon commented Mar 6, 2017

Let's do what I suggested there for global CLI too, and move all the code except the Node version check into a separate file that would be lazily required. This way we can use modern syntax there without screwing up the version check message.

@tuchk4
Copy link
Contributor Author

tuchk4 commented Mar 6, 2017

  • (packages/react-scripts) switch normal functions to arrow
  • (packages/react-scripts) switch var to const
  • (packages/create-react-app) split into two scripts - index.js with node version check that should be available for node 0.12 and create-react-app.js (suggest your script name) with modern syntax that is required from index.js after node version check

correct?

@gaearon
Copy link
Contributor

gaearon commented Mar 6, 2017

Yes, although I'd only switch to arrows where it helps readability. I'd leave top level functions as named declarations.

@tuchk4 tuchk4 closed this as completed Mar 10, 2017
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants