gchq / CyberChef

The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis

Home Page:https://gchq.github.io/CyberChef

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Add Prettier

g547315 opened this issue · 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

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 ?

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

Thanks a lot. This helps 😄