@elaraai/east-diagnostics
v1.0.14
Published
East-aware diagnostic rules over the TypeScript checker — one shared engine for the editor (tsserver plugin), the agent (headless daemon), and CI.
Maintainers
Readme
East Diagnostics
East-aware diagnostic rules over the TypeScript checker
East Diagnostics is the shared rule engine that catches East-specific
mistakes which plain TypeScript can't — the same checks surfaced to the agent at
write-time (the Claude plugin daemon) and to developers in the editor and CI
(@elaraai/eslint-plugin-east). The rules run against a
real ts.Program, so they are type-aware, not regex heuristics.
Features
- Shared rule set - One engine,
runEastRules(ts, program, sourceFile, checker), reused across every surface. - Type-aware - Rules consult the TypeScript checker (e.g. resolving
BlockBuilder, variant contextual types). - No bundled compiler -
typescriptis a peer dependency; the host's version is injected. - Diagnostics service -
createDiagnosticsService()resolves the nearest tsconfig, holds a warmLanguageService, and merges native type errors with the East rules for a file. Supports in-memory overlays for unsaved buffers. - Readable East type errors - native TS assignability errors on East types are rewritten via east's structural type diff (
diffTypes), so a mismatch deep inside a recursive type reads as one localized line instead of pages of restated generics. The project's own@elaraai/eastis resolved at runtime, so the diff always matches the project's type semantics. - LSP server -
runEastLsp()serves the same diagnostics over the Language Server Protocol (stdio, zero dependencies), usable by Claude Code pluginlspServers, Neovim, or any LSP client. - tsserver plugin - the
@elaraai/east-diagnostics/tsserver-pluginentry decorates the editor's existing TypeScript language service (no second program), shipped to VS Code via the East UI Preview extension'stypescriptServerPluginscontribution.
Rules
no-redundant-east-cast- A TypeScript cast on the value of$.let/$.constwhen the East type argument is present.prefer-explicit-east-type- One-arg$.let/$.conston an under-determined value ([],{},new Map()).prefer-some-none-variant("some"/"none", …)instead ofsome()/none.no-handrolled-variant- A plain object literal where an East variant/option is expected.no-east-namespaced-type-East.IntegerTypeetc. instead of a bare import.prefer-let-const-over-east-value-East.value(…)declared or returned inside anEast.functionblock.no-relative-src-import- Importing../src/…instead of the published package name.no-let-const-in-expression- Using$.let/$.constinline in an expression instead of binding to aconst.no-unexecuted-east-expression- A bare East expression statement that is never executed with$( … )or bound.no-reinlined-east-binding- An EastExprbound to a JSconst/letand reused inside a block is re-inlined per use — bind it once with$.let/$.const.no-east-data-builder-helper- A TS helper whose only job is to return a hand-built East value — inline it or make it a realEast.function.prefer-jsx-over-factory-call- In a.tsxfile, a factory'sFoo.Root(...)whose result is a JSX element — author it with the<Foo>tag instead.
Usage
import * as ts from "typescript";
import { runEastRules, createDiagnosticsService } from "@elaraai/east-diagnostics";
// Pure: run the rules over one source file you already have a program + checker for.
const diagnostics = runEastRules(ts, program, sourceFile, checker, { disabled: ["prefer-some-none"] });
// Or let the service resolve the project and merge native + rule diagnostics.
const service = createDiagnosticsService();
const text = service.diagnoseText("/path/to/file.ts"); // "" when cleanClaude Code plugin
The East ecosystem also ships a Claude Code plugin — East language skills, example search, and preemptive diagnostics for East code — installed separately from the elaraai marketplace:
# Inside Claude Code
/plugin marketplace add elaraai/east-workspace
/plugin install east@elaraai# From a terminal
claude plugin marketplace add elaraai/east-workspace
claude plugin install east@elaraaiLicense
Dual-licensed:
- Open Source: AGPL-3.0 - Free for open source use
- Commercial: Available for proprietary use - contact [email protected]
Developed by Elara AI Pty Ltd
