Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Prettier for Frontend Code Consistency #836

Merged
merged 1 commit into from
Mar 20, 2024
Merged

Add Prettier for Frontend Code Consistency #836

merged 1 commit into from
Mar 20, 2024

Conversation

konavivekramakrishna
Copy link
Contributor

This pr adds prettier as development dependency and adds the format script in package.json and formatted the Entire Frontend codebase using prettier for better code consistency

@konavivekramakrishna
Copy link
Contributor Author

konavivekramakrishna commented Mar 20, 2024

@mozzy11

Could you please review this PR? In this PR, I have added prettier as a development dependency and added a format script in package.json. Whenever contributors raise a PR, we can specify for them to run:

npm run format

from the frontend directory, i.e., OpenELIS-Global-2/frontend, so that everything remains clean and the formatting is consistent.
(only when their changes resides in frontend/)

I have only formatted the codebase, nothing else.

@konavivekramakrishna
Copy link
Contributor Author

@mozzy11

Once this PR is merged, I will address the build errors in #784
This PR essential for fixing the build errors in #784.

@mozzy11 mozzy11 merged commit b0e9c53 into I-TECH-UW:develop_3x Mar 20, 2024
5 checks passed
@atulyadav745
Copy link
Contributor

@mozzy11

Could you please review this PR? In this PR, I have added prettier as a development dependency and added a format script in package.json. Whenever contributors raise a PR, we can specify for them to run:

npm run format

from the frontend directory, i.e., OpenELIS-Global-2/frontend, so that everything remains clean and the formatting is consistent. (only when their changes resides in frontend/)

I have only formatted the codebase, nothing else.

Hey @konavivekramakrishna
Some organizations do not prefer to use formatting using prettier because it has its own limitaions.
I 'm not sure if we can use it in our codebase or not, I would appreciate if @mozzy11 can help us . Though i had come across an article why we don't use prettier. (https://antfu.me/posts/why-not-prettier)
Thank you!

@konavivekramakrishna
Copy link
Contributor Author

Hey @atulyadav745
Thanks for the suggestion,

but if you see our package.json we have already use packages related to preetier such as eslint-config-prettier and prettier-eslint the only problem we are not enforcing formatting and linting the errors

and coming to the limitations we can always come across the limitations it by modifying prettier config and prettierignore

@konavivekramakrishna konavivekramakrishna changed the title Formatted the Frontend Codebase Using Prettier Add Prettier for Frontend Code Consistency Mar 22, 2024
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.

3 participants