Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44874
While reviewing https://github.com/facebook/react/pull/29830, I noticed this file was committed with tab indentation in React Native. I have also used the `.gitignore` entry to clarify how `react-native.code-workspace` interacts with an optional user `.vscode/` config directory.
Note: The `json-stringify` parser can be used with Prettier 3+ only, so we use `json` instead.
Changelog: [Internal]
Reviewed By: vzaidman
Differential Revision: D58413581
fbshipit-source-id: 58c14db6648fed10736062b1f055475154aa74a4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39048
Similar to D48047348, we should also use hermes-parser to parse .js.flow files to support newer Flow syntax.
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D48398780
fbshipit-source-id: 280ac546493361c4421449f86bf3f735b93a18e8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37915
Enable the `prettier-plugin-hermes-parser` in xplat. This plugin enables the use of `hermes-parser` which is significantly faster than the current flow parser prettier bundles (improves formatting time by ~50%) and also brings support for the latest Prettier 3.0.0 printing logic for JS. This upgrade is required in order to enable upcoming Flow features that add new syntax.
Changelog: [Internal]
Reviewed By: SamChou19815
Differential Revision: D46748891
fbshipit-source-id: 3775ef9afa7c04e565fa4fcf8ca5b410f49d35a1
Summary:
- Although we have `.editorconfig`, on Windows machines most of the times the IDEs default to `CRLF` as default EOL config
- we've already specified the `eol` config as `lf` in `.editorconfig` at root level
- this diff syncs same config for prettier as well
>NOTE: Using `[skip ci]` as it's non code change and is tested for formatting.
## Changelog:
[GENERAL] [CHANGED] - Specify `eol` config in `.prettierrc` as `lf` at the root level
Pull Request resolved: https://github.com/facebook/react-native/pull/36884
Test Plan: - `yarn run format` --> _nothing should change_
Reviewed By: christophpurrer
Differential Revision: D45056330
Pulled By: cortinico
fbshipit-source-id: 166cbba04728e04521de58144abf0576730c8edd
Summary:
Since Prettier 2.0, the default for the `arrowParens` option has changed from `avoid` to `always`.
In preparation for upgrading Prettier in Xplat to 2.1, add `arrowParens: 'avoid'` explicitly to configurations that were missing it so that we do not have a change of behaviour when upgrading.
Changelog: [Internal]
Reviewed By: bolinfest
Differential Revision: D23666397
fbshipit-source-id: 665f20d1419d0d664a6ef5cddc46f441b20eeb51
Summary:
This fixes an issue where the Prettier config was set to the `fb` (Facebook) values for all users of the `react-native-community/eslint-config` package. This was due to [this line](8f186b84ae/packages/eslint-config-react-native-community/index.js (L219)) in the config file.
It was causing issues like these:
* Errors when using newer versions of `eslint-plugin-prettier` (you had to use a version that was >1 year old): https://github.com/facebook/react-native/issues/24564
* Errors due to the Prettier parser being forced to be `flow` when using Typescript: https://github.com/typescript-eslint/typescript-eslint/issues/481
This PR:
* Changes that line to remove the explicit `fb` config so users can set their own.
* Moves the React Native Prettier config to `.prettierrc` so ESLint, Prettier, and code editors can all read from the same place.
* Upgrades both `prettier` and the `eslint-plugin-prettier` to the latest versions.
[General] [Fixed] - Stopped the Prettier config being set for all users of react-native-community/eslint-config
Pull Request resolved: https://github.com/facebook/react-native/pull/24635
Differential Revision: D15122200
Pulled By: cpojer
fbshipit-source-id: 56bae8a7f2d8e133b1d808091a6b73302b94d2ed