CyberChef icon indicating copy to clipboard operation
CyberChef copied to clipboard

Feature request: Add Prettier

Open g547315 opened this issue 1 year ago • 3 comments

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 avatar Feb 19 '24 16:02 g547315

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 ?

cyberbuff avatar Feb 25 '24 04:02 cyberbuff

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..

a3957273 avatar Feb 25 '24 18:02 a3957273

Thanks a lot. This helps 😄

cyberbuff avatar Feb 25 '24 20:02 cyberbuff