prettier / plugin-pug

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

Bug: can't set pugBracketSameLine to true in prettierrc #477

Closed SArpnt closed 8 months ago

SArpnt commented 8 months ago

Info

Tool Version
Plugin v3.0.0
Prettier v3.1.1
Framework none
Node v21.4.0
OS linux

Prettier config

.prettierrc.json5

{
    useTabs: true,
    tabWidth: 3,
    arrowParens: "avoid",
    plugins: ["@prettier/plugin-pug"],
    pugAttributeSeparator: "none",
    pugBracketSameLine: true, // or "true"
    pugEmptyAttributes: "none",
}

Input

(any pug file, can use an empty file)

Output or Error

with true:

[error] Error: Invalid --pug-bracket-same-line value. Expected null, false, "" or "true", but received true.

with "":

[error] Invalid pugBracketSameLine value. Expected null, false, true or "true", but received "".

with "true":

src/index2.pug
[error] src/index2.pug: Error: Error: Invalid bracketSameLine value. Expected true or false, but received "true".
[error]     at x.build (file:///home/sarpnt/Programming/bytebeat-composer/node_modules/.pnpm/@prettier+plugin-pug@3.0.0_prettier@3.1.1/node_modules/@prettier/plugin-pug/dist/index.js:32:4380)
[error]     at async Object.print (file:///home/sarpnt/Programming/bytebeat-composer/node_modules/.pnpm/@prettier+plugin-pug@3.0.0_prettier@3.1.1/node_modules/@prettier/plugin-pug/dist/index.js:61:295)
[error]     at async printAstToDoc (file:///home/sarpnt/Programming/bytebeat-composer/node_modules/.pnpm/prettier@3.1.1/node_modules/prettier/index.mjs:20377:16)
[error]     at async coreFormat (file:///home/sarpnt/Programming/bytebeat-composer/node_modules/.pnpm/prettier@3.1.1/node_modules/prettier/index.mjs:20687:14)
[error]     at async formatWithCursor (file:///home/sarpnt/Programming/bytebeat-composer/node_modules/.pnpm/prettier@3.1.1/node_modules/prettier/index.mjs:20885:14)
[error]     at async formatFiles (file:///home/sarpnt/Programming/bytebeat-composer/node_modules/.pnpm/prettier@3.1.1/node_modules/prettier/internal/cli.mjs:7073:18)
[error]     at async main (file:///home/sarpnt/Programming/bytebeat-composer/node_modules/.pnpm/prettier@3.1.1/node_modules/prettier/internal/cli.mjs:7279:5)
[error]     at async Module.run (file:///home/sarpnt/Programming/bytebeat-composer/node_modules/.pnpm/prettier@3.1.1/node_modules/prettier/internal/cli.mjs:7225:5)
Shinigami92 commented 8 months ago

duplicate, cannot be fixed by this plugin