Skip to content

Bug: VSCode fails to format pug files with [email protected] and higher #478

Closed as not planned
@ladown

Description

@ladown

Plugin Version

v3.0.0

Prettier Version

v3.1.1

Which frameworks are affected?

  • none
  • vue
  • angular
  • svelte

Node Version

v20.10.0

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Prettier config

{
  "plugins": ["@prettier/plugin-pug"],
  "tabWidth": 4,
  "singleQuote": true,
  "trailingComma": "all",
  "semi": true,
  "printWidth": 130,
  "useTabs": true,
  "jsxSingleQuote": true,
  "endOfLine": "auto",
  "bracketSameLine": false,
  "htmlWhitespaceSensitivity": "ignore",
  "pugAttributeSeparator": "none",
  "pugWrapAttributesThreshold": 1
}

Input

script.
  const obj = { test: 1};

Output or Error

There is no formatter for 'jade' files installed.

Expected Output

script.
  const obj = { test: 1 };

Additional Context

Hello!

I faced with the problem, that [email protected] and higher causes the problem, that VSCode doesn't format Pug files with prettier. If we install prettier3.1.0 and lower it works fine. When we install [email protected] and higher, we see next indicator in footer panel of VSCode:

image

When we try to format it with command Format Document, we will have the following notification:

image

I also tried to set default formatter in VSCode settings and it didn't not help me.

If we try to format .pug files from CLI, it works perfect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions