Peek shows what a value is. TypeScript shows what it should be.

In TypeScript, the editor knows your types.

Pick TypeScript for a Snippet, with no tsconfig and no build step. The editor checks it as you type, and the code still runs.

01

Types on hover, mistakes underlined

Hover a name or a call to see its type. A type error is underlined as you type, and by default the code still runs, so you see what it does.

The underline explains the $0.13: price expects cents as a number, not a string.
02

Or hold the Run

Turn on “Don’t run with type errors”, and a TypeScript Snippet with an error shows the error instead of running.

Nothing ran: the console shows the type error on line 5, and the footer says Didn’t run.
03

JavaScript or TypeScript, per Snippet

Each Snippet has its own Language. A type in JavaScript is an error until you pick TypeScript.

Picking TypeScript in the footer’s Language menu clears the underlines, and the Snippet prints 5.
04

Completions

Names that fit appear as you type, with each one’s type and notes beside it, in JavaScript and TypeScript.

word.rep offers repeat, replace and replaceAll. The pane beside them shows what repeat takes and returns.
05

Format Code

One key formats the code on screen with Prettier, built in, so it works offline.

Three crowded lines, formatted in Prettier’s default style. The Run prints 7.5 before and after.
06

Vim keys

Switch the editor to Vim’s modes and motions. ⌘↵ and every other shortcut still work.

The footer starts with the Vim mode, INSERT here, and the Snippet still runs: it prints 5.
07

Your format style JSpark+

Choose Prettier’s options or use a .prettierrc, format each time you press Run, and get Tailwind class suggestions as you type.

Settings → Editor: Prettier’s options, and Format before running switched on.

Good to know

No tsconfig, no build step
TypeScript is checked in the app and compiled with esbuild.
Offline
The editor, its types and Prettier are inside the app.
New Snippets start in JavaScript
Change it in Settings → Running → Language for new Snippets.
Vue and Svelte, typed
A Vue or Svelte Snippet is one component file. With lang="ts", it is type-checked too.

Read about JavaScript and TypeScript Read the editor docs All features

Next time a type puzzles you, hover it.

Download free for Mac

Not a trial: it doesn’t expire.

Windows: coming later