create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Add Prettier config to app

Open nickserv opened this issue 5 years ago • 6 comments
trafficstars

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).

nickserv avatar Dec 12 '19 02:12 nickserv

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Jan 11 '20 06:01 stale[bot]

This is still an issue.

nickserv avatar Jan 11 '20 06:01 nickserv

There haven't been any conflicts. Is there anything I need to do to get this to a mergeable or reviewable state?

nickserv avatar Feb 05 '20 17:02 nickserv

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Mar 06 '20 18:03 stale[bot]

This pull request is still working and awaiting review.

nickserv avatar Mar 06 '20 18:03 nickserv

I would recommend reverting to Prettier's defaults, we would be comfortable with this? Now trailingComma is es5 by default, I feel like singleQuote is inconsistent with JSX syntax, and arrowParens are useful to keep so types/spreads/etc can easily be added to arguments.

nickserv avatar Jun 19 '20 09:06 nickserv