Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Effect-TS/tsgo/llms.txt

Use this file to discover all available pages before exploring further.

The Effect Language Service ships with 52 diagnostics that catch correctness issues, anti-patterns, missing Effect-native APIs, and style inconsistencies in your Effect-TS code. Diagnostics appear inline in your editor just like TypeScript’s built-in type errors, and many include a quick fix you can apply in one keystroke.

Categories

Correctness

Wrong, unsafe, or structurally invalid code patterns. 14 rules.

Anti-patterns

Discouraged patterns that often lead to bugs or confusing behavior. 17 rules.

Effect-native

Prefer Effect-native APIs and abstractions when available. 5 rules.

Style

Cleanup, consistency, and idiomatic Effect code. 16 rules.

Severity levels

Every diagnostic has a default severity. You can override any severity in your plugin configuration.
SymbolSeverityBehavior
ErrorBlocks compilation; appears as a red underline in editors
⚠️WarningHighlighted in editors; does not block compilation by default
💡SuggestionShown as a hint or lightbulb; off by default in tsc CLI output
OffDisabled by default; must be explicitly enabled in diagnosticSeverity
Suggestion-level diagnostics do not affect the tsc exit code by default. You can control this with ignoreEffectSuggestionsInTscExitCode in your plugin options.

Quick fixes

Diagnostics marked with 🔧 include an automatic quick fix. In VS Code, place your cursor on the highlighted code and press Ctrl+. (or Cmd+. on macOS) to apply the fix. In Neovim, use your LSP code action binding.

V3 / V4 compatibility

Most diagnostics work with both Effect V3 and V4. Some rules are version-specific:
  • Rules marked V4 only: outdatedApi, serviceNotAsClass
  • Rules marked V3 only: nonObjectEffectServiceType, runEffectInsideEffect, schemaSyncInEffect, scopeInLayerEffect, schemaUnionOfLiterals, missingEffectServiceDependency
The language service detects your Effect version automatically and skips rules that do not apply.

Viewing diagnostics

Diagnostics appear as inline underlines in any editor connected to the Effect Language Service. Hover over an underlined symbol to see the diagnostic message and suggested fix. To see all diagnostics in a project at once via the command line, run tsc with your configured tsconfig.json:
npx tsc --noEmit
Effect diagnostics are reported alongside standard TypeScript errors because the language service plugin runs as part of the TypeScript compiler.

Configuring severity

Override the default severity of any rule using diagnosticSeverity in your tsconfig.json plugin configuration:
{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@effect/language-service",
        "diagnosticSeverity": {
          // Enable an off-by-default rule
          "anyUnknownInErrorContext": "warning",
          // Downgrade an error to a warning
          "floatingEffect": "warning",
          // Disable a rule entirely
          "effectMapVoid": "off"
        }
      }
    ]
  }
}
See the Diagnostic severity configuration page for the full reference and all accepted severity values.

Full diagnostics table

Correctness

| Diagnostic | Severity | Fix | V3 | V4 | |------------|----------|-----|----|----|| | anyUnknownInErrorContext | ➖ | | ✓ | ✓ | | classSelfMismatch | ❌ | 🔧 | ✓ | ✓ | | duplicatePackage | ⚠️ | | ✓ | ✓ | | effectFnImplicitAny | ❌ | | ✓ | ✓ | | floatingEffect | ❌ | | ✓ | ✓ | | genericEffectServices | ⚠️ | | ✓ | ✓ | | missingEffectContext | ❌ | | ✓ | ✓ | | missingEffectError | ❌ | 🔧 | ✓ | ✓ | | missingLayerContext | ❌ | | ✓ | ✓ | | missingReturnYieldStar | ❌ | 🔧 | ✓ | ✓ | | missingStarInYieldEffectGen | ❌ | 🔧 | ✓ | ✓ | | nonObjectEffectServiceType | ❌ | | ✓ | | | outdatedApi | ⚠️ | | | ✓ | | overriddenSchemaConstructor | ❌ | 🔧 | ✓ | ✓ |

Anti-patterns

| Diagnostic | Severity | Fix | V3 | V4 | |------------|----------|-----|----|----|| | catchUnfailableEffect | 💡 | | ✓ | ✓ | | effectFnIife | ⚠️ | 🔧 | ✓ | ✓ | | effectGenUsesAdapter | ⚠️ | | ✓ | ✓ | | effectInFailure | ⚠️ | | ✓ | ✓ | | effectInVoidSuccess | ⚠️ | | ✓ | ✓ | | globalErrorInEffectCatch | ⚠️ | | ✓ | ✓ | | globalErrorInEffectFailure | ⚠️ | | ✓ | ✓ | | layerMergeAllWithDependencies | ⚠️ | 🔧 | ✓ | ✓ | | leakingRequirements | 💡 | | ✓ | ✓ | | multipleEffectProvide | ⚠️ | 🔧 | ✓ | ✓ | | returnEffectInGen | 💡 | 🔧 | ✓ | ✓ | | runEffectInsideEffect | 💡 | 🔧 | ✓ | | | schemaSyncInEffect | 💡 | | ✓ | | | scopeInLayerEffect | ⚠️ | 🔧 | ✓ | | | strictEffectProvide | ➖ | | ✓ | ✓ | | tryCatchInEffectGen | 💡 | | ✓ | ✓ | | unknownInEffectCatch | ⚠️ | | ✓ | ✓ |

Effect-native

| Diagnostic | Severity | Fix | V3 | V4 | |------------|----------|-----|----|----|| | extendsNativeError | ➖ | | ✓ | ✓ | | globalFetch | ➖ | | ✓ | ✓ | | instanceOfSchema | ➖ | 🔧 | ✓ | ✓ | | nodeBuiltinImport | ➖ | | ✓ | ✓ | | preferSchemaOverJson | 💡 | | ✓ | ✓ |

Style

| Diagnostic | Severity | Fix | V3 | V4 | |------------|----------|-----|----|----|| | catchAllToMapError | 💡 | 🔧 | ✓ | ✓ | | deterministicKeys | ➖ | 🔧 | ✓ | ✓ | | effectFnOpportunity | 💡 | 🔧 | ✓ | ✓ | | effectMapVoid | 💡 | 🔧 | ✓ | ✓ | | effectSucceedWithVoid | 💡 | 🔧 | ✓ | ✓ | | missedPipeableOpportunity | ➖ | 🔧 | ✓ | ✓ | | missingEffectServiceDependency | ➖ | | ✓ | | | redundantSchemaTagIdentifier | 💡 | 🔧 | ✓ | ✓ | | schemaStructWithTag | 💡 | 🔧 | ✓ | ✓ | | schemaUnionOfLiterals | ➖ | 🔧 | ✓ | | | serviceNotAsClass | ➖ | 🔧 | | ✓ | | strictBooleanExpressions | ➖ | | ✓ | ✓ | | unnecessaryEffectGen | 💡 | 🔧 | ✓ | ✓ | | unnecessaryFailYieldableError | 💡 | 🔧 | ✓ | ✓ | | unnecessaryPipe | 💡 | 🔧 | ✓ | ✓ | | unnecessaryPipeChain | 💡 | 🔧 | ✓ | ✓ |

Build docs developers (and LLMs) love