vue-prettier
Prettify .vue files with Prettier
Last updated 2 years ago by oligot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vue-prettier 
SYNC missed versions from official npm registry.

vue-prettier

Prettify .vue files with Prettier

Why

  • Uses vue-template-compiler instead of regexp to parse .vue files
  • same CLI args as prettier (can be used as a drop-in replacement)

Note that this is a temporary solution while waiting for Prettier to support Vue.js.

Install

$ npm install --global vue-prettier

Make sure that you also have vue-template-compiler as a dev dependency (which should be the case if you use vue-loader or rollup-plugin-vue)

$ npm install --save-dev vue-template-compiler

Usage

CLI

$ vue-prettier --write my-component.vue

Editor integration

Vim

Install vim-prettier and set the prettier CLI executable path

let g:prettier#exec_cmd_path = "~/path/to/cli/vue-prettier"

Webstorm

Follow the official Webstorm Setup and set the Program to vue-prettier

Visual Studio Code

Visual Studio Code supports formatting .vue files thanks to the Vetur extension. More informations can be found in the formatting page.

Credits

This project wouldn't be possible without the great work on these projects

License

MIT © Olivier Ligot

Current Tags

  • 0.2.0                                ...           latest (2 years ago)

2 Versions

  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 3
Last Day 0
Last Week 1
Last Month 8
Dependencies (6)
Dev Dependencies (4)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |