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

Add Prettier Dependency to Codebase #2849

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devbodaghe
Copy link
Contributor

Add Prettier and Format Existing Files

Summary

This pull request introduces Prettier to the project for code formatting and ensures all existing files adhere to the newly established formatting rules.

Key Changes:

  1. Added Prettier to the project dependencies.
  2. Created a .prettierrc configuration file with project-specific formatting rules.
  3. Updated the package.json to include formatting scripts:
    • format: Formats all files in the project.
    • format:check: Checks if files comply with Prettier formatting.
  4. Ran Prettier on all existing files to enforce consistent formatting.

Why This Is Needed

  • Establishes a uniform code style across the project.
  • Improves code readability and maintainability.
  • Simplifies collaboration by reducing style-based merge conflicts.

How to Test

  1. Install the updated dependencies:
    npm install
    
  2. Check formatting:
    npm run format
    
  3. Apply formatting (if needed):
    npm run format:check
    

@mshymon
Copy link
Contributor

mshymon commented Jan 13, 2025

As @vinkmeta suggested offline - let's get a stamp from a vendor on this.

I have one question - will this new updated formatting style be consistent with or different from the rest of the code base of WooCommerce / WordPress?

@devbodaghe
Copy link
Contributor Author

As @vinkmeta suggested offline - let's get a stamp from a vendor on this.

I have one question - will this new updated formatting style be consistent with or different from the rest of the code base of WooCommerce / WordPress?

It introduces consistency in the codebase for non php files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants