sudo-suhas / lint-staged-multi-pkg

Example repo to demonstrate use of `lint-staged` with multi-pkg projects
MIT License
188 stars 19 forks source link

Not works, no output. #3

Closed DonikaV closed 5 years ago

DonikaV commented 5 years ago

root folder

"lerna": "3.11.0",
"husky": "^1.3.1"

lerna.json

"packages": [
    "pack1",
    "pack2"
  ],

pack 1 and pack2 have this in package.json in scripts

"precommit": "lint-staged"

With .lintstagedrc.yml

linters:
  "src/main/js/**/*.js":
    - "eslint src/main/js --fix"       
    - "prettier --print-width 120 --tab-width 4 --trailing-comma none --write src/main/js/**/*.js"                    
    - "git add"

After commit nothing. I mean no any messages/output

It works only from terminal. I mean i need run git add -A npm run -s precommit

But if i do normat flow for commit - nothing

sudo-suhas commented 5 years ago

What do you mean exactly by normal flow?

DonikaV commented 5 years ago

gid add -A commit -m "my message"

expected - hook executed, but nothing happens

sudo-suhas commented 5 years ago

Can you create a minimal git repo which demonstrates the issue?

sudo-suhas commented 5 years ago

From what I can tell, you have not configured husky correctly. See https://github.com/typicode/husky#upgrading-from-014

DonikaV commented 5 years ago

with this module it works https://www.npmjs.com/package/pre-commit

"scripts": {
"precommit": "lerna run --concurrency 1 --stream precommit"
}
"pre-commit": [
        "precommit"
    ],

i will check again your docs, thanks

sudo-suhas commented 5 years ago

The husky confirmation is the problem as I suspected. Closing this issue as we identified the cause.