method PrettyPrinterService.registerSyntax
PrettyPrinterService.registerSyntax(
syntaxName: string,
syntaxDefinition: Plugin<unknown>,
): Promise<void>

Register a new syntax.

The recommended way to define a new language syntax plugin is to follow the instructions here:

https://prettier.io/docs/plugins#developing-plugins

There is a list of already defined languages available for import here:

Parameters

syntaxName: string

the name used to refer to the syntax.

syntaxDefinition: Plugin<unknown>

the definition for the syntax conforming to the Prettier plugin interface.

Return Type

Promise<void>

Usage

import type PrettyPrinterService from ".";