GithubHelp home page GithubHelp logo

toplenboren / simple-git-hooks Goto Github PK

View Code? Open in Web Editor NEW
1.2K 4.0 37.0 327 KB

A simple git hooks manager for small projects

License: MIT License

JavaScript 99.84% Shell 0.16%
hook git-hooks hooks-manager git pre-commit pre-push

simple-git-hooks's People

Contributors

3c1u avatar ai avatar bhanuprasadcherukuvada avatar ddialar avatar djaler avatar eugengedroyc avatar flugg avatar ilyasemenov avatar jesse-savary avatar jounqin avatar losadaem avatar motss avatar pustovalov avatar rivajunior avatar samydoesit avatar silvenon avatar tomeraberbach avatar toplenboren avatar valtlai avatar yokinist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

simple-git-hooks's Issues

Missing tag 2.8.1 here

Hi,

In npm latest version is 2.8.1, but here it's missing the tag to define what is new.

I guess is related with last PR accepted:

#81

Can't install with nodeLinker: pnpm

node:internal/fs/utils:351
    throw err;
    ^

Error: ENOENT: no such file or directory, stat '/project/node_modules/.store/simple-git-hooks-npm-2.8.1-284fd0e93b/package.json'
    at Object.statSync (node:fs:1695:3)
    at _getPackageJson (/project/node_modules/.store/simple-git-hooks-npm-2.8.1-284fd0e93b/node_modules/simple-git-hooks/simple-git-hooks.js:179:13)
    at checkSimpleGitHooksInDependencies (/project/node_modules/.store/simple-git-hooks-npm-2.8.1-284fd0e93b/node_modules/simple-git-hooks/simple-git-hooks.js:102:34)
    at postinstall (/project/node_modules/.store/simple-git-hooks-npm-2.8.1-284fd0e93b/node_modules/simple-git-hooks/postinstall.js:18:9)
    at Object.<anonymous> (/project/node_modules/.store/simple-git-hooks-npm-2.8.1-284fd0e93b/node_modules/simple-git-hooks/postinstall.js:27:1)
    at Module._compile (node:internal/modules/cjs/loader:1255:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
    at Module.load (node:internal/modules/cjs/loader:1113:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/project/node_modules/.store/simple-git-hooks-npm-2.8.1-284fd0e93b/package.json'
}

Node.js v20.2.0
Yarn 3
nodeLinker: pnpm

npm ci --production fails on simple-git-hooks

node: 'v14.15.4', npm: '7.19.0'

Hi

When I run npm ci the "prepare" script (which is running npx simple-git-hooks) runs without issues

npm ci

But when I run npm ci --production I'm prompted with this

npm ci --proudction

Which fails when I type y

Running npx simple-git-hooks doesn't throw any errors

Screenshot 2021-08-04 at 18 32 10

My package.json looks something like this

"dependencies": {...},
"scripts": {
  ...
  "prepare": "npx simple-git-hooks"
},
"simple-git-hooks": {
  "pre-commit": "npx lint-staged && npm run test",
  "pre-push": "npx tsc --project ./tsconfig.json --noEmit"
},

I'm curious if this is an issue with my setup, or with simple-git-hooks

Thanks.

Add explicit LICENSE file

package.license is not enough. You need to add a separate file.

It is required by law. Also, GitHub will see the license.

Stand-alone config name

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.

Issue with yarn2

Hello! Thanks for the lib. I tried migrate from husky4 to this solution and found a problem.

When I try to install this lib:

yarn add -D simple-git-hooks

I see in console the following message:

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 336ms
➤ YN0000: ┌ Link step
➤ YN0007: │ simple-git-hooks@npm:2.0.2 must be built because it never did before or the last one failed
➤ YN0009: │ simple-git-hooks@npm:2.0.2 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/15/zr9tfbrs1z9_5w9yzszys8vh0000gn/T/xfs-e4784d06/build.log)
➤ YN0009: │ simple-git-hooks@npm:2.0.2 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/15/zr9tfbrs1z9_5w9yzszys8vh0000gn/T/xfs-e4784d06/build.log)
➤ YN0000: └ Completed in 0s 391ms
➤ YN0000: Failed with errors in 0s 890ms

This is complete log:

# This file contains the result of Yarn building a package (simple-git-hooks@npm:2.0.2)
# Script name: postinstall

internal/fs/utils.js:307
    throw err;
    ^

Error: ENOENT: no such file or directory, stat '/Users/igorkamyshev/Code/Solid-Soda/scripts/.yarn/unplugged/simple-git-hooks-npm-2.0.2-48676c6cda/package.json'
    at Object.statSync (fs.js:1086:3)
    at NodeFS.statSync (/Users/igorkamyshev/Code/Solid-Soda/scripts/.pnp.js:7751:24)
    at makeCallSync.subPath.subPath (/Users/igorkamyshev/Code/Solid-Soda/scripts/.pnp.js:10325:26)
    at ZipOpenFS.makeCallSync (/Users/igorkamyshev/Code/Solid-Soda/scripts/.pnp.js:10861:26)
    at ZipOpenFS.statSync (/Users/igorkamyshev/Code/Solid-Soda/scripts/.pnp.js:10324:17)
    at VirtualFS.statSync (/Users/igorkamyshev/Code/Solid-Soda/scripts/.pnp.js:8120:24)
    at PosixFS.statSync (/Users/igorkamyshev/Code/Solid-Soda/scripts/.pnp.js:8120:24)
    at _getPackageJson (/Users/igorkamyshev/Code/Solid-Soda/scripts/.yarn/unplugged/simple-git-hooks-npm-2.0.2-48676c6cda/node_modules/simple-git-hooks/simple-git-hooks.js:134:13)
    at checkSimpleGitHooksInDependencies (/Users/igorkamyshev/Code/Solid-Soda/scripts/.yarn/unplugged/simple-git-hooks-npm-2.0.2-48676c6cda/node_modules/simple-git-hooks/simple-git-hooks.js:75:34)
    at postinstall (/Users/igorkamyshev/Code/Solid-Soda/scripts/.yarn/unplugged/simple-git-hooks-npm-2.0.2-48676c6cda/node_modules/simple-git-hooks/postinstall.js:15:9) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/Users/igorkamyshev/Code/Solid-Soda/scripts/.yarn/unplugged/simple-git-hooks-npm-2.0.2-48676c6cda/package.json'
}

I use yarn version 2.4.1.

Could you help me to find a solution, please?

removed hooks are not deleted

I see commit-msg hook is supported, but I tried like following and failed:

module.exports = {
  'pre-commit': 'npx lint-staged',
  'commit-msg': 'npx commitlint -e', // it will work
}

Allow array of hooks

It would be nice to have the ability to define multiple hook commands.
Probabily would need a modifaction in the _setHook function.
To append multiple shell commands with a ; or &&.

This would allow for something like:

.simple-git-hooks.js
module.exports = {
   ...require('shared-package-with-base-hooks'),
   'pre-commit': ['echo "1"', 'echo "2"', 'echo "3"']
}

shared-package-with-base-hooks -> entry.js
module.export = {
   'pre-commit': 'echo "base package"',
}

Expected functionality:
On pre-commit print:

base package
1
2
3

Hope this makes sense.

Ps, the ...require(....) would basically evaluate to:

module.exports = {
   'pre-commit': 'echo "base package"',
   'pre-commit': ['echo "1"', 'echo "2"', 'echo "3"']
}

So not sure if that's possible or not. As the second pre-commit probably overwrites the initial one? But there could be alternatives probably? One example alternative would be this StackOverflow

Package’s name

Now that the package is being renamed (#21), should we consider a shorter name? I found that the following are unused in npm:

  • hook-setter
  • set-hook(s)
  • add-hook(s)
  • install-hook(s)
  • hookful
  • hookize
  • hookish

For example, set-hooks would work well as a command: npx set-hooks. On the other hand, it would’t be so good property name in package.json.

How to skip?

How can I skip a pre-commit check by cli command?

Can't install with pnpm

node_modules/.pnpm/[email protected]/node_modules/simple-git-hooks: Running postinstall script, failed in 126ms
.../node_modules/simple-git-hooks postinstall$ node ./postinstall.js
│ internal/fs/utils.js:307
│     throw err;
│     ^
│ Error: ENOENT: no such file or directory, stat 'D:\Projects\vue-promise-dialogs\node_modules\.pnpm\[email protected]\package.json'
│     at Object.statSync (fs.js:1086:3)
│     at _getPackageJson (D:\Projects\vue-promise-dialogs\node_modules\.pnpm\[email protected]\node_modules\simple-git-hooks\simple-git-hooks.js:140:13)
│     at checkSimpleGitHooksInDependencies (D:\Projects\vue-promise-dialogs\node_modules\.pnpm\[email protected]\node_modules\simple-git-hooks\simple-git-hooks
│     at postinstall (D:\Projects\vue-promise-dialogs\node_modules\.pnpm\[email protected]\node_modules\simple-git-hooks\postinstall.js:15:9)
│     at Object.<anonymous> (D:\Projects\vue-promise-dialogs\node_modules\.pnpm\[email protected]\node_modules\simple-git-hooks\postinstall.js:24:1)
│     at Module._compile (internal/modules/cjs/loader.js:1063:30)
│     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
│     at Module.load (internal/modules/cjs/loader.js:928:32)
│     at Function.Module._load (internal/modules/cjs/loader.js:769:14)
│     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
│   errno: -4058,
│   syscall: 'stat',
│   code: 'ENOENT',
│   path: 'D:\\Projects\\vue-promise-dialogs\\node_modules\\.pnpm\\[email protected]\\package.json'
│ }
└─ Failed in 127ms
 ERROR  Command failed with exit code 1.
 ```

pnpm version: 5.18.7

Git hooks are not running after migrating from husky

It is not a bug but rather a documentation suggestion. We recently migrated from husky to simple-git-hooks which is nice and easy to setup so thank you for that. However we noticed that the hooks aren't running anymore.
After a deep investigation I noticed that the source of the issue was git configurations.
core.hooksPath was set to .husky and it needed to be $GIT_DIR/hooks
This would be solved by changing the core.hooksPath or deleting project and recloning it.
Since the library relies on default git configuration I think it would make sense to be mentioned in the documentation.
I would also like to know if you know a better way to solve this issue.

Thanks again

Doesn't work with git worktrees

I get the following errror

ENOENT: no such file or directory, open '/Users/niklaas/git/abc/def/.git/worktrees/<name of worktree>/hooks/pre-commit'

when running npx simple-pre-commit inside a git worktree.

完全无效

安装了,初始化了,一切配置按照官网来了。但是我之间commit 就像没有它一样,之间就commit,没有执行我需要的命令

Unable to get simple-git-hooks working with Prettier

Trying to replace Husky with simple-git-hooks in a create-react-app project as follows in package.json:

  "lint-staged": {
    "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
      "prettier --write"
    ]
  },
  "simple-git-hooks": {
    "pre-commit": "npx lint-staged"
  },

I am able to commit a properly formatted file i.e. no changes made by Prettier when the hook runs, however when I leave out a semi-colon to test Prettier formatting, I get a popup in VSCode saying "Git: [STARTED] Preparing..." with Show Command Output, Cancel, and Open Git Log buttons, then when I click Show Command Output I see the following:

> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
[STARTED] Preparing...
[SUCCESS] Preparing...
[STARTED] Running tasks...
[STARTED] Running tasks for src/**/*.{js,jsx,ts,tsx,json,css,scss,md}
[STARTED] prettier --write
[SUCCESS] prettier --write
[SUCCESS] Running tasks for src/**/*.{js,jsx,ts,tsx,json,css,scss,md}
[SUCCESS] Running tasks...
[STARTED] Applying modifications...
[FAILED] Prevented an empty git commit!
[STARTED] Reverting to original state because of errors...
[SUCCESS] Reverting to original state because of errors...
[STARTED] Cleaning up...
[SUCCESS] Cleaning up...

  ⚠ lint-staged prevented an empty git commit.
  Use the --allow-empty option to continue, or check your task configuration

npm ERR! code 1
npm ERR! path /Users/chris/Documents/Jobs/AFSCME/repos-legacy/afscme-cards
npm ERR! command failed
npm ERR! command sh -c lint-staged

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/chris/.npm/_logs/2021-04-29T06_37_56_082Z-debug.log

Any idea how to fix this so Prettier runs and the changes get added to the commit?

Missing step when migrating from husky v6

Stumbled upon this tiny package and am interested in using this due to its simplicity. However migrating from husky v6 is not as easy as it stated in the README, there is a missing step where you need to remove the entire .git/hooks folder because everything inside the folder are generated to always run husky.

# remove then run the setup command
$ rm -rf .git/hooks
$ npx simple-git-hooks

Improve docs

Here are small README.md changes according to my experience:

  1. Remove Why? subtitle and put features directly after the description
  2. Replace subjective benefits to facts. Lightweight → the size in node_modules (compare with husky?). Easy to install or Dead simple to use is hard to prove.
  3. People love honesty when you tell them a limit of your tool. It will be nice to have something like Where to use it / Where to not use it. For instance, “use it when you have a single pre-commit hook with lint-staged”, “do not use it if you change pre-commit hook often because X”
  4. Prepare docs for people, who do not know what is pre-commit hook. Add what is a reason to use it (ensure that everyone run linters/Prettier for the changed files) and lint to lint-staged since it is the best pair.

Use dependencies size in size table

According to husky 4→5 post husky 4 uses 1 MB of the size.

But in your table, it is only 50 KB. Seems like you are not using dependencies in size calculation. It will increase the size of husky 4 and pre-commit a lot. And it will be pretty fair since dependencies size is the main reason to avoid dependencies for small projects.

Reduce npm package

The small npm package size is one of the key features of this package. There is a reason to use every micro-optimization for art reasons.

For instance, adding and calling clean-publish instead of npm publish will remove devDependencies, lint-staged, etc from package.json.

Add `uninstall` script

We have postinstall to set .git/hooks/pre-commit, but we forgot about the uninstall script to remove the script on the simple-pre-commit unsinatlling

Provide a quiet param

In this way, we can update git hooks command in pre-commit hooks, like #34 says, but won't be botherd by logging.

Commit-msg does not seem to work

Hi, I am trying to migrate from Husky. I've added the following to my package.json:

"simple-git-hooks": { "pre-commit": "lint-staged", "commit-msg": "yarn commitlint -E --from=HEAD~1" },

I try to run:

$ git add .
$ git commit -m "testy: testy"

// works

BUT

yarn commitlint -E --from=HEAD~1"

`
⧗ input: testy: testy
✖ type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]

✖ found 1 problems, 0 warnings
`
To test, I have tried to echo a string in the commit message spot but I still don't see it. Is this user error or a package problem? Thank you.

Add windows compatibility to `npx simple-git-hooks` when configured by `.js` file

When setting the configuration from js file (simple-git-hooks.js or .simple-git-hooks.js)
the npx simple-git-hooks command executed on Windows 10 returns an error:

Line:       1
Char:      1
Error:      'module' is not defined
Source:  Microsoft JScript runtime error

The problem happens because for some reason Windows might use internal JS interpreter instead of node. This internal interpreter does not know what module is, thus throwing an error.

--

Possible workaround for now is to use configuration from package.json or simple-git-hooks.json files.

Also changing the default interpreter might help

Preserve existing git hooks path (core.hooksPath)

Hi 👋,

This is a feature request more than an issue.

My suggestion is to preserve the existing hooks path if it is defined in git config core.hooksPath, so this way it's not necessary to take into account this step when you're migrating from Husky, for instance. This is also an issue when you're switching branches with different git hooks setup and requires executing a script in preinstall or prepare like explained here to make it transparent for users.

What do you think?

Thanks

Remove Wiki and Projects

Since this project does not use Projects and Wiki, you can simplify the page by disabling them in the project settings

simple-git-hooks logo?

image

Does simple-git-hooks have its own logo?
I think it would be nice to have an icon in the file list for simple-git-hooks.json.

Presence of yarn.lock despite packageManager set to npm

I was looking through the repository and noticed something I wanted to clarify. In the package.json, the packageManager is set to npm. However, there's a yarn.lock file present in the project.

Is the yarn.lock file committed by mistake? If the project is solely relying on npm, would it be appropriate to remove the yarn.lock file to avoid any potential package management conflicts or confusion for contributors?

I appreciate your guidance on this matter, and thank you for all the work you've put into this package!

Add benchmark

Since people can’t move to husky 5 for a while, it is a great time to compare simple-pre-commit with husky 4 and put it to the docs.

Maybe you are also faster than husky 5?

Linux support is broken

"simple-git-hooks": "^2.0.1",
➜ npx simple-git-hooks
/usr/bin/env: ‘node\r’: No such file or directory

Do not remove git hooks

Hi. I use some custom commit-msg and prepare-commit-msg git hooks that grab data from a Jira system. And I use "simple-git-hooks" to run "lint-staged" on "pre-commit". The latest release of "simple-git-hooks" started removing "not-used git hooks" which breaks manually created git hooks. Could you please revert this change, or make it configurable maybe?

[Feature Request]Option for changing sh to bash

I'm using simple-git-hooks with VSCode. And all my environment variables are set in .bash_profile and .bashrc, including npm and npx. So when I use this, the default head of pre-commit file is #!/bin/sh, which cause a npx not found error when I commit in vscode. I really do wish there is an option about this. Thanks.

It should skip installation if no `.git` folder found

11:12:42.567 | $ simple-git-hooks && yarn-deduplicate --strategy fewer \|\| exit 0
11:12:42.655 | [ERROR], Was not able to set git hooks. Error: Error: ENOENT: no such file or directory, mkdir 'undefined/hooks/'

Fail to run `simple-git-hooks` with `npx` or `npm exec`

Issues

Running simple-git-hooks with npx or npm exec causes the installation to fail.

$ npx -y simple-git-hooks@latest

> [email protected] postinstall
> node ./postinstall.js

node:internal/fs/utils:344fy:simple-git-hooks: sill audit bulk request { 'simple-git-hooks': [ '2.7.0' ] }
    throw err;
    ^

Error: ENOENT: no such file or directory, stat '/Users/user/.npm/_npx/318daabbad435bbd/package.json'
    at Object.statSync (node:fs:1536:3)
    at _getPackageJson (/Users/user/.npm/_npx/318daabbad435bbd/node_modules/simple-git-hooks/simple-git-hooks.js:174:13)
    at checkSimpleGitHooksInDependencies (/Users/user/.npm/_npx/318daabbad435bbd/node_modules/simple-git-hooks/simple-git-hooks.js:102:34)
    at postinstall (/Users/user/.npm/_npx/318daabbad435bbd/node_modules/simple-git-hooks/postinstall.js:15:9)
    at Object.<anonymous> (/Users/user/.npm/_npx/318daabbad435bbd/node_modules/simple-git-hooks/postinstall.js:24:1)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/Users/user/.npm/_npx/318daabbad435bbd/package.json'
}

Node.js v17.2.0

Expected behavior

simple-git-hooks should run correctly using npx or npm exec locally.

Actual behavior

Running npx -y simple-git-hooks or npm exec -y -- simple-git-hooks@latest throws error.

Debugging details

$ npx -y envinfo

 System:
    OS: macOS 12.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 13.90 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.2.0
    npm: 8.1.4

Add support for `.cjs` configs

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/simple-git-hooks/simple-git-hooks.js b/node_modules/simple-git-hooks/simple-git-hooks.js
index 772b9a0..44cccbc 100644
--- a/node_modules/simple-git-hooks/simple-git-hooks.js
+++ b/node_modules/simple-git-hooks/simple-git-hooks.js
@@ -131,7 +131,9 @@ function _getConfig(projectRootPath) {
         throw TypeError("Check project root path! Expected a string, but got " + typeof projectRootPath)
     }
     const sources = [
+        () => _getConfigFromFile(projectRootPath, '.simple-git-hooks.cjs'),
         () => _getConfigFromFile(projectRootPath, '.simple-git-hooks.js'),
+        () => _getConfigFromFile(projectRootPath, 'simple-git-hooks.cjs'),
         () => _getConfigFromFile(projectRootPath, 'simple-git-hooks.js'),
         () => _getConfigFromFile(projectRootPath, '.simple-git-hooks.json'),
         () => _getConfigFromFile(projectRootPath, 'simple-git-hooks.json'),

This issue body was partially generated by patch-package.

Custom icon for config file in vscode-icons

Hey!

How about someone (who isn't horrible at drawing things, like myself) create a customized icon for the config files: .simple-git-hooks.cjs, .simple-git-hooks.js, simple-git-hooks.cjs, simple-git-hooks.js, .simple-git-hooks.json or simple-git-hooks.json?

Then it would be used with the amazing vscode-icons extension.

It's not a big deal, and it doesn't add any kind of new functionality, but it looks really nice! This is what I mean - below is a project of mine, and my vscode has vscode-icons installed:

image

.simple-git-hooks.json is the only file without a custom icon, it's showing the default JSON icon.

I thought about just opening a PR there and adding the files to use the default git icon but I think it should be different. Like the same icon with a little hook added to the lower right corner, maybe?

Like I said, I have zero talent for this kind of thing, but if anyone out there is willing to give it a shot... Here are the guidelines for creating an icon for the extension.

Thanks!

docs: Is "*" in readme means something?

Hey, just noticed that there is an asterisk after "Lightweight", I thought that it's a reference but didn't find anything relevant. Is it meant to be there or just a mistake?
image

migrate to native ESM

I'm using shared simple-git-hooks config, and using some dependencies which had migrated to ESM only, so it would be nice to support native ESM here.

Since it is a cli, so I suppose ESM only for this package would be fine.

Sharable configuration support

I'm still using husky@4 because we share husky config in all of my projects:

// .huskyrc.js
modue.exports = require('@1stg/husky-confog')

Other hook support

Maybe I made a mistake by suggesting only pre-commit hook support. We can add other hook support, but it will require the project to change the name (simple-hooks?).

We can have the same one-line config for pre-commit:

  "simple-hooks": "npx lint-staged"

And object for custom hooks:

  "simple-hooks": {
    "pre-push": "npx x"
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.