MCPcopy Create free account
hub / github.com/Effect-TS/tsgo

github.com/Effect-TS/tsgo @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
4,028 symbols 9,305 edges 867 files ⚖ MIT 1,827 documented · 45% updated 8d ago@effect/tsgo@0.36.5 · 2026-08-15★ 22765 open issues

Browse by type

Functions 2,947 Types & classes 1,081
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Effect Language Service (TypeScript-Go)

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.

Installation

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@latest or typescript@next) or an alias such as @typescript/native. effect-tsgo patch tries typescript, then @typescript/native, and accepts --typescript-package <name> to try a custom package name first.

LSP-based linter

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.

Supported Package Versions

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

Diagnostic Status

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.

RuleDescription
Correctness Wrong, unsafe, or structurally invalid code patterns.
anyUnknownInErrorContextDetects 'any' or 'unknown' types in Effect error or requirements channels
classSelfMismatchEnsures Self type parameter matches the class name in Context/Service/Tag/Schema classes
duplicatePackageWarns when multiple versions of an Effect-related package are detected in the program
effectFnImplicitAnyMirrors noImplicitAny for unannotated Effect.fn, Effect.fnUntraced, and Effect.fnUntracedEager callback parameters when no outer contextual function type exists. Requires TS's noImplicitAny: true
floatingEffectDetects Effect values that are neither yielded nor assigned
floatingEffectInVitestDetects Effects returned from non-Effect-aware Vitest callbacks
genericEffectServicesPrevents services with type parameters that cannot be discriminated at runtime
missingEffectContextDetects Effect values with unhandled context requirements
missingEffectErrorDetects Effect values with unhandled error types
missingLayerContextDetects Layer values with unhandled context requirements
missingReturnYieldStarSuggests using return yield* for Effects that never succeed
missingStarInYieldEffectGenDetects bare yield (without *) inside Effect generator scopes
nonObjectEffectServiceTypeEnsures Effect.Service types are objects, not primitives
outdatedApiDetects usage of APIs that have been removed or renamed in Effect v4
overriddenSchemaConstructorPrevents overriding constructors in Schema classes which breaks decoding behavior
promiseInEffectSuccessDetects Promise types in Effect success channels where they are not awaited
schemaLiteralNonFiniteReports statically known non-finite numbers passed to Schema literal constructors
schemaOpaqueInstanceMemberDisallows instance members in classes extending Schema.Opaque
Anti-pattern Discouraged patterns that often lead to bugs or confusing behavior.
catchUnfailableEffectWarns when using error handling on Effects that never fail
effectFnIifeEffect.fn or Effect.fnUntraced is called as an IIFE; use Effect.gen instead
effectGenUsesAdapterWarns when using the deprecated adapter parameter in Effect.gen
effectInFailureWarns when an Effect is used inside an Effect failure channel
effectInVoidSuccessDetects nested Effects in void success channels that may cause unexecuted effects
globalErrorInEffectCatchWarns when catch callbacks return global Error type instead of typed errors
globalErrorInEffectFailureWarns when the global Error type is used in an Effect failure channel
layerMergeAllWithDependenciesDetects interdependencies in Layer.mergeAll calls where one layer provides a service that another layer requires
lazyEffectSuggests avoiding exported zero-argument functions and service members that lazily return Effect or Stream values
lazyPromiseInEffectSyncWarns when Effect.sync lazily returns a Promise instead of using an async Effect constructor
leakingRequirementsDetects implementation services leaked in service methods
multipleEffectProvideWarns against chaining Effect.provide calls which can cause service lifecycle issues
preferUnsafeConstructorSuggests replacing Effect.runSync of a pure effect constructor with the synchronous *Unsafe variant exported by the same module
returnEffectInGenWarns when returning an Effect in a generator causes nested Effect<Effect<...>>
runEffectInsideEffectSuggests using Runtime or Effect.run*With methods instead of Effect.run* inside Effect contexts
schemaSyncInEffectSuggests using Effect-based Schema methods instead of sync methods inside Effect generators
scopeInLayerEffectSuggests using Layer.scoped instead of Layer.effect when Scope is in requirements
strictEffectProvideWarns when using Effect.provide with layers outside of application entry points
tryCatchInEffectGenDiscourages try/catch in Effect generators in favor of Effect error handling
unknownInEffectCatchWarns when catch callbacks return unknown instead of typed errors
Effect-native Prefer Effect-native APIs and abstractions when available.
abortControllerInEffectWarns when manually constructing AbortController inside Effect generators instead of using Effect.abortSignal
asyncFunctionWarns when declaring async functions and suggests using Effect values and Effect.gen for async control flow
cryptoRandomUUIDWarns 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
cryptoRandomUUIDInEffectWarns 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
extendsNativeErrorWarns when a class directly extends the native Error class

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 2,603
Class 794
Method 344
Struct 188
Interface 85
TypeAlias 13
FuncType 1

Languages

Go65%
TypeScript35%

Modules by API surface

shim/ast/shim.go644 symbols
shim/tspath/shim.go65 symbols
shim/checker/shim.go48 symbols
internal/graph/graph.go47 symbols
shim/ls/lsutil/shim.go40 symbols
shim/tsoptions/shim.go37 symbols
shim/scanner/shim.go37 symbols
internal/rules/rules_json_test.go35 symbols
etscore/options_test.go35 symbols
_packages/tsgo/src/setup/rule-prompt.ts35 symbols
shim/core/shim.go31 symbols
etscore/options.go26 symbols

For agents

$ claude mcp add tsgo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page