asyncFunction

August 4, 2026 ยท View on GitHub

Warns when declaring async functions and suggests using Effect values and Effect.gen for async control flow

PropertyValue
CategoryEffect-native
Default severityoff
FixableNo
Effect versionsv3, v4
Diagnostic codesTS377081
Language Service nameasyncFunction
Oxlint nameeffecttsgo/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"
  }
}