fix(core): clean up Effect audit patterns (#35174)
This commit is contained in:
parent
08293e74a0
commit
1b88ff8d53
18 changed files with 118 additions and 62 deletions
6
script/ast-grep/no-json-parse-cast.yml
Normal file
6
script/ast-grep/no-json-parse-cast.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
id: no-json-parse-cast
|
||||
language: TypeScript
|
||||
message: Prefer Effect Schema JSON decoding over JSON.parse casts.
|
||||
severity: error
|
||||
rule:
|
||||
pattern: JSON.parse($INPUT) as $TYPE
|
||||
11
script/ast-grep/no-nested-effect-service-yield.yml
Normal file
11
script/ast-grep/no-nested-effect-service-yield.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
id: no-nested-effect-service-yield
|
||||
language: TypeScript
|
||||
message: Bind Effect services before calling methods instead of nesting service yields.
|
||||
severity: error
|
||||
rule:
|
||||
any:
|
||||
- pattern: (yield* $SERVICE).$METHOD($$$ARGS)
|
||||
- pattern: (yield* $SERVICE).$PROPERTY.$METHOD($$$ARGS)
|
||||
constraints:
|
||||
SERVICE:
|
||||
regex: \.Service$
|
||||
Loading…
Add table
Add a link
Reference in a new issue