Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add ESLint pre-commit hook to enforce code quality #6480

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

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

Conversation

kgarg1
Copy link

@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.

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.

3 participants