Fix ast-grep tests and add no-countall-number test

- Update zod-namespace-import snapshot (semicolon fix)
- Add test cases for no-countall-number rule
- Update rule pattern to match method calls on objects

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
igm
2026-01-12 13:45:14 +08:00
parent 6fa4da1abb
commit 587e151fbd
5 changed files with 31 additions and 6 deletions

View File

@@ -4,5 +4,5 @@ severity: error
message: "Don't use countAll<number>() - use countAll() instead. PostgreSQL COUNT returns bigint (string), so the type annotation is misleading."
note: "Use Number() to convert the result if you need a number type."
rule:
pattern: countAll<number>()
fix: countAll()
pattern: $OBJ.countAll<number>()
fix: $OBJ.countAll()