Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
21 changes: 21 additions & 0 deletions lefthook.yml
Copy link
Collaborator

Choose a reason for hiding this comment

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

I ran a bunch of experiments (switching commands with npx, adding fail_text as a job field, tweaking parameters etc. Here's update:

  • for today's work, I wasn't able to fully fix vscode GUI popup readability issue. I did get the popup to show real text instead of empty lines, but it still feels a bit misleading.
  • good news: the vscode Show Command Output view can be cleaned up using execution_info, this removes the extra blocks and special characters. Now the outputs looks much better.

these are the changes in this file that seemed useful during testing (I didn't submit a sub-pr since the changes are small and not yet optimal):

output:
    - summary
    - failure
    - execution_info
pre-commit:
    ...keep unchanged...

let me know what you think. I can work on this more and open a sub-pr if I find a better fix!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for working on this! I don't feel precious about this branch and I'm also fine to walk away from this feature if it's taking a lot of time or energy, I don' think it's high priority.

Feel free to commit to this branch or open new branches.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
output:
- summary
- failure
pre-commit:
parallel: true
jobs:
- name: format
glob: "**/*.{ts,tsx}"
run: yarn --silent format {staged_files}
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The format job passes {staged_files} but yarn format is defined as prettier "src/**/*{.tsx, .ts}" --write, so this will still format all TS/TSX under src on every commit. Combined with stage_fixed: true, this can stage unrelated files that weren’t part of the commit. Consider changing the hook to run prettier against {staged_files} directly (or add a dedicated format:staged script that doesn’t include a hard-coded glob).

Suggested change
run: yarn --silent format {staged_files}
run: npx prettier --write {staged_files}

Copilot uses AI. Check for mistakes.
stage_fixed: true

- name: lint
glob: "**/*.{ts,tsx}"
run: yarn --silent lint {staged_files}
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Same issue as format: yarn lint is defined as eslint "src/**/*{.tsx, .ts}" --quiet --fix, so {staged_files} won’t limit the run to staged files. With --fix + stage_fixed: true, this can modify and stage a large set of unrelated files. Consider updating the hook to run eslint only on {staged_files} (or add a lint:staged script without the hard-coded glob).

Suggested change
run: yarn --silent lint {staged_files}
run: npx eslint --quiet --fix {staged_files}

Copilot uses AI. Check for mistakes.
stage_fixed: true
Comment on lines +5 to +15
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

parallel: true allows format (prettier --write) and lint (eslint --fix) to run concurrently against the same files. Since both jobs can rewrite the same staged files and both use stage_fixed: true, this can lead to nondeterministic results or file write races. Consider running these jobs sequentially (set parallel: false) or avoid having two concurrent fixers touching the same files.

Copilot uses AI. Check for mistakes.

- name: typecheck
run: yarn --silent typeCheck --pretty false

- name: test
run: yarn --silent test
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"lint": "eslint \"src/**/*{.tsx, .ts}\" --quiet --fix",
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The glob pattern in the lint script has a space before the file extensions which may not match files correctly. It should be \"src/**/*.{tsx,ts}\" without spaces around the comma.

Copilot uses AI. Check for mistakes.
"test": "vitest run",
"dev": "npx concurrently \"npx netlify-cms-proxy-server\" \"npm start -- --progress\"",
"typeCheck": "npx tsc -noEmit"
"typeCheck": "tsc --noEmit",
"prepare": "lefthook install"
},
"devDependencies": {
"@eslint/js": "^9.38.0",
Expand All @@ -74,6 +75,7 @@
"gatsby-plugin-postcss": "^6.13.1",
"globals": "^16.4.0",
"jiti": "^2.6.1",
"lefthook": "^2.0.15",
"netlify-cli": "^17.15.7",
"postcss": "^8.4.35",
"prettier": "^3.6.2",
Expand Down
12 changes: 6 additions & 6 deletions src/hooks/useWidthBreakpoint.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { PHONE_BREAKPOINT, TABLET_BREAKPOINT } from "../constants";
import useWindowWidth from "./useWindowWidth";

export const useMaxWidthBreakpoint = (
breakpoint: number
): boolean => {
export const useMaxWidthBreakpoint = (breakpoint: number): boolean => {
const windowWidth = useWindowWidth();
return windowWidth < breakpoint
return windowWidth < breakpoint;
};

export const useMobileBreakpoint = () => useMaxWidthBreakpoint(PHONE_BREAKPOINT);
export const useTabletBreakpoint = () => useMaxWidthBreakpoint(TABLET_BREAKPOINT);
export const useMobileBreakpoint = () =>
useMaxWidthBreakpoint(PHONE_BREAKPOINT);
export const useTabletBreakpoint = () =>
useMaxWidthBreakpoint(TABLET_BREAKPOINT);

export default useMaxWidthBreakpoint;
66 changes: 66 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13415,6 +13415,72 @@ lazystream@^1.0.0:
dependencies:
readable-stream "^2.0.5"

lefthook-darwin-arm64@2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook-darwin-arm64/-/lefthook-darwin-arm64-2.0.15.tgz#21c2aac653e9ad4dbd928c95bc1622825673d69e"
integrity sha512-ygAqG/NzOgY9bEiqeQtiOmCRTtp9AmOd3eyrpEaSrRB9V9f3RHRgWDrWbde9BiHSsCzcbeY9/X2NuKZ69eUsNA==

lefthook-darwin-x64@2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook-darwin-x64/-/lefthook-darwin-x64-2.0.15.tgz#24d18d5062fb7de19c7f11e531060089d9826e75"
integrity sha512-3wA30CzdSL5MFKD6dk7v8BMq7ScWQivpLbmIn3Pv67AaBavN57N/hcdGqOFnDDFI5WazVwDY7UqDfMIk5HZjEA==

lefthook-freebsd-arm64@2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook-freebsd-arm64/-/lefthook-freebsd-arm64-2.0.15.tgz#c3e53d484c58641c84fd010a164b7560a5d8fc66"
integrity sha512-FbYBBLVbX8BjdO+icN1t/pC3TOW3FAvTKv/zggBKNihv6jHNn/3s/0j2xIS0k0Pw9oOE7MVmEni3qp2j5vqHrQ==

lefthook-freebsd-x64@2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook-freebsd-x64/-/lefthook-freebsd-x64-2.0.15.tgz#0fa903beb0d340c99d5eb400e2090d3b6da1e63b"
integrity sha512-udHMjh1E8TfC0Z7Y249XZMATJOyj1Jxlj9JoEinkoBvAsePFKDEQg5teuXuTGhjsHYpqVekfSvLNNfHKUUbbjw==

lefthook-linux-arm64@2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook-linux-arm64/-/lefthook-linux-arm64-2.0.15.tgz#9da1bbc60ef07034e69c715acedf8d48bfc6768e"
integrity sha512-1HAPmdYhfcOlubv63sTnWtW2rFuC+kT1MvC3JvdrS5V6zrOImbBSnYZMJX/Dd3w4pm0x2ZJb9T+uef8a0jUQkg==

lefthook-linux-x64@2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook-linux-x64/-/lefthook-linux-x64-2.0.15.tgz#b12aebd93fcf11f521dc5e40d9b7a2dece96b17a"
integrity sha512-Pho87mlNFH47zc4fPKzQSp8q9sWfIFW/KMMZfx/HZNmX25aUUTOqMyRwaXxtdAo/hNJ9FX4JeuZWq9Y3iyM5VA==

lefthook-openbsd-arm64@2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook-openbsd-arm64/-/lefthook-openbsd-arm64-2.0.15.tgz#412dedf52f9f5b7925abe7b4bafc807cabde577e"
integrity sha512-pet03Edlj1QeFUgxcIK1xu8CeZA+ejYplvPgdfe//69+vQFGSDaEx3H2mVx8RqzWfmMbijM2/WfkZXR2EVw3bw==

lefthook-openbsd-x64@2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook-openbsd-x64/-/lefthook-openbsd-x64-2.0.15.tgz#a98ea91d40517d1233dd417a0ea9b0fda9f8201d"
integrity sha512-i+a364CcSAeIO5wQzLMHsthHt/v6n3XwhKmRq/VBzPOUv9KutNeF55yCE/6lvuvzwxpdEfBjh6cXPERC0yp98w==

lefthook-windows-arm64@2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook-windows-arm64/-/lefthook-windows-arm64-2.0.15.tgz#3eab319ca7a7a96685056e37a74b106853e30a97"
integrity sha512-69u5GdVOT4QIxc2TK5ce0cTXLzwB55Pk9ZnnJNFf1XsyZTGcg9bUWYYTyD12CIIXbVTa0RVXIIrbU9UgP8O1AQ==

lefthook-windows-x64@2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook-windows-x64/-/lefthook-windows-x64-2.0.15.tgz#e379f4266cc03b292873fb988ad9f922d47df430"
integrity sha512-/zYEndCUgj8XK+4wvLYLRk3AcfKU6zWf2GHx+tcZ4K2bLaQdej4m+OqmQsVpUlF8N2tN9hfwlj1D50uz75LUuQ==

lefthook@^2.0.15:
version "2.0.15"
resolved "https://registry.yarnpkg.com/lefthook/-/lefthook-2.0.15.tgz#e74d16135861dd8d852452fa43a469dfb474f3ea"
integrity sha512-sl5rePO6UUOLKp6Ci+MMKOc86zicBaPUCvSw2Cq4gCAgTmxpxhIjhz7LOu2ObYerVRPpTq3gvzPTjI71UotjnA==
optionalDependencies:
lefthook-darwin-arm64 "2.0.15"
lefthook-darwin-x64 "2.0.15"
lefthook-freebsd-arm64 "2.0.15"
lefthook-freebsd-x64 "2.0.15"
lefthook-linux-arm64 "2.0.15"
lefthook-linux-x64 "2.0.15"
lefthook-openbsd-arm64 "2.0.15"
lefthook-openbsd-x64 "2.0.15"
lefthook-windows-arm64 "2.0.15"
lefthook-windows-x64 "2.0.15"

lerc@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lerc/-/lerc-3.0.0.tgz#36f36fbd4ba46f0abf4833799fff2e7d6865f5cb"
Expand Down