Browse by type
A wrapper around TypeScript-Go that builds the Effect Language Service, providing Effect-TS diagnostics and quick fixes. This project targets Effect V4 (codename: "smol") primarily and also Effect V3.
The setup of the TSGO version of the LSP can be performed via the command line interface:
# Interactive and guided setup for human friends
npx @effect/tsgo setup
# Non-interactive, for LLM friends
npx @effect/tsgo setup --help
This will guide you through the installation process, which includes:
1. Adding the @effect/tsgo dependency to your project.
2. Configuring your tsconfig.json to use the Effect Language Service plugin.
3. Adjusting plugin options to your preference.
4. Hinting at any additional editor configuration needed to ensure the LSP is active.
[!NOTE] At the moment, you still need a native TypeScript install alongside
@effect/tsgo:typescript>= 7 (e.g.typescript@latestortypescript@next) or an alias such as@typescript/native.effect-tsgo patchtriestypescript, then@typescript/native, and accepts--typescript-package <name>to try a custom package name first.
The Effect LSP doubles as a tool to perform type-aware linting of Effect code, and ships as well a way to emit additional Oxlint Type Aware rules.
Linting can occur either during the tsc typecheck phase (with the benefit of running typechecking only once and caching the output), or via a dedicated npx @effect/tsgo diagnostics --project tsconfig.json command (with typechecking occurring again), or via the Oxlint Patch.
See the Oxlint Setup guide for instructions on how to install and configure Oxlint with the Effect LSP.
When running in tsc mode, the Effect diagnostics are emitted as standard TypeScript diagnostics, and can be configured to affect the tsc exit code through the options ignoreEffectSuggestionsInTscExitCode, ignoreEffectWarningsInTscExitCode, and ignoreEffectErrorsInTscExitCode.
When running in dedicated diagnostics mode, the Effect diagnostics can be emitted in structured formats, which can be further processed by other tools.
The following target package versions are supported by @effect/tsgo@0.38.0:
| Component | Supported versions |
|---|---|
| TypeScript | 7.0.2, 7.1.0-dev.20260826.1 |
| Oxlint | 1.79.0, 1.80.0 |
| oxlint-tsgolint | 7.0.2001 |
Some diagnostics are off by default or have a default severity of suggestion, but you can always enable them or change their default severity in the plugin options.
| Rule | Description |
|---|---|
| Correctness Wrong, unsafe, or structurally invalid code patterns. | |
anyUnknownInErrorContext | Detects 'any' or 'unknown' types in Effect error or requirements channels |
classSelfMismatch | Ensures Self type parameter matches the class name in Context/Service/Tag/Schema classes |
duplicatePackage | Warns when multiple versions of an Effect-related package are detected in the program |
effectFnImplicitAny | Mirrors noImplicitAny for unannotated Effect.fn, Effect.fnUntraced, and Effect.fnUntracedEager callback parameters when no outer contextual function type exists. Requires TS's noImplicitAny: true |
floatingEffect | Detects Effect values that are neither yielded nor assigned |
floatingEffectInVitest | Detects Effects returned from non-Effect-aware Vitest callbacks |
genericEffectServices | Prevents services with type parameters that cannot be discriminated at runtime |
missingEffectContext | Detects Effect values with unhandled context requirements |
missingEffectError | Detects Effect values with unhandled error types |
missingLayerContext | Detects Layer values with unhandled context requirements |
missingReturnYieldStar | Suggests using return yield* for Effects that never succeed |
missingStarInYieldEffectGen | Detects bare yield (without *) inside Effect generator scopes |
nonObjectEffectServiceType | Ensures Effect.Service types are objects, not primitives |
outdatedApi | Detects usage of APIs that have been removed or renamed in Effect v4 |
overriddenSchemaConstructor | Prevents overriding constructors in Schema classes which breaks decoding behavior |
promiseInEffectSuccess | Detects Promise types in Effect success channels where they are not awaited |
schemaLiteralNonFinite | Reports statically known non-finite numbers passed to Schema literal constructors |
schemaOpaqueInstanceMember | Disallows instance members in classes extending Schema.Opaque |
| Anti-pattern Discouraged patterns that often lead to bugs or confusing behavior. | |
catchUnfailableEffect | Warns when using error handling on Effects that never fail |
effectFnIife | Effect.fn or Effect.fnUntraced is called as an IIFE; use Effect.gen instead |
effectGenUsesAdapter | Warns when using the deprecated adapter parameter in Effect.gen |
effectInFailure | Warns when an Effect is used inside an Effect failure channel |
effectInVoidSuccess | Detects nested Effects in void success channels that may cause unexecuted effects |
globalErrorInEffectCatch | Warns when catch callbacks return global Error type instead of typed errors |
globalErrorInEffectFailure | Warns when the global Error type is used in an Effect failure channel |
layerMergeAllWithDependencies | Detects interdependencies in Layer.mergeAll calls where one layer provides a service that another layer requires |
lazyEffect | Suggests avoiding exported zero-argument functions and service members that lazily return Effect or Stream values |
lazyPromiseInEffectSync | Warns when Effect.sync lazily returns a Promise instead of using an async Effect constructor |
leakingRequirements | Detects implementation services leaked in service methods |
multipleEffectProvide | Warns against chaining Effect.provide calls which can cause service lifecycle issues |
preferUnsafeConstructor | Suggests replacing Effect.runSync of a pure effect constructor with the synchronous *Unsafe variant exported by the same module |
returnEffectInGen | Warns when returning an Effect in a generator causes nested Effect<Effect<...>> |
runEffectInsideEffect | Suggests using Runtime or Effect.run*With methods instead of Effect.run* inside Effect contexts |
schemaSyncInEffect | Suggests using Effect-based Schema methods instead of sync methods inside Effect generators |
scopeInLayerEffect | Suggests using Layer.scoped instead of Layer.effect when Scope is in requirements |
strictEffectProvide | Warns when using Effect.provide with layers outside of application entry points |
tryCatchInEffectGen | Discourages try/catch in Effect generators in favor of Effect error handling |
unknownInEffectCatch | Warns when catch callbacks return unknown instead of typed errors |
| Effect-native Prefer Effect-native APIs and abstractions when available. | |
abortControllerInEffect | Warns when manually constructing AbortController inside Effect generators instead of using Effect.abortSignal |
asyncFunction | Warns when declaring async functions and suggests using Effect values and Effect.gen for async control flow |
cryptoRandomUUID | Warns when using crypto.randomUUID() outside Effect generators instead of the Effect Random module, which uses Effect-injected randomness rather than the crypto module behind the scenes |
cryptoRandomUUIDInEffect | Warns when using crypto.randomUUID() inside Effect generators instead of the Effect Random module, which uses Effect-injected randomness rather than the crypto module behind the scenes |
extendsNativeError | Warns when a class directly extends the native Error class |
browse all types & interfaces →