void icon indicating copy to clipboard operation
void copied to clipboard

Implement Proper Linting with Prettier for Code Consistency

Open SOUMITRO-SAHA opened this issue 1 year ago • 1 comments

Implement Proper Linting with Prettier for Code Consistency

Issue #71

PR Description:

This pull request sets up proper linting and formatting using Prettier from scratch to ensure consistent code style and readability across the project.

Key Changes:

  • Implemented Prettier for consistent code formatting.
  • Configured .prettierrc to define formatting rules (e.g., spacing, quote style, trailing commas).
  • Added a format script (npm run format) to automatically format all files in the project according to Prettier rules.

Highlights:

  • Prettier will automatically format files on save (if integrated with your editor).
  • Running npm run format will format the entire codebase, ensuring consistent code style across all files.

Note: For now, pre-commit hooks have been disabled by Void team, so the pre-commit setup has been removed. However, consistency can still be ensured by saving files in an editor that supports Prettier or by running the npm run format command manually.

Future Pre-commit Hook Implementation:

If the Void team or anyone else are going to reintroduce pre-commit hooks in the future, they can easily do so by running lint-staged within the pre-commit script. This will automatically enforce linting before each commit, preventing inconsistent code from being committed.

Outcome: This setup ensures that all code follows the same formatting standards, improving the readability and maintainability of the project while allowing developers to manually format code whenever necessary.

SOUMITRO-SAHA avatar Sep 26 '24 07:09 SOUMITRO-SAHA

Hey @andrewpareles, could you clarify what needs to be done here?

SOUMITRO-SAHA avatar Oct 02 '24 07:10 SOUMITRO-SAHA

We prefer using the default JS/TS formatter, and not prettier. We might change this in the future.

andrewpareles avatar Oct 17 '24 22:10 andrewpareles

Not doing this right now!

andrewpareles avatar Jan 26 '25 03:01 andrewpareles