Implement Proper Linting with Prettier for Code Consistency
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
.prettierrcto 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 formatwill format the entire codebase, ensuring consistent code style across all files.
Note: For now,
pre-commithooks have been disabled by Void team, so thepre-commitsetup has been removed. However, consistency can still be ensured by saving files in an editor that supports Prettier or by running thenpm run formatcommand 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.
Hey @andrewpareles, could you clarify what needs to be done here?
We prefer using the default JS/TS formatter, and not prettier. We might change this in the future.
Not doing this right now!