asyncFunction
August 4, 2026 ยท View on GitHub
Warns when declaring async functions and suggests using Effect values and Effect.gen for async control flow
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | off |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377081 |
| Language Service name | asyncFunction |
| Oxlint name | effecttsgo/async-function |
Preview
export const preview = async () => {
/**
^^^^^^^^^^^^^ effecttsgo(async-function): This code declares an async function, consider representing this async control flow with Effect values and `Effect.gen`.
*/
await Promise.resolve(1)
}
Language Service Configuration
See the Language Service setup guide for installation instructions.
{
"$schema": "./node_modules/@effect/tsgo/schema.json",
"compilerOptions": {
"plugins": [
{
"name": "@effect/language-service",
"diagnosticSeverity": {
"asyncFunction": "warning"
}
}
]
}
}
Oxlint Configuration
See the Oxlint setup guide for installation and patching instructions.
{
"$schema": "./node_modules/@effect/tsgo/oxlint-schema.json",
"options": {
"typeAware": true
},
"plugins": ["effecttsgo"],
"rules": {
"effecttsgo/async-function": "warn"
}
}