-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy patheslint.effect-ts-shared.mjs
More file actions
37 lines (36 loc) · 1.26 KB
/
Copy patheslint.effect-ts-shared.mjs
File metadata and controls
37 lines (36 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
export const effectMigrationWarnings = [
{
selector: "SwitchStatement",
message: "Effect migration blocker: use Match.exhaustive instead of switch."
},
{
selector: "TryStatement",
message: "Effect migration blocker: use Effect.try / Effect.catch* instead of try/catch."
},
{
selector: "AwaitExpression",
message: "Effect migration blocker: use Effect.gen / Effect.flatMap instead of await."
},
{
selector: "FunctionDeclaration[async=true], FunctionExpression[async=true], ArrowFunctionExpression[async=true]",
message: "Effect migration blocker: use Effect.gen / Effect.tryPromise instead of async functions."
},
{
selector: "NewExpression[callee.name='Promise']",
message: "Effect migration blocker: use Effect.async / Effect.tryPromise instead of new Promise."
},
{
selector: "CallExpression[callee.object.name='Promise']",
message: "Effect migration blocker: use Effect combinators instead of Promise.*."
}
]
export const effectPromiseRestrictedTypes = {
types: {
Promise: {
message: "Effect migration blocker: avoid Promise in public types. Use Effect.Effect<A, E, R>."
},
"Promise<*>": {
message: "Effect migration blocker: avoid Promise<T>. Use Effect.Effect<T, E, R>."
}
}
}