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

Feature request: Add Prettier #1726

Open
g547315 opened this issue Feb 19, 2024 · 3 comments · May be fixed by #1736
Open

Feature request: Add Prettier #1726

g547315 opened this issue Feb 19, 2024 · 3 comments · May be fixed by #1736

Comments

@g547315
Copy link

g547315 commented Feb 19, 2024

Problem
The code base, despite existing linting rules, lacks consistent formatting, leading to:

  • Reduced Readability: Inconsistent indentation, spacing, and wrapping make code harder to understand for all developers.
  • Manual Formatting Waste: Developers spend time manually formatting instead of focusing on logic and functionality.

Solution
Introduce Prettier as a code formatter base on the coding conventions to enforce consistent formatting, improving readability and freeing developer time for higher-level tasks

@g547315 g547315 changed the title Feature request: Codifying coding conventions Feature request: Add Prettier Feb 19, 2024
@cyberbuff cyberbuff linked a pull request Feb 25, 2024 that will close this issue
@cyberbuff
Copy link

Prettier conflicts with ESLint rules (operator-linebreak for instance). Looks like this cannot be done unless we are disabling some of the eslint rules. What should be the right approach for fixing this issue ?

@a3957273
Copy link
Member

I'd try to initially encourage Prettier to make as few changes as possible, due to existing large PRs out there. Merge conflicts could be a nightmare to sort out!

However, if we enforce prettier styling then I'm content for that to override eslint rules. I also work on https://github.com/gchq/Bailo, and that uses both Prettier & ESLint:

https://github.com/gchq/Bailo/blob/main/.prettierrc.json
https://github.com/gchq/Bailo/blob/main/backend/.eslintrc.json

And doesn't need to disable any rules for Prettier..

@cyberbuff
Copy link

Thanks a lot. This helps 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants