prettier / plugin-pug

Prettier Pug Plugin
https://prettier.github.io/plugin-pug
MIT License
196 stars 44 forks source link

Bug: printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. #451

Closed lehni closed 1 year ago

lehni commented 1 year ago

Info

Tool Version
Plugin v2.5.1
Prettier v3.0.0
Framework vue
Node v18.15.0
OS mac

Prettier config

{
  "plugins": [
    "@prettier/plugin-pug"
  ],
  "printWidth": 80,
  "semi": false,
  "singleQuote": true,
  "quoteProps": "consistent",
  "arrowParens": "avoid",
  "trailingComma": "none",
  "pugFramework": "vue",
  "pugSingleQuote": false,
  "pugAttributeSeparator": "none",
  "pugCommentPreserveSpaces": "trim-all",
  "pugWrapAttributesThreshold": 1,
  "pugWrapAttributesPattern": "^(@|v-)"
}

Output or Error

Error: printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed
[error]     at printEmbeddedLanguages (file:///Users/lehni/Development/Lineto/prettier/src/main/multiparser.js:28:11)
[error]     at printAstToDoc (file:///Users/lehni/Development/Lineto/prettier/src/main/ast-to-doc.js:40:9)
[error]     at async coreFormat (file:///Users/lehni/Development/Lineto/prettier/src/main/core.js:36:13)
[error]     at async formatWithCursor (file:///Users/lehni/Development/Lineto/prettier/src/main/core.js:298:14)
[error]     at async formatFiles (file:///Users/lehni/Development/Lineto/prettier/src/cli/format.js:396:18)
[error]     at async main (file:///Users/lehni/Development/Lineto/prettier/src/cli/index.js:102:5)
[error]     at async Module.run (file:///Users/lehni/Development/Lineto/prettier/src/cli/index.js:31:5)
lehni commented 1 year ago

The solution is very simple. PR incoming.

lehni commented 1 year ago

Ah, I'm just now seeing #411 which would be the proper way to get this addressed. Looks like it's time to roll that out.