react-native-macos/template
JP Driver 7254bab0b3 Fresh RN projects fails ESLint / Prettier by default (#25478)
Summary:
Fixes https://github.com/facebook/react-native/issues/25477

This PR adds a `.prettierrc.js` config file to the HelloWorld template.

`eslint-config-react-native-community` includes custom settings for some rules which conflict with Prettier's default settings.

Consequently, if you run `eslint` immediately after scaffolding a new app you get errors (see linked issue).

This PR configures Prettier to be compatible with both the existing ESLint config and the existing project template (with no code changes to the latter).

## Changelog

[General] [Changed] - Added a default Prettier config for new projects
Pull Request resolved: https://github.com/facebook/react-native/pull/25478

Test Plan:
- The following screenshots show the output of `yarn lint` before and after these changes
- These were run immediate after running `npx react-native-cli init RN060`

### Without these changes

- Linting errors on new projects
- Unfixable automatically due to conflicting rules
<img width="1116" alt="Screenshot 2019-07-03 at 17 44 55" src="https://user-images.githubusercontent.com/2393035/60610078-f6b44d00-9dba-11e9-826f-1524b949e4fd.png">
<img width="1116" alt="Screenshot 2019-07-03 at 17 45 07" src="https://user-images.githubusercontent.com/2393035/60610085-fb790100-9dba-11e9-9a9c-33f4cfefd51e.png">

### With these changes

- Brand new projects will not produce lint errors out of the box
<img width="1116" alt="Screenshot 2019-07-03 at 17 48 25" src="https://user-images.githubusercontent.com/2393035/60610266-57dc2080-9dbb-11e9-8a55-fd09f3549c17.png">

Differential Revision: D16223094

Pulled By: cpojer

fbshipit-source-id: bd2c00b1fcf27b1afcad8c18b357b95a3900bdf7
2019-07-15 02:09:59 -07:00
..
__tests__ Exclude RN templates from internal linters 2019-02-11 15:42:17 -08:00
android bump Android Gradle Plugin to 3.4.2 (#25652) 2019-07-14 23:48:34 -07:00
ios TM iOS: move jscallinvoker under ReactCommon podspec 2019-07-12 22:44:20 -07:00
App.js Improves the copy for the new app screen (#24918) 2019-05-17 03:49:21 -07:00
_buckconfig Move react-native template 2018-12-07 07:49:19 -08:00
_eslintrc.js Add .eslintrc to RN project template (#23901) 2019-03-21 07:14:23 -07:00
_flowconfig Flow v0.102 in xplat/js 2019-06-26 19:07:39 -07:00
_gitattributes Move react-native template 2018-12-07 07:49:19 -08:00
_gitignore Add generated `xcshareddata` folder to gitignore (#25451) 2019-07-03 16:29:47 -07:00
_prettierrc.js Fresh RN projects fails ESLint / Prettier by default (#25478) 2019-07-15 02:09:59 -07:00
_watchmanconfig Move react-native template 2018-12-07 07:49:19 -08:00
app.json Move react-native template 2018-12-07 07:49:19 -08:00
babel.config.js fix: change template to work with jest (#23150) 2019-01-24 17:33:50 -08:00
index.js Exclude RN templates from internal linters 2019-02-11 15:42:17 -08:00
metro.config.js Exclude RN templates from internal linters 2019-02-11 15:42:17 -08:00
package.json Add package.json scripts ro run android and ios in template (#25618) 2019-07-12 09:05:12 -07:00