webi-installers icon indicating copy to clipboard operation
webi-installers copied to clipboard

Chore: Add `husky` to the repo

Open coolaj86 opened this issue 3 years ago • 3 comments

As per https://github.com/typicode/husky#install:

  1. Add husky (no transitive dependencies):
    npm install --save-dev husky
    
  2. Add a new prepare to package.json.scripts:
    npm set-script prepare "husky install"
    npm run prepare
    
  3. Create the new pre-commit script
    npx husky add .husky/pre-commit "npm run fmt"
    npx husky add .husky/pre-commit "npm run lint"
    git add .husky/pre-commit
    

coolaj86 avatar Aug 15 '22 19:08 coolaj86

Hi @coolaj86 , I'm trying to raise a PR, but when I try to commit my code it says fmt script is missing in package.json, could I get help on that ?

TarekArar99 avatar Aug 17 '22 10:08 TarekArar99

Those commands need to be set / updated.

npm set-script fmt "npm run prettier; npm run shfmt"
npm set-script jshint "npx [email protected] -c ./.jshintrc */*.js"
npm set-script shellcheck "shellcheck -s sh --exclude=SC2154,SC2034 -- */*.sh */*/*.sh"
npm set-script lint "npm run jshint; npm run shellcheck"

coolaj86 avatar Aug 17 '22 16:08 coolaj86

@coolaj86 I have raised a PR for this one. please check

ShyamMahajan avatar Sep 03 '22 06:09 ShyamMahajan

Closed via #515 and #659

coolaj86 avatar Oct 12 '23 04:10 coolaj86