Commit 5a30fe4
authored
Fix claude imports. (tldraw#7161)
Our claude config has a hook set to run prettier on
`Edit|MultiEdit|Write`. This causes issues with imports as it always
does the import first, then writes (which runs prettier and removes the
unused import), only then it adds the usage.
This PR uses an alternative. What if we only trigger prettier on `Stop`
event, which triggers when claude is done. Think it wont trigger if
claude gets interrupted by the user.
Worth a try, can always revert.
### Change type
- [x] `other`
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Switches the Claude hook to run Prettier on Stop, formatting only
changed files detected by git diff.
>
> - **Config (`.claude/settings.json`)**:
> - Switch hook from `PostToolUse` to `Stop`.
> - Update Prettier command to format only changed files (`git diff
--name-only --diff-filter=ACMR | grep -E '\.(ts|tsx|js|jsx|json|md)$' |
xargs -r yarn run -T prettier --write`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2ff3d46. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 6230dc7 commit 5a30fe4
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | | - | |
| 8 | + | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
0 commit comments