arijs / prettier-miscellaneous

Prettier is an opinionated JavaScript formatter.
https://jlongster.github.io/prettier/
MIT License
158 stars 14 forks source link

.vue files #28

Open travisstaloch opened 7 years ago

travisstaloch commented 7 years ago

This doesn't seem to be prettying my .vue files. Is this possible? If so, what configuration must I set to set to make it work?

These don't seem to work:

  "prettier.javascriptEnable": [
    "javascript",
    "javascriptreact",
    "vue"
  ],
  "prettier.cssEnable": [
    "css",
    "less",
    "scss",
    "postcss",
    "vue"
  ]
remimarsal commented 7 years ago

@travisstaloch where does this configuration come from ?

travisstaloch commented 7 years ago

Oops I should have mentioned this is from vscode user settings file. Adding "vue" was only a shot in the dark after the prettier configurations didn't produce any effect.

remimarsal commented 7 years ago

Alright, what extension are you using?

travisstaloch commented 7 years ago

Prettier Now

remimarsal commented 7 years ago

Great! Did you install any extension to detect Vue files?

travisstaloch commented 7 years ago

Thank you. Yes, I've been using Vetur for a bit. I had been using it with Prettier - JavaScript formatter for sometime and it was working. I changed because Prettier Now offered more configuration options.

remimarsal commented 7 years ago

Yes the other one seems to be discontinued. Ok I'll give Vetur a shot and see what's happening. I actually never tried the extension on a Vue file!

remimarsal commented 7 years ago

Ok the issue is not the language ID which is indeed vue. Vue syntax is not yet supported by the official Prettier. (https://github.com/prettier/prettier/issues/2097)

travisstaloch commented 7 years ago

Oh I see. Well thanks a lot for looking! So this project must depend on prettier then. Hope they get vue support added soon.

remimarsal commented 7 years ago

You're welcome! :wink:

soccer99 commented 6 years ago

Vue is now supported on Prettier, can you add the support here?