create-typescript-app icon indicating copy to clipboard operation
create-typescript-app copied to clipboard

fix(husky): use pnpx

Open xav-ie opened this issue 10 months ago • 0 comments

Defaulting to npx causes users to unexpectedly also have npx installed. It caused my commit staging to break.

PR Checklist

Overview

Simply replaces the npx lint-staged command to use pnpx lint-staged.

Please, let me know if I need to scale back my changes. I am trying to keep this PR minimal and just get the project working. It was not yet working for me with this dev environment:

{ ... }: {
  languages.javascript = {
    enable = true;
    # I should not have to enable `npm`, we use `pnpm` in this house!
    # npm.enable = true;
    pnpm.enable = true;
  };
}

I have a follow-up PR here: https://github.com/JoshuaKGoldberg/create-typescript-app/pull/1976 It goes "full-pnpx" because I don't think we should expect users to have both npx and pnpx installed. pnpx in my experience is also way faster since it copies from global store, just like Nix :)))))

It also seems similar in spirit to this PR: https://github.com/JoshuaKGoldberg/create-typescript-app/pull/1800

I am not sure why the "full-pnpx" move was not taken. Maybe I can learn why not, or just oversight.

🐢

xav-ie avatar Mar 09 '25 02:03 xav-ie