Editor setup
Your editor reads a .tsrx file with two pieces: an extension that colours it and a TypeScript plugin that understands it.
{
"compilerOptions": {
"plugins": [
{ "name": "@markless/typescript-plugin" },
{ "name": "@markless/router/typescript-plugin" }
]
}
}The TSRX Syntax extension colours the file and knows @if and @{ }. The Markless TypeScript plugin, named here, adds hover types, suggestions and red lines.
The extension colours, the plugin understands
You get the colours once the extension is installed, and the rest once the plugin runs. Install the extension, hover name, then click {name} on line 7 to misspell it:
Search tsrx
- Before the install, the file is plain text.
- After it, hovering
nameshowslet name: string. - A typo gets a red line, with TypeScript's own message.
A new app is already set up
An app from npm create markless writes these lines into tsconfig.json:
{
"tsrx": {
"compiler": "@markless/typescript-plugin/volar"
},
"compilerOptions": {
"jsx": "preserve",
"plugins": [
{ "name": "@markless/typescript-plugin" },
{ "name": "@markless/router/typescript-plugin" }
]
}
}tsrx.compilertells the TSRX tools to read.tsrxfiles the Markless way.@markless/typescript-pluginadds Markless suggestions, hints, errors and.tsrximports.@markless/router/typescript-pluginsuggests your page addresses insidehref.
Not sure a line is right? Run npm run doctor -- --no-build. It prints the tsrx.compiler line to add if it's missing.
Each editor finds the pieces its own way
- VS Code, Cursor or Windsurf. Install TSRX Syntax for VS Code from the Marketplace. Cursor, Windsurf and other VS Code forks install it from Open VSX. The app's
.vscode/extensions.jsonrecommends it, so the editor offers it when you open the folder. - Zed. Nothing to install. The app's
.zed/settings.jsonopens.tsrxfiles as TSX and loads the plugin. - Any other editor that runs TypeScript's own language server, such as WebStorm, reads the same
tsconfig.jsonlines.
code --install-extension TSRX.tsrx-vscode-pluginThat installs the extension from a terminal. If you have the older ripple-ts.ripple-ts-vscode-plugin installed, uninstall it, or the two fight over .tsrx files.
Hints name the element
A part hint names the HTML element a tag's props come from: <tabs.trigger shows : button. Turn the hints off with "partHints": false:
{ "name": "@markless/typescript-plugin", "partHints": false }TypeScript 7.1 is experimental
The plugin runs on TypeScript 5.9. TypeScript 7 can't load plugins, so it reads .tsrx files through @tsrx/content-mapper instead. Hover, go to definition, member suggestions and type errors work there, but these don't yet:
@block suggestions and part hints.- An auto-import that adds a new
importline (microsoft/TypeScript#64119). - Rename, in some files (microsoft/TypeScript#63879).
- Suggestions straight after a fresh
., Find File References and Go to Source Definition.
Stay on TypeScript 5.9 for daily work. tsrx-org/tsrx#136 tracks every known gap.
Type checking shows the errors the plugin catches.