mmazzarolo / react-native-universal-monorepo

React Native boilerplate supporting multiple platforms: Android, iOS, macOS, Windows, web, browser extensions, Electron.
MIT License
1.7k stars 150 forks source link

Add pre commit hook for prettier #3

Closed farzin-deriv closed 2 years ago

farzin-deriv commented 2 years ago

Adds support for pre-commit git hook which runs prettier on changed files.

Also, all files have been formatted using prettier.

farzin-deriv commented 2 years ago

I think we should stay unopinionated on style settings/choices as much as possible (like using pre-commit hooks or not) and provide only info on how to use the monorepo + multi-platform apps. I already made the mistake of putting a custom ESLint config, and I might go back on this decision. What do you think?

Personally, I think it’s a good idea to have them already set up and working inside the monorepo, I mean one of the goals of monorepo is to have share configs for all packages at the root level. And whoever is going to use this repo can simply change the config files to match their personal preferences, Like just changing something in tsconfig.json or other configuration files.

Additionally, this PR is formatting JSON files in native dirs (iOS/macOS) which I think would result in showing them as merge conflicts when updating to newer versions of React Native πŸ‘

Thank you, I will exclude them πŸ™‡πŸ»

mmazzarolo commented 2 years ago

That's fair πŸ‘
Let's do this, I'll keep this PR on hold until I complete the blog posts that I'm currently working on (about the repo). Then I'll come back to this and see if it fits with the vision and/or if it needs to be updated (I'll probably make some other tweaks to the repo in the meanwhile). Sounds good?

farzin-deriv commented 2 years ago

That's fair πŸ‘ Let's do this, I'll keep this PR on hold until I complete the blog posts that I'm currently working on (about the repo). Then I'll come back to this and see if it fits with the vision and/or if it needs to be updated (I'll probably make some other tweaks to the repo in the meanwhile). Sounds good?

Sure thing buddy πŸ™‡πŸ» Great repo by the way πŸ‘πŸ»