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

Implement Proper Linting with Prettier for Code Consistency #72

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SOUMITRO-SAHA
Copy link
Contributor

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.

@andrewpareles andrewpareles added the documentation Improvements or additions to documentation label Sep 30, 2024
@SOUMITRO-SAHA
Copy link
Contributor Author

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

@andrewpareles andrewpareles added wontfix This will not be worked on and removed documentation Improvements or additions to documentation labels Oct 17, 2024
@andrewpareles
Copy link
Contributor

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

@andrewpareles andrewpareles added the backlog We might come back to this later label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We might come back to this later wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants