Skip to content

Conversation

@RobinCsl
Copy link
Contributor

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 template folder and this was causing linting issues in newly generated RN apps.

In that PR to react-native, a _prettierrc.js file was added to the template folder, 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.js to 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 TestProject

BEFORE patching node_modules/@react-native-community/cli/build/commands/init/editTemplate.js
Screenshot 2019-07-15 at 17 35 44

AFTER patching node_modules/@react-native-community/cli/build/commands/init/editTemplate.js by adding 'prettierrc.js' to the list UNDERSCORED_DOTFILES

Screenshot 2019-07-15 at 17 33 57

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 `template` folder and this was causing linting issues in newly generated RN apps.

In that [PR](facebook/react-native#25478) to `react-native`, a `_prettierrc.js` file was added to the `template` folder, 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.js` to the list of underscored files that need to be renamed to dotfiles.
@thymikee thymikee changed the title fix: init renames _prettierrc.js to .prettierrc.js feat: support .prettierrc.js dotfile in legacy init templates Jul 15, 2019
Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@thymikee thymikee merged commit cb52be2 into react-native-community:master Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants