https://github.com/malobre/dprint-plugin-vue
Format Vue SFC
https://github.com/malobre/dprint-plugin-vue
dprint dprint-plugin
Last synced: 5 months ago
JSON representation
Format Vue SFC
- Host: GitHub
- URL: https://github.com/malobre/dprint-plugin-vue
- Owner: malobre
- License: mit
- Created: 2022-01-25T00:46:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-07T13:36:50.000Z (over 3 years ago)
- Last Synced: 2024-05-01T18:29:35.784Z (about 2 years ago)
- Topics: dprint, dprint-plugin
- Language: Rust
- Homepage:
- Size: 71.3 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# dprint-plugin-vue
Format Vue SFC.
This plugin format root-level blocks through `dprint`, meaning you will need to
install plugins for the languages contained in your Vue SFCs.
## Block default language
Unless a `lang` attribute is present:
| Block | Default |
| ---------- | ------- |
| `script` | `js` |
| `template` | `html` |
| `style` | `css` |
## Usage
[Install](https://dprint.dev/install) and [setup](https://dprint.dev/setup)
dprint, then:
1. Run
```shell
dprint config add malobre/vue
```
2. Install plugins for the languages contained in your vue files.
3. Ensure `.vue` file extensions are matched in an `includes` pattern:
```jsonc
{
// -- snip --
"includes": [
"**/*.vue"
]
}
```
4. Add a `vue` configuration property if desired:
```jsonc
{
// -- snip --
"vue": {
// vue config goes here
}
}
```
## Configuration
| Key | Default | Description |
| ---------------- | ------- | ------------------------------------------ |
| `indentTemplate` | `true` | Indent the content of the `` tag |
| `indentScript` | `false` | Indent the content of the `` tag |
| `indentWidth` | `2` | Width of the indentation |
| `useTabs` | `false` | Use tabs for indentation |
## Building
Run
```shell
cargo build --release --target=wasm32-unknown-unknown
```