feat: support .prettierrc.js dotfile in legacy init templates
#535
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
In facebook/react-native@65eea9d, the prettier config for ESLint has been extracted to a .prettierrc file.
It was however not added to the React Native
templatefolder and this was causing linting issues in newly generated RN apps.In that PR to
react-native, a_prettierrc.jsfile was added to thetemplatefolder, however, a newly generated project would have the file still underscored (see facebook/react-native#25478 (comment))This commit addresses that issue by adding
prettierrc.jsto the list of underscored files that need to be renamed to dotfiles.Test Plan:
Inside freshly cloned
react-native:Results of
./cli.js init --template=file:///path/to/react-native TestProjectBEFORE patching

node_modules/@react-native-community/cli/build/commands/init/editTemplate.jsAFTER patching
node_modules/@react-native-community/cli/build/commands/init/editTemplate.jsby adding'prettierrc.js'to the listUNDERSCORED_DOTFILES