Skip to content

Instantly share code, notes, and snippets.

@adamcegielka
Created November 3, 2023 13:11
Show Gist options
  • Save adamcegielka/f0ac4346271eed1b0583b182b906e6e8 to your computer and use it in GitHub Desktop.
Save adamcegielka/f0ac4346271eed1b0583b182b906e6e8 to your computer and use it in GitHub Desktop.

Husky ESLint - GitHub

Installation Husky

🔸 install npm install husky --save-dev
🔸 enable Git hooks npx husky install
🔸 to automatically have Git hooks enabled after install npm pkg set scripts.prepare="husky install"
🔸 package.json:

{
  "scripts": {
    "prepare": "husky install" 
  }
}

Add a hook

🔸 npx husky add .husky/pre-commit "npm test"
🔸 git add .husky/pre-commit

Make a commit

🔸 git commit -m "Keep calm and commit"


Tutorials:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment