Skip to content

Commit a8e427a

Browse files
committed
feat: husky 7
1 parent 4e7c6dc commit a8e427a

37 files changed

+6334
-26958
lines changed

.github/ISSUE_TEMPLATE/issue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ assignees: ''
88
---
99

1010
**Troubleshoot**
11-
Before creating an issue, please check:
11+
- [ ] Before creating an issue, please check:
1212
https://typicode.github.io/husky/#/?id=troubleshoot
1313

1414
If you're migrating from husky 4, see:
15-
https://typicode.github.io/husky/#/?id=migrate-from-v4-to-v6
15+
https://typicode.github.io/husky/#/?id=migrate-from-v4-to-v7
1616

1717
**Context**
1818
Please describe your issue and provide some context:

.github/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# husky
2+
3+
[![Open Collective](https://opencollective.com/husky/all/badge.svg?label=financial+contributors)](https://opencollective.com/husky) [![](https://img.shields.io/npm/dm/husky.svg?style=flat)](https://www.npmjs.org/package/husky) [![Node.js CI](https://github.com/typicode/husky/workflows/Node.js%20CI/badge.svg)](https://github.com/typicode/husky/actions)
4+
5+
> Modern native Git hooks made easy
6+
7+
Husky improves your commits and more 🐶 _woof!_
8+
9+
# Install
10+
11+
```
12+
npm install husky -D
13+
```
14+
15+
# Usage
16+
17+
Edit `package.json > prepare` script and run it once:
18+
19+
```sh
20+
npm set-script prepare "husky install"
21+
npm run prepare
22+
```
23+
24+
Add a hook:
25+
26+
```sh
27+
npx husky add .husky/pre-commit "npm test"
28+
```
29+
30+
Make a commit:
31+
32+
```sh
33+
$ git commit -m "Keep calm and commit"
34+
# `npm test` will run
35+
```
36+
37+
_For more use cases (project in sub-directory, custom directory, CI support, ...), see documentation._
38+
39+
## Documentation
40+
41+
https://typicode.github.io/husky
42+
43+
**Important** Upgrading from v4 to v7 requires migrating previous config, please see the docs.
44+
45+
## Articles
46+
47+
- [Why husky has dropped conventional JS config](https://blog.typicode.com/husky-git-hooks-javascript-config/)
48+
- [Why husky doesn't autoinstall anymore](https://blog.typicode.com/husky-git-hooks-autoinstall/)
49+
50+
## License
51+
52+
MIT
53+
54+
## Companies
55+
56+
<a href="https://opencollective.com/husky/tiers/company/0/website"><img src="https://opencollective.com/husky/tiers/company/0/avatar.svg" height="80px"></a>
57+
<a href="https://opencollective.com/husky/tiers/company/1/website"><img src="https://opencollective.com/husky/tiers/company/1/avatar.svg" height="80px"></a>
58+
<a href="https://opencollective.com/husky/tiers/company/2/website"><img src="https://opencollective.com/husky/tiers/company/2/avatar.svg" height="80px"></a>
59+
<a href="https://opencollective.com/husky/tiers/company/3/website"><img src="https://opencollective.com/husky/tiers/company/3/avatar.svg" height="80px"></a>
60+
<a href="https://opencollective.com/husky/tiers/company/4/website"><img src="https://opencollective.com/husky/tiers/company/4/avatar.svg" height="80px"></a>
61+
<a href="https://opencollective.com/husky/tiers/company/5/website"><img src="https://opencollective.com/husky/tiers/company/5/avatar.svg" height="80px"></a>
62+
<a href="https://opencollective.com/husky/tiers/company/6/website"><img src="https://opencollective.com/husky/tiers/company/6/avatar.svg" height="80px"></a>
63+
64+
[Become a sponsor and have your logo here and in the docs](https://opencollective.com/husky/contribute/sponsor-9986/checkout)
65+
66+
The full list of Sponsors can be viewed in the docs, on Open Collective and on GitHub sponsors.

.github/workflows/node.js.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ jobs:
2525
run: npm i -g npm@7
2626
- run: npm ci --ignore-scripts
2727
- run: npm test
28+
- run: npm exec eslint . --ext .ts --ignore-path .gitignore
2829

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/commit-msg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/bin/sh
2-
3-
# shellcheck source=./_/husky.sh
42
. "$(dirname "$0")/_/husky.sh"
53

64
npx --no-install commitlint --edit "$1"

.husky/pre-commit

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/bin/sh
2-
3-
# shellcheck source=./_/husky.sh
42
. "$(dirname "$0")/_/husky.sh"
53

64
npm test

README.md

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# husky
2-
[![Open Collective](https://opencollective.com/husky/all/badge.svg?label=financial+contributors)](https://opencollective.com/husky) [![](https://img.shields.io/npm/dm/husky.svg?style=flat)](https://www.npmjs.org/package/husky) [![Node.js CI](https://github.com/typicode/husky/workflows/Node.js%20CI/badge.svg)](https://github.com/typicode/husky/actions)
32

43
> Modern native Git hooks made easy
54
@@ -13,52 +12,26 @@ npm install husky --save-dev
1312

1413
# Usage
1514

16-
Edit `package.json > prepare` script and run `prepare` script once:
15+
Edit `package.json > prepare` script and run it once:
1716

1817
```sh
19-
$ npm set-script prepare "husky install"
20-
$ npm run prepare
18+
npm set-script prepare "husky install"
19+
npm run prepare
2120
```
2221

2322
Add a hook:
2423

2524
```sh
26-
$ npx husky add .husky/pre-commit "npm test"
25+
npx husky add .husky/pre-commit "npm test"
2726
```
2827

2928
Make a commit:
3029

3130
```sh
3231
$ git commit -m "Keep calm and commit"
32+
# `npm test` will run
3333
```
3434

35-
For more use cases, see documentation.
36-
37-
## Documentation
35+
# Documentation
3836

3937
https://typicode.github.io/husky
40-
41-
__Important__ Upgrading from v4 to v6 requires additional steps, please see the docs.
42-
43-
## Articles
44-
45-
- [Why husky has dropped conventional JS config](https://blog.typicode.com/husky-git-hooks-javascript-config/)
46-
- [Why husky doesn't autoinstall anymore](https://blog.typicode.com/husky-git-hooks-autoinstall/)
47-
48-
## License
49-
50-
MIT
51-
52-
## Companies
53-
54-
<a href="https://opencollective.com/husky/tiers/company/0/website"><img src="https://opencollective.com/husky/tiers/company/0/avatar.svg" height="160px"></a>
55-
<a href="https://opencollective.com/husky/tiers/company/1/website"><img src="https://opencollective.com/husky/tiers/company/1/avatar.svg" height="160px"></a>
56-
<a href="https://opencollective.com/husky/tiers/company/2/website"><img src="https://opencollective.com/husky/tiers/company/2/avatar.svg" height="160px"></a>
57-
<a href="https://opencollective.com/husky/tiers/company/3/website"><img src="https://opencollective.com/husky/tiers/company/3/avatar.svg" height="80px"></a>
58-
<a href="https://opencollective.com/husky/tiers/company/4/website"><img src="https://opencollective.com/husky/tiers/company/4/avatar.svg" height="160px"></a>
59-
<a href="https://opencollective.com/husky/tiers/company/5/website"><img src="https://opencollective.com/husky/tiers/company/5/avatar.svg" height="160px"></a>
60-
<a href="https://opencollective.com/husky/tiers/company/6/website"><img src="https://opencollective.com/husky/tiers/company/6/avatar.svg" height="160px"></a>
61-
62-
[Become a sponsor and have your logo here and in the docs](https://opencollective.com/husky/contribute/sponsor-9986/checkout)
63-
64-
The full list of Sponsors can be viewed in the docs, on Open Collective and on GitHub sponsors.
File renamed without changes.

jest.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

lerna.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)