Skip to content

Conversation

kgarg1
Copy link
Contributor

@kgarg1 kgarg1 commented Apr 23, 2025

Summary

This pull request introduces a pre-commit hook that uses Husky to automatically run ESLint on staged files before each commit. The goal is to enforce consistent code quality and catch potential issues early in the development process.

Changes

Added a pre-commit hook using Husky in the .husky/ directory.
Updated package.json to include the necessary scripts for running ESLint.
Fixed existing ESLint issues to ensure compliance with the project’s style guide.

Motivation

By integrating this pre-commit hook, we aim to:
Enforce consistent code quality by automatically linting code before every commit.
Reduce the risk of committing code that doesn't adhere to the coding standards.
Ensure uniform code formatting across the team by catching issues before they are committed.

How to Test

Make a code change in any JavaScript file.
Stage the changes using git add .
Commit the changes using git commit.
The pre-commit hook will automatically run ESLint on the staged files.
If any linting issues are found, the commit will fail, and you’ll need to fix the issues before proceeding.

Additional Information

The pre-commit hook only checks the staged files and runs ESLint on them.
If no issues are found, the commit will proceed normally.

Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedhusky@​9.1.71001005982100

View full report

@wesleytodd
Copy link
Member

Unfortunately we need to migrate a lot of code before we can do this. Also there is an o going conversation on how we want to fix the linking going forward. I won't close this, but also it might sit for a while.

@shivarm
Copy link
Contributor

shivarm commented Aug 13, 2025

@wesleytodd I implement a fix #6644 which also solve the same problem using single script npm run lint:fix

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

Successfully merging this pull request may close these issues.

4 participants