bahmutov / pre-git

Automatically install pre-commit / pre-push hooks in your git repo
168 stars 22 forks source link

Find the right package.json with pre-git config #106

Closed bahmutov closed 7 years ago

bahmutov commented 7 years ago

Imagine a monorepo with top level package.json and subprojects, each with its own package.json

If we setup pre-git in the root folder (same level as git root), and then try to commit from subfolder, it will grab closest package.json and will try to use it.

.git/
node_modules/
package.json  (with pre-git config)
  - projects/
     - foo/
         package.json (without pre-git config)

pre-git should prefer closest package.json file or find package.json with config object