From 95d1151a1a2d3d5e5d54643a647833ace6ae7fda Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 31 Jan 2025 13:14:41 +0800 Subject: [PATCH] [repo] Update Husky installation for Yarn2 Yarn 2 does not run the `prepare` script. We need to switch to `postinstall` or `install`. Husky recommends using the postinstall. --- .husky/pre-commit | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index d2ae35e84b..5a182ef106 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" yarn lint-staged diff --git a/package.json b/package.json index 81c4b269f8..14a39b60d6 100644 --- a/package.json +++ b/package.json @@ -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": {