You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, today while setting up prettier + prettier-pug I encountered this problem:
The prettier-pug plugin, when ran on a pug file with the --write flag, will fix the code style and as a side-effect sometimes corrupt the syntax of the file, producing an invalid file which cannot be processed on subsequent runs.
As an example here this completely valid pug file:
tag(key='value')#{identifier}
tag
| #{identifier}
The prettier-pug produces this output, which is invalid:
tag(key='value')#{identifier}
tag
#{identifier}
When using the pug package, it reports this error:
When running pug-prettier on the new pug file, it produces this error:
[error] /file.pug: Error: Unhandled token: {"type":"interpolation","loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}},"val":"identifier"}
[error] at _loop_1 (/node_modules/@prettier/plugin-pug/dist/index.js:542:35)
[error] at Object.print (/node_modules/@prettier/plugin-pug/dist/index.js:546:21)
[error] at callPluginPrintFunction (/node_modules/prettier/bin-prettier.js:13622:18)
[error] at /node_modules/prettier/bin-prettier.js:13573:16
[error] at Object.printComments (/node_modules/prettier/bin-prettier.js:13295:17)
[error] at printGenerically (/node_modules/prettier/bin-prettier.js:13572:22)
[error] at printAstToDoc (/node_modules/prettier/bin-prettier.js:13584:16)
[error] at coreFormat (/node_modules/prettier/bin-prettier.js:13903:16)
[error] at format (/node_modules/prettier/bin-prettier.js:14148:73)
[error] at formatWithCursor (/node_modules/prettier/bin-prettier.js:14164:12)
The text was updated successfully, but these errors were encountered:
Hello, today while setting up prettier + prettier-pug I encountered this problem:
The prettier-pug plugin, when ran on a pug file with the --write flag, will fix the code style and as a side-effect sometimes corrupt the syntax of the file, producing an invalid file which cannot be processed on subsequent runs.
As an example here this completely valid pug file:
The prettier-pug produces this output, which is invalid:
When using the pug package, it reports this error:
When running pug-prettier on the new pug file, it produces this error:
The text was updated successfully, but these errors were encountered: