Skip to content

Commit

Permalink
[repo] Update Husky installation for Yarn2
Browse files Browse the repository at this point in the history
Yarn 2 does not run the `prepare` script. We need to switch to
`postinstall` or `install`. Husky recommends using the postinstall.
  • Loading branch information
andrewnicols committed Jan 31, 2025
1 parent c9f7f90 commit 95d1151
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"mdxfix-all": "markdownlint-cli2 --config .markdownlint/mdx/fix/.markdownlint-cli2.cjs '{docs,general}/**/*.mdx' '*.mdx'",
"migrate": "scripts/wikimedia-fetch.mjs migrate",
"lint": "yarn mdlint-all; yarn mdxlint-all; yarn spell",
"prepare": "husky install",
"postinstall": "husky install",
"spell": "cspell '*.md' '*.mdx' '**/*.md' '**/*.mdx' 'docs/*.md' 'docs/*.mdx' 'docs/**/*.md' 'docs/**/*.mdx' 'general/*.md' 'general/*.mdx' 'general/**/*.md' 'general/**/*.mdx'"
},
"dependencies": {
Expand Down

0 comments on commit 95d1151

Please sign in to comment.