بنقرة واحدة
fix-linting-types-on-pr
// Checks out a PR (including fork PRs), fixes all linting and TypeScript errors, then pushes the changes back. Use when asked to fix lint, types, or TS errors on a PR.
// Checks out a PR (including fork PRs), fixes all linting and TypeScript errors, then pushes the changes back. Use when asked to fix lint, types, or TS errors on a PR.
| name | fix-linting-types-on-pr |
| description | Checks out a PR (including fork PRs), fixes all linting and TypeScript errors, then pushes the changes back. Use when asked to fix lint, types, or TS errors on a PR. |
Checks out a PR, auto-fixes linting and TypeScript issues, and pushes the fixes.
If the user provided a PR number, use it directly. Otherwise ask for it.
Use gh pr checkout so it works for both fork and non-fork PRs:
gh pr checkout <PR_NUMBER>
This automatically sets up the correct remote tracking and switches to the PR branch, even when the PR comes from a fork.
yarn
Compiling first ensures TS declarations referenced by the linter are present:
yarn nx run-many -t compile
yarn lint
Run the TypeScript checker to surface remaining type errors:
yarn nx run-many -t check
Read the output carefully. Fix each type error manually by editing the relevant file(s). Common fixes:
any assignments that violate strict modeRe-run yarn nx run-many -t check after each batch of edits to confirm errors are resolved.
Stage only the files you changed:
git add <files-you-modified>
git commit -m "Maintenance: Fix linting and TypeScript errors"
Do not use git add -A — avoid accidentally staging unrelated files.
For fork PRs gh pr checkout sets up the correct upstream tracking. Push directly:
git push
gh pr checkout fails due to permissions on a fork, inform the user — they may need to grant write access to the fork or the maintainer must push directly.Write the changelog entry for a new minor or major Storybook release. Use when preparing a CHANGELOG.md entry for a X.Y.0 version.
Review, improve, rewrite, author, or plan Storybook documentation in /docs. Use this when asked to review docs, improve a page, rewrite documentation, draft new docs, or advise on docs strategy.
Creates a pull request following Storybook conventions. Use when creating PRs, opening pull requests, or submitting changes for review.
Upgrade Storybook to a specific version (canary or release). Use this when upgrading Storybook packages in an external app, reproduction, or test project.
Triggers a canary release for a Storybook PR. Use when the user wants to publish a canary version, create a pre-release, or test a PR via npm.
Label GitHub issues and PRs found during QA testing. Use when organizing QA findings with proper labels.