Devtools
The vibelang compiler and language server check .vibe and .ts files as one program, surfacing Effect contracts and catching escaping failures or unmet services. A written ./target.ts import keeps TypeScript's native resolution (it never selects target.vibe); use ./target.js for runtime imports of migrated sources or ./target.vibe with source-extension options enabled.
Install language tooling
// example.vibe
effect function sample() {
try sleep("5 millis")
return "sample"
}
// string!!
// Run in an effect function: try Console.log(try sample())
// Output: sampleInstall vibelang as a dev dependency. vibelang --lsp --stdio starts one language server for .vibe and .ts files.
For VS Code and Cursor, install the bundled extension (not yet on the Marketplace or Open VSX; reinstall from node_modules after updating vibelang):
code --install-extension node_modules/vibelang/editor/vibelang.vsix
# Or, for Cursor:
cursor --install-extension node_modules/vibelang/editor/vibelang.vsixOther editors (including JetBrains via LSP4IJ) run vibelang --lsp --stdio for *.vibe and *.ts rooted at vibe.config.json, tsconfig.json, or jsconfig.json; disable the secondary TypeScript server to avoid duplicate diagnostics.
- Navigation & imports: Outline, Rename, Find References, Call Hierarchy, and Organize Imports cover
.vibeconstructs (moduledeclarations, shorthand pattern bindings, genericschematype imports,for concurrentcompletions, and retiredselectblocks that reportEK4607). - GitHub & built-in lint: Add
*.vibe linguist-language=TypeScriptto.gitattributes(included in the starter). Effect's type-awareeffecttsgo/*rules are built in (Lint Effect code), andvibelang/oxlint/vibelang/eslintintegrate.vibefiles with Oxlint and ESLint. - Converting
asyncfunctions: Ordinaryasyncfunctions keepPromise<T>in.vibe. Two editor refactors convert them toeffectfunctions (wrapping eachawaitinEffect.tryPromise, optionally generating a module-scopeerrorperawait). Conversion is withheld when semantics could change:return/break/continue/throwjumping out of an awaiteddoblock, self-recursion orPromise-requiring contracts/overloads/index signatures, shadowedEffector reservedfork/joinbindings, non-primitive returns that could hide athenmethod, or async generators (write an Effect producer instead).
Inspect inferred information
error Rejected
effect function accepted(value: number) {
if (value < 0) throw new Rejected()
return value + 1
}
// number!Rejected
// Run in an effect function: try Console.log(try accepted(2))
// Output: 3Hover an Effect-returning function to inspect its inferred Effect<A, E, R>. Calling an effect function returns an unrun Effect; try extracts its success value while tracking escaping failures and unmet services into generated declarations. Ordinary functions returning a native helper's Effect preserve the helper's inferred declaration spelling without adding an extra root Effect import.
Diagnostics, completions, and refactors
// expect-error: EK9201
// Rejected escapes a contract promising no failures.
effect function promised(value: number): number!! {
return try accepted(value)
}Key diagnostic rules (see the diagnostic code map):
- Contracts & runners: Escaping failures are
EK9201(interim); unmet services areEK9202(interim); calling a runner inside effect code isEK1005; catching an unfailable (E = never) Effect warns withEK9204(interim; defects pass through). - Throwing & boundaries: Fail an Effect with
throw new MissingValue(); rethrow incatch effect (e) => { throw e }(plaincatch (e) => valuereturns a value). In effect code, wrap potentially throwing foreign calls withEffect.tryand Promises withtryPromise. Banned Node/web globals and Node value imports reportEK4402(Date.now(),Math.random(), and declaredTemporal.Nowstay allowed; the oldEK4403is retired). - Completions & checks: TypeScript completions (including service members) run through the VibeLang checker; malformed imports keep TypeScript syntax errors even without
vibelang-runtime, andnew f()uses TypeScript's constructor checks.
Move a TypeScript module body to a file
From a top-level module parse { … } declaration, run Move module to a TypeScript file (VIP-40). It writes the body (with comments, JSDoc, and relative imports) to parse.ts beside .vibe or parse.tsx beside .vibex (choosing main.parse.ts / numbered names if taken, without overwriting), appends export {} if needed to keep script bodies private, and rewrites specifiers to .ts (with rewriteRelativeImportExtensions or allowImportingTsExtensions) or .js. Generated declarations for module bodies keep relative imports aimed at source modules and preserve type exports across project references.
Diagnostic reference: additional codes
EK1502 rejects type parameters on a schema body or alias. Write a generic TypeScript factory for parameterized construction.
Each entry gives the condition and the repair. The examples and language-service tables on this page cover the other registered codes for these forms.
| Code | Meaning | Remedy |
|---|---|---|
| EK2301 | A pipe body never uses its input topic, %, or % appears outside a pipe body. | Put % where the input belongs in the call after the pipe; use % only after the pipe operator, or name the value with a variable. |
| EK1017 | A provide statement was used in an expression position. | Write provide layer { statements } as a statement and return from inside its block. |
| EK2111 | A restore block has no enclosing uninterruptible block. | Put it inside uninterruptible, or use interruptible { … }. |
| EK3001 | Two services share a key. | Rename one of the declarations named by the diagnostic. |
| EK3002 | A class extends a service key. | Implement the service's shape instead of extending its key. |
| EK3003 | new tries to construct a service key. | Read the provided implementation with try Service; create implementations as objects or classes implementing its shape. |
| EK3004 | instanceof or a class pattern, when Users:, tests a service key, which is no base class. | Test the implementation's data or a concrete implementation class instead; match its members, when { find: let find }. |
| EK4838 | An obsolete check from the old language, which tied a fiber to the region that forked it. Returning, storing or passing a Fiber is not a VibeLang error, and a plain fork child is still interrupted when its parent ends. | The legacy warning has no automatic lifetime conversion. Use fork.scoped p() for the caller's scope, fork.in(scope) p() for a scope you hold, or fork.detached p() for a fiber nothing owns. |
EK1906 | A for concurrent head uses var, using, await using, or an assignment. | Declare the item with const or let; assign an existing variable inside the body. |
EK2005 | A for try head uses var, using, await using, or an assignment. | Write for try (const item of stream) { current = item } to assign an existing variable. |
| EK1704 | join receives something other than a Fiber. | Join one fiber at a time; run Effects with try, use try Deferred.await(deferred), or wrap Promises with tryPromise. See fiber lifetimes for ownership forms. |
| EK4819 | Registered for yield effect in a TypeScript Effect generator; currently not emitted in .ts files. | In TypeScript use yield* effect; in VibeLang write an effect function with try. |
| EK4820 | Registered for a non-returning yield* effect whose success type is never; currently not emitted in .ts files. | In TypeScript write return yield* effect so control flow narrows; in VibeLang run the Effect with try. |
| EK9100 | The editor's text-only projection needs a written type to choose a form. | Add the annotation requested by the message. |
| EK9101 | An editor-only suggestion: the text-only projection cannot safely select a data-type method from the receiver's written type or access syntax. | Write a type annotation on the receiver, or call the module function explicitly; optional or uncalled accesses need a direct call. |
Configure compiler checks
effect function checked(value: number): number!Rejected {
return try accepted(value)
}
// Run in an effect function: try Console.log(try checked(2))
// Output: 3Write all three contract channels or omit the return annotation to infer them (omitted slots default to never, so Effect.Effect<number> is number!!). VibeLang checks vibe.config.json, tsconfig.json, then jsconfig.json per directory (every .vibe file is a module regardless of moduleDetection). Put VibeLang settings under top-level "vibe" (ignored by plain tsc):
{
"compilerOptions": {
"strict": true,
"sourceMap": true
},
"vibe": {
"severities": { "EK0801": "error", "EK4609": "warning", "EK3801": "off" },
"effectGlobals": true
}
}- Inheritance & package scope:
extendsmergesvibeby key andseveritiesby code. Each.vibefile uses its owning package's nearest config. - Severities: Configure warning codes or assigned imported
EK38xxcodes to"error","warning","suggestion", or"off"(invalid entries reportEK3006; unknown/wrong-typedvibekeys reportEK3007). Own warnings do not fail builds or blocknoEmitOnError; imported Effect warnings fail builds unless ignored via the plugin'signoreEffect*InTscExitCodeoptions. - Legacy maps & editor-only codes: Root
vibelang.diagnosticsandcompilerOptions.vibelang.diagnosticsstill apply until migrated (modern entries win;EK3009warns; see Diagnostic severities). Remove retired codes such asEK4406and the retired unused-mainwarning (VIP-26).EK9100is editor-only and warns by default for text-only projection types; it is not reported by the CLI. - Prelude:
vibe.effectGlobalsdefaults totrue(puttingeffect/Effectexports in scope); set tofalseto qualify calls asEffect.*(Effect's functions).
TypeScript-style Effect code
VibeLang ships no automatic fixes before 1.0 (TypeScript's built-in code fixes remain available). TypeScript-style Effect declarations and combinators keep working in .vibe; these advisory codes suggest VibeLang equivalents:
| Code | TypeScript style | VibeLang form |
|---|---|---|
| EK4830 | class NotFound extends Data.TaggedError("NotFound")<{ readonly id: string }> {} | error NotFound { id: string } |
| EK4831 | class Users extends Context.Service<Users, { find(id: string): Effect.Effect<User> }>()("app/Users") {} | service Users { static readonly key = "app/Users"; find(id: string): User!! } |
| EK4832 | const User = Schema.Struct({ id: Schema.String }) | schema User { readonly id: string } |
EK4833 | Effect.Effect<User | null, NotFound | Timeout, Db> | (User | null)!(NotFound | Timeout)!Db |
| EK4834 | return try Effect.succeed(user), try Effect.fail(error) | return user, throw error |
| EK4835 | try Effect.catchTag(find(id), "NotFound", (e) => …) | find(id) catch effect (e) => match (e) { when { _tag: "NotFound" }: …; default: throw e; } |
EK4836 | Effect.withSpan(main(), "main"), return try Effect.provide(main(), AppLive), try Effect.provideService(main(), Users, users) | withSpan(main(), "main"), provide AppLive { return try main() }; retain the native Effect.provideService call |
| EK4837 | class Failed extends Schema.TaggedError<Failed>()("Failed", { … }) {} | schema error Failed { … } |
| EK4839 | Match.value(status).pipe(Match.when("idle", () => "Idle"), Match.orElse(() => "Busy")) | match (status) { when "idle": "Idle"; default: "Busy"; } |
| EK4841 | export const Tags = Schema.Array(Schema.String) just before export type Tags = typeof Tags.Type | export schema Tags = readonly string[] |
| EK4842 | import { Array } from "effect" and Array.take(values, 2) | import { Array as Arr } from "effect" and Arr.take(values, 2) |
For EK4834, EK4835, and the provide calls in EK4836, only the direct operand of bare try in effect code warns (including through parentheses, as, satisfies, !, and import aliases); stored/returned Effects, fork/join, collection operands, Effect API arguments, and catch heads do not. EK4856 warns on the transitional bare Effect<A, E, R> alias. For Effect.gen/Effect.fn, write an effect function or block with try (Creating effects, cheat sheet).
Effect language service rules
The compiler, language server, and vibelang lint run Effect's @effect/tsgo rules on selected .ts and .vibe inputs, keeping the pinned upstream rule/file eligibility and declaration/library exclusions (Lint Effect code). Language diagnostics report in .vibe files, configuration diagnostics in config files; a .ts file keeps TypeScript's verdict. Severity precedence is: vibe.severities → the repository's existing Effect language-service configuration → rule default. (module bodies are TypeScript and derive deterministicKeys from their owning .vibe file; vibelang lint leaves build outputs untouched.)
- Inline directives:
// @vibelang-diagnostics-next-line EK4804:offand// @vibelang-diagnostics EK4818:warningconfigure adjustableEK4801–EK4825lint codes (not core errors likeEK0403);*matches all adjustable codes, later directives win, and trailing text after:is prose:
effect function discard() {
// @vibelang-diagnostics-next-line EK4804:off
throw new Error("unused")
}
// Run in an effect function: try Console.log(discard() catch () => 0)
// Output: 0- Migrated
@effect-diagnosticscomments: Rules marked "Not needed" or "Covered" below do not run in.vibe, so stale@effect-diagnostics-next-linedirectives reportTS377000. Rewrite matching rules to@vibelang-diagnostics-next-line(e.g.overriddenSchemaConstructor:off→EK4814:off) and drop obsolete rule names. (|>pipelines do not count as.pipechains forunnecessaryPipeChain.) - Schema constructors:
EK4814warns when aSchema.Classsubclass overrides its constructor. Decoding invokes the override. Move work that should run only on explicit construction to a separate factory function.
The table below maps all 108 rules and features of @effect/language-service 0.87.5:
| Group | Effect's rule or feature | In VibeLang | Example |
|---|---|---|---|
| Correctness | anyUnknownInErrorContext | EK4811, off by default | throw cause where cause: unknown |
| Correctness | classSelfMismatch | Not needed: a service has no Self parameter | service Users { find(id: string): User!NotFound } |
| Correctness | duplicatePackage | EK4803, warning | two versions of effect in one program |
| Correctness | effectFnImplicitAny | Not needed: parameters are TypeScript's, so strict reports TS7006 | effect function load(id) { … } |
| Correctness | floatingEffect | EK3801, error on selected inputs, with the @effect/language-service plugin; EK4801, error, without it | A discarded Effect value or effect { … } block; write void (expression) to preserve the deliberate discard |
| Correctness | genericEffectServices | Covered: EK3005 | service Repo<T> { … } |
| Correctness | missingEffectContext | Covered: EK9202 (interim) at a contract, EK9211 at a runner | effect function f(): User!NotFound { return try (try Users).find(id) } is EK9202 |
| Correctness | missingEffectError | Covered: EK9201 (interim) | effect function f(): User!! { return try (try Users).find(id) } |
| Correctness | missingLayerContext | Covered: EK9202 (interim) and EK9211 | provide UsersLive { … } without the database layer is EK9211 at the runner |
| Correctness | missingReturnYieldStar | Not needed in .vibe: throw ends the function | throw new NotFound({ id }) |
| Correctness | missingStarInYieldEffectGen | Use try in an effect function | const user = try (try Users).find(id) |
| Correctness | nonObjectEffectServiceType | Effect 3 only, and a service declares members | service Port { value: number } |
| Correctness | outdatedApi | EK4813, error, in place of TS2339 | Effect.catchAll; use Effect.catch |
| Correctness | outdatedEffectCodegen | Not adopted: no codegen comments | None |
| Correctness | overriddenSchemaConstructor | EK4814, warning | class Person extends Schema.Class<Person>("Person")({ … }) { constructor() { … } } |
| Anti-pattern | catchUnfailableEffect | Covered: EK9204 (interim), warning. Appendix B assigns the imported rule EK3818 | succeed(1) catch (e) => fallback; a catch expression receives typed failures only |
| Anti-pattern | effectFnIife | An effect function call returns an Effect | (() => load())() |
| Anti-pattern | effectGenUsesAdapter | Effect functions use try | None |
| Anti-pattern | effectInFailure | EK4815, warning | throw program; run it: try program |
| Anti-pattern | effectInVoidSuccess | EK3830, the pinned Effect rule at its configured severity; separate from the inferred-argument warning EK4802 | An Effect containing another Effect is assigned to an Effect.Effect<void> contract |
| Anti-pattern | globalErrorInEffectCatch | EK4804, warning | Effect.try({ try: code, catch: (cause) => new Error(String(cause)) }) |
| Anti-pattern | globalErrorInEffectFailure | EK4804, warning | throw new Error("boom"); declare error Boom { } |
| Anti-pattern | lazyPromiseInEffectSync | Use promise for a Promise whose rejection is a defect | try promise(() => load(url)), with load from a .ts module |
| Anti-pattern | leakingRequirements | EK4809, warning; @vibelang leakable exempts a service | service Users { find(): User!!Db; all(): User[]!!Db } |
| Anti-pattern | multipleEffectProvide | EK4808, warning | provide A { provide B { … } }; nesting alone does not imply separate layer builds. Layer.provideMerge(A)(B) retains both layers when B needs A; review evaluation and build order before composing manually. There is no automatic merge. |
| Anti-pattern | returnEffectInGen | EK4802, warning; no automatic execution repair | return program; use return try program |
| Anti-pattern | runEffectInsideEffect | Covered: EK1005 | Effect.runPromise(load()) inside a function |
| Anti-pattern | schemaSyncInEffect | Effect 3 only | None |
| Anti-pattern | scopeInLayerEffect | Effect 3 only: Effect 4's Layer.effect owns its scope | Layer.effect(Users, effect { const pool = try open(); … }) |
| Anti-pattern | strictEffectProvide | EK4816, off by default | provide AppLive { … } or Effect.provide(program, AppLive); includes functions named main |
| Anti-pattern | tryCatchInEffectGen | Use a catch expression | (try Users).find(id) catch (e) => fallback |
| Anti-pattern | unknownInEffectCatch | EK4806, warning; a direct Effect.orDie defect bridge or its |> spelling is exempt | Effect.try({ try: code, catch: (cause) => cause }) without a defect bridge |
| Effect-native | cryptoRandomUUID | Covered: EK4402, because crypto is a banned global | crypto.randomUUID() |
| Effect-native | cryptoRandomUUIDInEffect | Covered: EK4402, because crypto is a banned global | crypto.randomUUID() |
| Effect-native | extendsNativeError | EK4805, warning | class Boom extends Error {}; declare error Boom { } |
| Effect-native | globalConsole | Covered: EK4402 | console.log(x) |
| Effect-native | globalConsoleInEffect | Covered: EK4402 | console.log(x) |
| Effect-native | globalDate | Not reported: Date is ECMAScript; use Clock where a test controls time | Date.now() |
| Effect-native | globalDateInEffect | Not reported: Date is ECMAScript; use Clock where a test controls time | new Date() |
| Effect-native | globalFetch | Covered: EK4402 | fetch(url) |
| Effect-native | globalFetchInEffect | Covered: EK4402 | fetch(url) |
| Effect-native | globalRandom | Not reported: Math is ECMAScript; use Random where a test controls it | Math.random() |
| Effect-native | globalRandomInEffect | Not reported: Math is ECMAScript; use Random where a test controls it | Math.random() |
| Effect-native | globalTimers | Covered: EK4402 | setTimeout(f, 10) |
| Effect-native | globalTimersInEffect | Covered: EK4402 | setTimeout(f, 10) |
| Effect-native | instanceOfSchema | EK4817, off by default; no automatic test conversion | value instanceof Person; choose Schema.is(Person)(value) explicitly when schema validation is intended |
| Effect-native | newPromise | EK4812, warning | new Promise((resolve) => …); use callback((resume) => …) |
| Effect-native | nodeBuiltinImport | Covered: EK4402 at a value import of a Node.js module | readFile(path) from node:fs/promises |
| Effect-native | preferSchemaOverJson | EK4818, off by default | JSON.parse(text) |
| Effect-native | processEnv | Covered: EK4402 | process.env.PORT; use Config |
| Effect-native | processEnvInEffect | Covered: EK4402 | process.env.PORT |
| Effect-native | unsafeEffectTypeAssertion | EK4810, warning; removing the assertion has no automatic fix | program as Effect.Effect<number> drops a failure A type-spelling repair also protects the whole refused assertion; unrelated annotations can still be repaired. |
| Style | catchAllToMapError | Not needed: a catch that rethrows is the one form | catch effect (e) => { throw new Failed({ cause: e }) } |
| Style | deterministicKeys | Not needed: the compiler derives each service key from its package, module, and name | @acme/app/src/users#Users |
| Style | effectDoNotation | Not needed: const statements bind values | const user = try (try Users).find(id) |
| Style | effectFnOpportunity | Use an effect function | effect function load(id: string) { … } |
| Style | effectMapFlatten | Not needed: statements | const a = try f(); return try g(a) |
| Style | effectMapVoid | Not needed: statements | try f() on its own line |
| Style | effectSucceedWithVoid | Not needed: an effect function that returns nothing | effect function done() { } |
| Style | flatMapToMap | Not needed: statements | return try g(try f()) |
| Style | importFromBarrel | Not needed: the compiler imports effect's root names and subpath modules | Option.some(1) with no import |
| Style | missedPipeableOpportunity | Refactor: "Convert to a pipe" | f(g(h(x))) becomes x |> h(%) |> g(%) |> f(%) |
| Style | nestedEffectGenYield | Effect functions use try | None |
| Style | redundantSchemaTagIdentifier | Not needed: error and schema declarations take their tag from their name | error NotFound { id: string } |
| Style | schemaStructWithTag | EK4821, off by default; no automatic constructor conversion | Schema.Struct({ _tag: Schema.Literal("A"), … }) |
| Style | schemaUnionOfLiterals | Effect 3 only | None |
| Style | serviceNotAsClass | Not needed: service declarations | service Users { … } |
| Style | strictBooleanExpressions | EK4822, off by default | if (count) { … } |
| Style | unnecessaryArrowBlock | EK4823, off by default | (x) => { return x + 1 } |
| Style | unnecessaryEffectGen | Effect functions use try | None |
| Style | unnecessaryFailYieldableError | Not needed: throw new NotFound({ id }) | throw new NotFound({ id }) |
| Style | unnecessaryPipe | EK4824, off by default | pipe(x) |
| Style | unnecessaryPipeChain | EK4825, off by default | x.pipe(f).pipe(g) |
| Hover | Extended Effect type | Covered: a function's hover shows its contract, A!E!R | string!UserNotFound!Users |
| Hover | yield* hover | Use try to get the success value | try load() returns User |
| Hover | Layer service involvement | Hover: a layer lists what it provides, needs, and fails with | Hover on UsersLive |
| Completion | Self in classes | Not needed: declarations have no Self | None |
| Completion | Effect.gen snippet | Use an effect function | None |
| Completion | Effect.fn span name | Not needed: name a span explicitly | try withSpan(effect { … }, "checkout") |
| Completion | Duration strings | Completion: "2 seconds" and the other units where a Duration.Input goes | Effect.sleep("1 second") |
| Completion | Namespace import style | Not needed: effect's root names and subpath modules are in scope | Option.some(1) |
| Completion | Schema.brand name | Completion: the declared name in Schema.brand("…") | const UserId = Schema.String.pipe(Schema.brand("UserId")) |
| Completion | Comment directives | @vibelang-diagnostics comments, whose codes complete | // @vibelang-diagnostics-next-line EK4804:off |
| Refactor | async function to Effect.gen | Convert to an effect function | try tryPromise(() => load(url)) |
| Refactor | async function to Effect.gen, with an error per promise | Convert to an effect function with a mapped failure | try tryPromise({ try: () => load(url), catch: (cause) => new LoadFailed({ cause }) }) |
| Refactor | async function to Effect.fn | Use an effect function | As above |
| Refactor | async function to Effect.fn, with an error per promise | Convert to an effect function with a mapped failure | As above |
| Refactor | Effect.gen to Effect.fn | Use an effect function | None |
| Refactor | Function calls to pipe | Refactor: "Convert to a pipe" | f(g(x)) becomes x |> g(%) |> f(%) |
| Refactor | Pipe to data-first | Refactor: "Convert the pipe to calls" | x |> g(%) |> f(%) becomes f(g(x)) |
| Refactor | Toggle return type signature | Refactor: "Write the inferred contract" and "Remove the contract" | effect function load(id: string): User!NotFound!Users |
| Refactor | Remove an unnecessary Effect.gen | Use an effect function | None |
| Refactor | Wrap with Effect.gen | Use an effect function | None |
| Refactor | Toggle pipe styles | Refactor: "Write pipe(x, …)" and "Write x.pipe(…)" | x.pipe(f, g) and pipe(x, f, g) |
| Refactor | Structural type to Schema | Refactor: "Convert to a schema declaration" | interface User { name: string } becomes schema User { name: string } |
| Refactor | Effect.Service to Context.Tag | Not needed: service declarations | None |
| Codegen | annotate | Refactor: "Write the inferred contract" | effect function load(id: string): User!NotFound!Users |
| Codegen | typeToSchema | Refactor: "Convert to a schema declaration" | schema User { name: string } |
| Other | Renaming a tagged class renames its tag | Not needed: an error declaration's tag is its name, so a rename renames both | error NotFound { } renamed to Missing |
| Other | Go to definition for RpcClient | Not adopted yet: the language server has no definition hook | None |
When enabled, strictEffectProvide flags layer provision in every function, including main — compose layers at the entry point and disable the diagnostic there.
Debug stack traces
Build with "sourceMap": true and run node --enable-source-maps dist/main.js. Compiled effect functions preserve their source names in JS stack frames, and source maps map JS locations back to .vibe lines, but VibeLang adds no spans of its own — wrap key operations with try withSpan(effect { ... }, "checkout") for logical caller context.
If NodeRuntime.runMain prints only Error: message, call your exported main from a TypeScript entry to print the full stack and preserve the failing exit status:
// debug.ts
// fragment
import { Effect } from "effect"
import { main } from "./app.vibe"
Effect.runPromise(main()).catch((error: unknown) => {
console.error(error instanceof Error ? error.stack : error)
throw error
})Compile debug.ts with vibelang and run node --enable-source-maps dist/debug.js (keep the top-level runner in a separate entry so importing app.vibe does not start execution).
Lint and build integration
- Checking & Vitest: Run
vibelang --noEmitfor whole-project checking.vibelang-vitesupports Vite 7–8 and Vitest 5 (bun run testcompiles source tests with no prior build; see TestClock):
// TypeScript (.ts)
// vitest.config.ts
import { defineConfig } from "vitest/config"
import vibelang from "vibelang-vite"
export default defineConfig({
plugins: [vibelang({ project: "tsconfig.test.json" })],
test: { include: ["src/**/*.test.vibe"] }
})- ESLint (
vibelang/eslint): Installeslintandtypescript-eslint8 besidevibelang.vibelang/eslintproduces standard typescript-eslint ESTree nodes and scope analysis for.vibeand.vibex(including JSX for React/Solid rules); reports, fixes, and// eslint-disable-next-linetarget the original source text (inspect trees withvibelang --estree main.vibe < main.vibe). Type-aware ESLint rules cannot run directly on.vibe— enable them on.tsfiles usingtypedPrograminstead ofproject/projectService, and map.vibe/.vibexinimport/parsers(orimport-x/parsers) when usingeslint-plugin-import:
// eslint.config.js
import tseslint from "typescript-eslint"
import vibelang, { typedProgram } from "vibelang/eslint"
export default tseslint.config(
{
settings: { "import/parsers": { "vibelang/eslint": [".vibe", ".vibex"] } }
},
{
files: ["src/**/*.ts"],
extends: [tseslint.configs.recommendedTypeChecked],
languageOptions: {
parserOptions: { programs: [typedProgram({ project: "tsconfig.json", tsconfigRootDir: import.meta.dirname })] }
}
},
{
files: ["src/**/*.{vibe,vibex}"],
extends: [tseslint.configs.recommended],
languageOptions: { parser: vibelang }
}
)typedProgram() discovers vibe.config.json, tsconfig.json, then jsconfig.json from tsconfigRootDir (or uses an explicit project), compiling each workspace package once and exposing .vibe declarations to typescript-eslint. Keep disableSourceOfProjectReferenceRedirect absent or false across workspace references so typed tools resolve x.d.vibe.ts through namespace barrels.
Custom ESTree node types (usable in no-restricted-syntax selectors, e.g. VibeCatchExpression > Literal.handler[value='']):
| Form | ESTree node |
|---|---|
A!E!R | VibeEffectType (success, failure, requirements) |
x |> f(%) | VibePipeExpression (left, right; % is TopicReference) |
x catch () => fallback | VibeCatchExpression (expression, handler) |
provide AppLive, Random.Random = seeded { ... } | VibeProvideStatement (providers, body; VibeServiceProvider) |
uninterruptible / restore / interruptible | VibeMaskStatement (kind, body) |
x is P / pattern binding / for concurrent | VibeIsExpression, VibePatternAssignment, VibeForConcurrentStatement |
Compiler-generated helper variables are omitted from scope analysis. Node types for newer VIP forms (effect, try, fork) are pending VIP-34.
- Knip (
vibelang/knip): Detects unused files, exports, dependencies, JSX component references, namespace member reads, and JSDoc tags (@public) across.vibeand.vibex(requires a JS/TS Knip config):
// knip.config.js
import vibelang from "vibelang/knip"
export default {
compilers: { vibe: vibelang, vibex: vibelang },
// The declaration sidecars vibelang writes beside .vibe files are its output.
ignore: ["**/*.d.vibe.ts", "**/*.d.vibex.ts"]
}Debugging in editors
effect function tracedSample() {
return try withSpan(sample(), "sample")
}
// Run in an effect function: try Console.log(try tracedSample())
// Output: sampleAdd spans explicitly with withSpan, and use Effect's DevTools layer (effect/devtools) + VS Code extension to inspect fibers and logical span stacks. Standard source-map debuggers (VS Code, Chrome/Edge DevTools, JetBrains) map breakpoints and paused frames to .vibe (Source maps); stepping over a pausing try can enter Effect's run loop, so set a breakpoint on the next source line.
Coming from Effect
Library debugging concepts still apply; VibeLang's effect functions, service declarations, and source mapping require language-aware tooling beyond the upstream TypeScript plugin.
First calls from Effect TypeScript
Common diagnostics when porting Effect TypeScript to .vibe (cheat sheet):
| Code | Meaning and manual guidance |
|---|---|
EK1015 | Use try in an effect function (const value = try load()); producers use yield to emit values. |
EK2112 | Legacy typed catch clauses no longer filter failures; write catch effect (e) => match (e) { when NotFound: fallback; default: throw e; }. Ordinary parameter annotations like catch (e: NotFound) => fallback remain TypeScript annotations. |
TS2709, TS2707, TS2351 (Message, Command, new Worker(…)) | The name is an implicit Effect module. Declare/import your own, or reach DOM globals like globalThis.Worker in a .ts adapter. |
TS2339 (Number.sum, Array.make) | JS globals win over Effect modules of the same name: alias Effect's module (import { Number as EffectNumber } from "effect"). |
TS2304, TS2552 (Process, Locks) | Experimental services live under Experimental (e.g. try (try Experimental.Process.Process).hostname). Misspelled names never suggest EK4402-banned globals like process. |
TS2304 (Model, Prompt) | Ambiguous across Effect subpath packages — import explicitly (e.g. import { Model } from "effect/schema"). |
EK4802 | An Effect passed as data to a plain generic function — run it with try if you meant its value. |
Last resort: keep TypeScript file names
Prefer .vibe/.vibex with the tooling above. Only if a project cannot rename files, see the experimental TypeScript shim and its stock-tool limitations.
The matching Effect page: effect.website/docs/v4/getting-started/devtools