Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brena-odwyer thank you for your contribution, can you explain a little bit on this?
ling 1 and line 2?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw those lines while researching how to implement husky on stack overflow. The first line is a hashbang, it is like a special comment in Unix-like operating systems that specifies the interpreter for the script. The second line, from what I understand, is helping execute husky in different script locations. But I made a test on mine and tried commenting the second line (the same as the first) and it still worked the same way.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, I will try to run it on my side.


npx lint-staged
npm test

npx lint-staged
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.4",
"husky": "^7.0.4",
"husky": "^8.0.0",
"is-ci": "^3.0.1",
"jest": "^27.4.7",
"lint-staged": "^11.2.6",
Expand Down