Skip to content

Twoslash ESLint Integration

Added in 0.6.0

Included in Expressive code twoslash, Twoslash ESLint is a Twoslash integration that added support for Twoslash to handle ESLint code blocks. Unlike other Twoslash instances, Twoslash ESLint uses eslint as it’s meta trigger for codeblocks, and it is designed to work with JavaScript and TypeScript code blocks that contain ESLint errors. When a code block is annotated with eslint, Twoslash ESLint will parse the code.

This is an example taken from the Twoslash ESLint documentation website.

const unused = 1;
Error 0 ― 'unused' is assigned a value but never used. (no-unused-vars)
type Foo = {
Error 0 ― 'Foo' is defined but never used. (no-unused-vars)
bar: string;
};