Introduction
Type safety and editor tooling for EdgeJS templates.
edge-language-tools brings full code intelligence to EdgeJS templates: a real language server — type-aware diagnostics, autocomplete for props, expressions, and tags (including your components as supercharged shorthand tags), hover types, and template-path completion for @include/@component — plus a CI type-checker and compile-time-checked edge.render() calls. Built on TypeScript and Volar.js, the same machinery behind Vue and Astro tooling. Works with bare edge.js; no AdonisJS required.
Declare a template’s interface once, in a comment today’s Edge already ignores:
{{--
@types {
user: import('#models/user').User
items: string[]
}
--}}
<h1>{{ user.name }}</h1>
@each(item in items)
<li>{{ item }}</li>
@end
Everything below the block is inferred by TypeScript: @let locals, @each item types, narrowing in @if. A typo like user.nmae gets a diagnostic on the exact characters — in the editor and in CI.
What you get
Full code intelligence in the editor
The whole TypeScript experience inside templates: type-aware diagnostics, hover types, prop and expression completions, template-path completion — in VS Code, Cursor, and Zed, local or SSH remote.
edge-check CLI
Caret-underlined diagnostics, machine-readable JSON output, and exit codes for CI.
Typed render calls
A generated templates.d.ts makes edge.render('profile', props) a compile-time-checked call.
Cross-file checking
@component props, @include state compatibility, and supercharged shorthand tags.
The @types block
Inline object types or any TS type expression — including imports from your app’s models.
Killer examples
Typed routes, model-backed props, discriminated union states, typed i18n keys — patterns where the checker earns its keep.
Strict mode
Opt-in requireTypes globs so chosen folders must declare their types.
How it works, in one sentence
Each template compiles to a virtual TypeScript module — expressions copied verbatim with exact offset mappings, constructs emitted as real control flow — so TypeScript does the checking and Volar.js serves it to editors. Read How it works for the details.