-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: printWidth option (or pugPrintWidth) not working #511
Comments
There is a test for printWidth https://github.com/prettier/plugin-pug/tree/main/tests/options/printWidth
There is a whole test for this https://github.com/prettier/plugin-pug/tree/main/tests/indents You could checkout the project and add tests for your specific case in https://github.com/prettier/plugin-pug/tree/main/tests/issues |
Okay, thanks! Will check it. |
@Shinigami92 After diving into this issue, I found the following:
|
For second point, I think I remember that the underlying pug-compiler crashes/fails when there are mixed spaces and tabs, so we might be out of luck here and you should e.g. use https://github.com/pugjs/pug-lint for such cases. When you try tackling these via PRs, please ensure to open separate PRs for each individual problem. |
Did you know the way, how I can run fixing finding problems by https://github.com/pugjs/pug-lint on save? Because for now, I use this both 2 plugins: @prettier/plugin-pug - to format the pug-code on save by setting "editor.defaultFormatter": "esbenp.prettier-vscode" (but I couldn't find the way, how to show all problems/errors in pug files that not matching the settings in .prettierrc) Not sure that it is a proper way, but I found only this way to format code on save + show problems screenshot |
As I do not have anymore an active pug project for 2 years now, TLDR: no |
For some reason, the default Prettier option is not working with pug files. I tried both options printWidth and pugPrintWidth. The pug file with some long text remains unformatted.
Also, the plugin does not convert indents to tabs ("useTabs": true) on save.
The text was updated successfully, but these errors were encountered: