Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 643 Bytes

ESLINTCONFIG.MD

File metadata and controls

27 lines (17 loc) · 643 Bytes

Steps to Configure ESlint and Pre-commit Hooks in your local repository

Open Your Git bash and run the following commands

1.npx husky install
To add the .husky Directory

2.After that, navigate to the .husky directory which has been Added and add this piece of code to the pre-commit file:

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Run ESLint with --fix option to format code
npx eslint --fix .

# Run tests
npm run test


  1. chmod +x .husky/pre-commit
    To Make the pre-commit file executable

note: The above commands has to be run in the Git Bash, not Powershell Terminal