prettier-plugin-vue

A Prettier plugin that extends default Vue files formatting with additional options.
537,218
Install
npm install prettier-plugin-vue
Latest Version:1.1.6
License:MIT
Last Updated:Feb 12, 2023
Links: GitHub  ·  npm
Maintainer: voqse

prettier-plugin-vue

test npm

A lightweight plugin that allows Prettier to ignore certain blocks of Vue Single File Components (SFCs) independently of the IDE and its plugins. This can be useful if you want to setup Prettier in combination with other linters such as eslint or stylelint.

Installation

To get started, just install prettier-plugin-vue as a dev-dependency:

npm install prettier prettier-plugin-vue --save-dev

This plugin follows Prettier’s autoloading convention, so as long as you’ve got Prettier set up in your project, it’ll start working automatically as soon as it’s installed.

Note that plugin autoloading is not supported when using certain package managers, such as pnpm or Yarn PnP. In this case you may need to add the plugin to your Prettier config explicitly:

// prettier.config.js
module.exports = {
  plugins: [require('prettier-plugin-vue')],
}

Configuration

vueExcludeBlocks

Allows you to specify a list of blocks strings to ignore while formatting Vue SFC files.

Default CLI Override API Override
['style'] --vue-exclude-blocks <string> vueExcludeBlocks: <string>

Note that by default this plugin ignores <style> blocks to avoid interfering with stylelint.

Example .prettierrc

{
  vueExcludeBlocks: ["style", "template"]
}

Related Packages

@21cnfe/onekit-mp-cli

小程序框架开发工具

1,063
prettier-plugin-organize-attributes

Organize your HTML attributes autmatically with Prettier 🧼

7,614,373 241
squidex-prettier-plugin-organize-attributes

Organize your HTML attributes autmatically with Prettier 🧼

4,439 241
strict-tailwind-order

Prettier plugin for strict functional Tailwind CSS class ordering and family-saf...

1,600 0
@nikolastojicic/prettier-plugin-organize-attributes

Organize your HTML attributes autmatically with Prettier 🧼

1,449 241

Version History

Version Released License
1.1.6 MIT
1.1.5 MIT
1.1.4 MIT
1.1.3 MIT
1.1.2 MIT