-
Notifications
You must be signed in to change notification settings - Fork 0
feature/lefthook #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feature/lefthook #417
Changes from all commits
a0fb12c
032e03f
5fb3201
c5be07c
17fcced
87cb011
9f21d85
1b3565e
0a87d76
9c4a770
c3cdd42
b99efa0
88d4013
f905239
1b6d7b0
f5a6b7e
e966aa2
a2d315a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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} | ||||||
|
||||||
| run: yarn --silent format {staged_files} | |
| run: npx prettier --write {staged_files} |
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
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).
| run: yarn --silent lint {staged_files} | |
| run: npx eslint --quiet --fix {staged_files} |
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
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.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,8 @@ | |
| "lint": "eslint \"src/**/*{.tsx, .ts}\" --quiet --fix", | ||
|
||
| "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", | ||
|
|
@@ -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", | ||
|
|
||
| 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; |
There was a problem hiding this comment.
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_textas a job field, tweaking parameters etc. Here's update:Show Command Outputview can be cleaned up usingexecution_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):
let me know what you think. I can work on this more and open a sub-pr if I find a better fix!
There was a problem hiding this comment.
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.