toplenboren / simple-git-hooks

A simple git hooks manager for small projects
MIT License
1.32k stars 43 forks source link

Stand-alone config name #15

Closed ai closed 3 years ago

ai commented 3 years ago

I found that .simple-pre-commit.json (with dot) doesn’t work in the latest version.

➜ cat .simple-pre-commit.json 
{
  "simple-pre-commit": "npx lint-staged"
}

➜ npx simple-pre-commit      
Couldn't parse command! Please add command to package.json or .simple-pre-commit.json. See README.md for details
os.exit is not a function

➜ mv .simple-pre-commit.json simple-pre-commit.json  

➜ npx simple-pre-commit                            
Set pre commit hook: npx lint-staged

I personally prefer configs with ., but it is not a big deal. We can just change docs to promote only simple-pre-commit.json.

toplenboren commented 3 years ago

Whoa, gonna look through it, Thanks

toplenboren commented 3 years ago

Added an ablitiy to set either .simple-pre-commit.json or simple-pre-commit.json or simple-pre-commit key in package.json