Skip to content

Code style update (const, arrow functions) #1731

Closed

Description

@tuchk4

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:

Activity

  1. gaearon commented on Mar 6, 2017

    @gaearon
    Contributor

    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.

  2. tuchk4 commented on Mar 6, 2017

    @tuchk4
    ContributorAuthor
    • (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?

  3. gaearon commented on Mar 6, 2017

    @gaearon
    Contributor

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

  4. locked and limited conversation to collaborators on Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions