UNPKG

@shufo/prettier-plugin-blade

Version:

- Automatically indent markup inside directives - Automatically add spacing to blade template markers - PHP 8 syntax support (null safe operator, named arguments) - Compliant to PSR-2 coding standard (PHP code inside directives) - Automatically sort Tailw

20 lines (16 loc) 471 B
import type { AstPath, Doc } from "prettier"; /** * Returns a `Doc` representation of the given AST `path`. * @param path The AST path to print. * @returns A `Doc` representation of the AST node. * @throws An error if the AST node type is unknown. */ export const print = (path: AstPath): Doc => { const node = path.getValue(); switch (node.type) { case "blade-formatter": { return node.body; } } throw new Error(`Unknown node type: ${node.type}`); };