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

[Code Quality] Execute Prettier for Code Formatting #4

Open
Saumya40-codes opened this issue Dec 16, 2024 · 3 comments
Open

[Code Quality] Execute Prettier for Code Formatting #4

Saumya40-codes opened this issue Dec 16, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request good-first-issue priority: high Needs to be solved, in some case should be solved first for other issue to move forward size: small

Comments

@Saumya40-codes
Copy link
Member

Saumya40-codes commented Dec 16, 2024

Ensure consistent code formatting across the repository by setting up and executing Prettier.

Approach:

  • Install Prettier as a dev dependency. Configure Prettier with a .prettierrc file.

    npm install --save-dev prettier
    
  • Create a file named .prettierrc in root path

    • A very minimalistic configuration we can go with is the following (i.e. the content of .prettierrc file)
      {
      "tabWidth": 2
      }
      
  • Format all existing codebase files.

    • Run:
      npx prettier --write .
      

This will make all the files we have follow a standard and appropriate indentation

Learn more about prettier from here

@Saumya40-codes Saumya40-codes added enhancement New feature or request good first issue Good for newcomers priority: low lower priority issue, if possible you can look for higher ones size: small good-first-issue priority: medium medium priority issue, needs to be solved but less signifiance than higher one priority: high Needs to be solved, in some case should be solved first for other issue to move forward and removed good first issue Good for newcomers priority: low lower priority issue, if possible you can look for higher ones priority: medium medium priority issue, needs to be solved but less signifiance than higher one labels Dec 16, 2024
@KushalXCoder
Copy link
Contributor

Can I work on this ?

@KushalXCoder
Copy link
Contributor

Also, one more thing, should I also add .prettierignore file which would contain node_modules, .env, and other files etc.

@Saumya40-codes
Copy link
Member Author

Also, one more thing, should I also add .prettierignore file which would contain node_modules, .env, and other files etc.

Yes, good catch. We wont be needing prettier for node_modules and .env files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good-first-issue priority: high Needs to be solved, in some case should be solved first for other issue to move forward size: small
Projects
None yet
Development

No branches or pull requests

2 participants