You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/typescript-standards.mdc
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,29 @@ Exception: Empty handlers are acceptable ONLY when the rejection is an expected
130
130
Exception: Auto-load effects where infinite retry on persistent failure is undesirable — keep `== null` there and allow retry only via explicit user action.
131
131
</standard>
132
132
133
+
<standard id="file-structure">Component files (`.tsx`) and utility files (`.ts`) follow a consistent section ordering.
4. Main component (`export const Scene: React.FC<Props>`)
140
+
5. Sub-components (internal, non-exported)
141
+
6. Styles (`getStyles` / `cacheStyles`)
142
+
7. Helpers / utility functions — pure functions at the very end of the file
143
+
144
+
**Component body ordering:**
145
+
1. Props destructuring
146
+
2. Theme / styles (`useTheme`, `getStyles`)
147
+
3. State (`useState`)
148
+
4. Refs (`useRef`)
149
+
5. Selectors (`useSelector`, `useWatch`)
150
+
6. Derived values / `useMemo`
151
+
7. Handlers (`useHandler`)
152
+
8. Effects (`useEffect`, `useBackEvent`)
153
+
9. Return JSX
154
+
</standard>
155
+
133
156
</standards>
134
157
135
158
<lint-fix-patterns description="Common ESLint fix recipes for this project's config. Apply directly — do not search node_modules for types. The `rule` attribute maps to ESLint rule IDs for automatic matching by `lint-warnings.sh`.">
Copy file name to clipboardExpand all lines: .cursor/skills/im/SKILL.md
+16-12Lines changed: 16 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,26 +63,26 @@ If the task spans multiple repos, note the additional repos but implement in the
63
63
This script:
64
64
65
65
1. Runs `eslint --fix`
66
-
2. Shows any remaining lint findings grouped by rule
67
-
3. Outputs matching fix patterns from `~/.cursor/rules/typescript-standards.mdc`
68
-
4. Flags unmatched rules that need new patterns added
66
+
2. Detects files that will be "graduated" from the warning suppression list on commit, promoting their suppressed-rule warnings to errors in the output
67
+
3. Shows any remaining findings grouped by rule (with graduation promotions already applied)
68
+
4. Outputs matching fix patterns from `~/.cursor/rules/typescript-standards.mdc`
69
+
5. Flags unmatched rules that need new patterns added
69
70
70
71
If the script auto-fixes files or remaining findings exist:
71
72
72
-
1. Apply fixes for the remaining findings using the matched patterns in the output
73
-
2. For **unmatched rules**: After fixing, add a new `<pattern id="..." rule="...">` to `typescript-standards.mdc` so future occurrences have guidance
74
-
3. Commit the pre-existing lint changes separately:
73
+
1. Fix all reported **errors** first — these include graduation-promoted warnings that will block `lint-commit.sh` after the file is removed from the suppression list
74
+
2. Fix remaining **warnings** using the matched patterns in the output
75
+
3. For **unmatched rules**: After fixing, add a new `<pattern id="..." rule="...">` to `typescript-standards.mdc` so future occurrences have guidance
76
+
4. Commit the pre-existing lint changes separately:
75
77
```bash
76
78
~/.cursor/skills/lint-commit.sh -m "Fix lint warnings in <ComponentName>"<file1><file2> ...
77
79
```
78
80
79
81
**Architectural vs mechanical fixes**: If a pattern notes "architectural change" (e.g., `styled()` refactoring), flag to user rather than fixing inline — these changes have broader impact and may warrant separate discussion.
80
82
81
-
`lint-commit.sh` treats passed file arguments as the primary commit scope, auto-includes generated companion files like `src/locales/strings`, `eslint.config.mjs`, and snapshots, and reports any additional non-generated files it stages.
83
+
`lint-commit.sh` treats passed file arguments as the primary commit scope and only stages those files plus generated companion files (`src/locales/strings`, `eslint.config.mjs`, snapshots). It does not stage unrelated dirty files in the working tree.
82
84
83
85
This ensures the subsequent feature commit introduces zero pre-existing lint findings. This is the initial pass — if you discover additional files to modify during Step 3, the same check applies (see Step 3).
84
-
85
-
**Warning graduation (edge-react-gui)**: `edge-react-gui` has a suppression list in `eslint.config.mjs` that turns `explicit-function-return-type`, `strict-boolean-expressions`, `use-unknown-in-catch-callback-variable`, and `ban-ts-comment` to warning severity for ~300+ files. When `lint-commit.sh` commits a file, `update-eslint-warnings.ts` removes it from this list — "graduating" the file to full error enforcement. If a graduated file has pre-existing violations on lines you touched, `lint-commit.sh` Step 2b will block the commit. Running `lint-warnings.sh` here in Step 2 catches and fixes these issues before graduation occurs.
86
86
</step>
87
87
88
88
<stepid="3"name="Implementation">
@@ -138,9 +138,13 @@ Other repos only have `## Unreleased` — no staging distinction.
138
138
1.**Check for an open PR**: Run `gh pr view --json url,reviews 2>/dev/null` to determine if a PR exists and whether it has human review comments.
139
139
2.**If a PR exists with human review comments**, skip cleanup — rewriting history would lose review context. Note the pending cleanup in the retrospective.
140
140
3.**Otherwise (no PR, or PR with no human reviews)**, always perform ALL applicable cleanup automatically:
141
-
-**Fixup commits exist**: Autosquash with `GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash <base-branch>`. Do this immediately — never leave fixup commits unsquashed.
142
-
-**Structural issues** (add-then-remove cycles, misplaced changes, commits that should be squashed, CHANGELOG in intermediate commits): Use scripted `GIT_SEQUENCE_EDITOR` to drop, reorder, or squash commits, resolving conflicts as needed. Verify the final tree matches the pre-restructure state with `git diff`.
143
-
-**Git lock conflicts**: VSCode's built-in git integration may race with rebase operations, creating `.git/index.lock` files. Always run `rm -f .git/index.lock` before any `git rebase` command to prevent stalls. If a rebase step fails with "index.lock: File exists", remove the lock and `git rebase --continue`.
141
+
-**Fixup commits exist**: Autosquash with `rm -f .git/index.lock && GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash <base-branch>`. Do this immediately — never leave fixup commits unsquashed.
142
+
-**Reorder commits**: Use the companion script to reorder commits to the desired order. Hashes are oldest-to-newest:
The script handles index lock cleanup, awk-based reordering, and verifies the tree is unchanged afterward.
147
+
- **Structural issues** (add-then-remove cycles, misplaced changes, commits that should be squashed, CHANGELOG in intermediate commits): Use `reorder-commits.sh`for reordering. For squash/drop operations, use `rm -f .git/index.lock && GIT_SEQUENCE_EDITOR="..." git rebase -i <base-branch>` with an awk or sed script. Verify the final tree matches the pre-restructure state with `git diff`.
0 commit comments