Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !8157

Add Prettier config to app

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Nick McCurdy requested to merge github/fork/nickmccurdy/add-prettier-config-to-app into main Dec 12, 2019
  • Overview 6
  • Commits 8
  • Pipelines 0
  • Changes 2

Rationale

This monorepo has a Prettier config that affects formatting of all files, including the official templates. However, because this config isn't included in the templates, running Prettier (as recommended in the docs) will change the formatting of the app, which can be confusing or inconvenient.

Changes

Modified the init script to copy the monorepo's Prettier config to package.json (for any template). In the future we may want to make this extensible if third party templates need to set their own Prettier configs.

Testing

Created an example app with yarn create-react-app my-app, confirming that the Prettier config was created in package.json and running Prettier does not reformat the files (as the formatting is already correct).

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/nickmccurdy/add-prettier-config-to-app