Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

default

constante Since 1.1.0

Plugin de Prettier para componentes .meeko. Formatea <script> y <script server> como TypeScript, <style> como CSS y la plantilla como HTML, con los valores de las directivas y el texto {expr} formateados como expresiones. Desde 1.3.0 normaliza el atributo estático class de los elementos (espacios colapsados, sin clases repetidas) y puede ordenar sus clases con meekoSortClasses. Un archivo que no compila no se formatea.

ts
import plugin from "@meekojs/meeko/prettier";

Source code src/formatters/prettier/plugin.ts:446

Declaración #

ts
declare const plugin: Plugin
export default plugin

Example #

ts
import { format } from "prettier";
import meeko from "@meekojs/meeko/prettier";

const output = await format('<script lang="ts">const a=1</script><template><p>{a}</p></template>', {
  parser: "meeko",
  plugins: [meeko],
});

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/formatters/prettier/plugin.ts