Editor setup

2 min·Assumes: reading a .tsrx file

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

A pen-and-ink drawing of a code editor. The Extensions sidebar lists TSRX Syntax for VS Code by TSRX with an Install button, and profile.tsrx is open: let name = state('Ada'), and a section with an h2 that shows name. Before the install the code is plain grey. After it, the code is in colour, hovering name shows let name: string, and misspelling name as nmae draws a red line with the message Cannot find name 'nmae'.

  • Before the install, the file is plain text.
  • After it, hovering name shows let 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.compiler tells the TSRX tools to read .tsrx files the Markless way.
  • @markless/typescript-plugin adds Markless suggestions, hints, errors and .tsrx imports.
  • @markless/router/typescript-plugin suggests your page addresses inside href.

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.json recommends it, so the editor offers it when you open the folder.
  • Zed. Nothing to install. The app's .zed/settings.json opens .tsrx files as TSX and loads the plugin.
  • Any other editor that runs TypeScript's own language server, such as WebStorm, reads the same tsconfig.json lines.
code --install-extension TSRX.tsrx-vscode-plugin

That 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:

Stay on TypeScript 5.9 for daily work. tsrx-org/tsrx#136 tracks every known gap.

Type checking shows the errors the plugin catches.