Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: effect-ast-analyzer
|
||||
description: Run the Effect-TS AST analyzer to check for anti-patterns in local files.
|
||||
---
|
||||
|
||||
# Effect AST Analyzer
|
||||
|
||||
You can use the local Effect AST Analyzer to check any TypeScript file for Effect anti-patterns.
|
||||
This is highly recommended before finalizing any complex changes to ensure you haven't introduced things like floating promises, bad error handling, or generic try/catch blocks.
|
||||
|
||||
To run the analyzer on a file, use the Bash tool:
|
||||
|
||||
```bash
|
||||
./node_modules/.bin/effect-patterns-check path/to/your/file.ts
|
||||
```
|
||||
|
||||
If it returns warnings or errors, you MUST fix them before considering your task complete.
|
||||
|
||||
## How it works
|
||||
It parses the local TypeScript AST and checks against over 50 specific Effect-TS rules, like:
|
||||
- `try-catch-in-effect`: Ensure `Effect.try` is used instead of `try/catch`
|
||||
- `async-await`: Ensure `Effect.gen` is used instead of `async`/`await`
|
||||
- `missing-error-channel`: Ensure typed errors are propagated
|
||||
|
||||
Always run this when refactoring or creating new Effect code!
|
||||
Reference in New Issue
Block a user