Skip to content
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

pug formatter #527

Closed
octref opened this issue Nov 9, 2017 · 17 comments
Closed

pug formatter #527

octref opened this issue Nov 9, 2017 · 17 comments

Comments

@octref
Copy link
Member

octref commented Nov 9, 2017

We want to include a pug formatter in Vetur.

Options:

@iamstevendao
Copy link

iamstevendao commented Dec 4, 2017

I also really want the same "attribute on separate line formatting" in HTML to happen with Pug in Vue files.
Something likes this can be done with "html.format.wrapAttributes": "force-aligned":

      <button type="button"
              (click)="modalForm.hide()"
              class="close"
              data-dismiss="modal"
              aria-hidden="true">&times;
      </button>

Can we have somethings similar with Pug?

@MadReal
Copy link

MadReal commented Jan 3, 2018

Any updates on this?

@octref octref mentioned this issue Jan 16, 2018
3 tasks
@o-alexandrov
Copy link

Could you please let us know whether you have any plans on supporting .pug?

@tdamsma
Copy link

tdamsma commented Jun 22, 2018

Is supporting pug still on the roadmap?

@Bombfuse
Copy link

Bombfuse commented Jan 4, 2019

Also interested in pug support

@homerjam
Copy link

homerjam commented Apr 8, 2019

This extension helps, too bad whatever changes were made haven't been contributed back to the original source but hey ho.

https://marketplace.visualstudio.com/items?itemName=dtx92.vscode-pugvuebeautify

@octref
Copy link
Member Author

octref commented Apr 8, 2019

I dont' mind just adding https://github.com/vingorius/pug-beautify, if that's what you all want. Can you all give https://marketplace.visualstudio.com/itemdetails?itemName=dtx92.vscode-pugvuebeautify a try to see if it's working fine or buggy for you?

@kbtz
Copy link

kbtz commented Apr 26, 2019

@octref It seems to work when executing it manually. If I have wrong indentation on both pug and stylus code for example it will format only the template region as it should.

So the only thing left for integration would be allowing it on vetur.format.defaultFormatter.pug so it gets executed when formatting the whole document, that's correct?

Also I'd like to know if its possible to execute it as the default html formatter with the current Vetur version as a workaround. Thanks!

@jessielaf
Copy link

Is this still on the roadmap?

@octref
Copy link
Member Author

octref commented Dec 12, 2019

https://github.com/prettier/plugin-pug seems actively maintained. I'll try to integrate that.

@octref octref added this to the On Deck milestone Dec 17, 2019
@the-nicolas
Copy link

https://github.com/prettier/plugin-pug seems actively maintained. I'll try to integrate that.

...any success?

@bkarlson
Copy link

bkarlson commented Apr 2, 2020

hello?

@Cigoler
Copy link

Cigoler commented Jun 4, 2020

Would be awesome to use Pug with a formatter in Vue

@timsayshey
Copy link

@octref Did you run into a blocker with the plugin-pug integration? What was the issue?

@octref octref closed this as completed in c57f966 Jun 24, 2020
octref added a commit that referenced this issue Jun 24, 2020
Add prettier-pug and fix region parser. Fix #527
@geoidesic
Copy link

So.. how do I get vetur to format pug?

@homerjam
Copy link

@geoidesic try using prettier maybe - it's working for me using pug in vue sfc's

@geoidesic
Copy link

Looks like I needed to install pug-prettier via npm. Works after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests