Skip to content

Conversation

@faisalsiddique4400
Copy link
Contributor

feat(admin-ui): enforce consistent code formatting with Prettier and Husky #2100

Description

This PR introduces a standardized and automated code formatting and linting workflow to improve code quality and maintain consistency across the project.

Changes Introduced

  • Added .prettierrc with project-wide formatting rules.
  • Set up Husky (v9) with a pre-commit hook.
  • Configured lint-staged to:
    • Run ESLint with auto-fix on .js and .jsx files.
    • Format .js, .jsx, and .json files with Prettier.
  • Ensured all formatting checks run before each commit.

Verification Steps

  • ✅ Husky hooks are triggered correctly on git commit.
  • ✅ Prettier and ESLint auto-format staged files as expected.
  • ✅ No commit is possible with improperly formatted files.

Related Issue

Closes #2100

…Husky

Added Prettier configuration for consistent code style

Integrated Husky pre-commit hook to run lint-staged for automatic formatting and linting

Configured lint-staged to format and lint JavaScript and JSON files before commits

Improved code quality by automating formatting checks during development

Closes #2100
@mo-auto
Copy link
Member

mo-auto commented May 30, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

@mo-auto mo-auto added comp-admin-ui Component affected by issue or PR kind-feature Issue or PR is a new feature request labels May 30, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 2, 2025

Added instructions for using Prettier and Husky with lint-staged in the formatting section of README

Includes usage commands, pre-commit hook behavior
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 2, 2025

@duttarnab duttarnab merged commit 86bd415 into main Jun 2, 2025
8 checks passed
@duttarnab duttarnab deleted the admin-ui-issue-2100 branch June 2, 2025 07:48
@faisalsiddique4400 faisalsiddique4400 restored the admin-ui-issue-2100 branch June 2, 2025 09:10
@faisalsiddique4400 faisalsiddique4400 deleted the admin-ui-issue-2100 branch June 2, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-admin-ui Component affected by issue or PR kind-feature Issue or PR is a new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(admin-ui): enforce consistent code formatting with Prettier and Husky

3 participants