We still have comments in our pull requests for code formatting. We should avoid formatting code by hand and use tools that automatically formats code for us.
Add prettier config file to be used by the code editor to auto format code for us based on chosen rules.
Since the entire UI team is using vscode we decided to use the config in editor while writing code to auto-format on save. We are not adding it as part of the git workflow or a separate npm script to run before committing code yet. If required, for developers not using vscode, we will add a yarn run script to format code.
It is now part of eslint process. Mainly for two reasons
- If it's not part of build process developer would have to first save the file for linting changes before making actual code changes for bug/features
- Since prettier is integrated with eslint not fixing as part of build process will fail existing build
Because of this the PR is huge and it is a one time thing . Subsequent pull request for UI should automatically format code and will be substantially small on linting