VS Code package to format your Angular, Vue or pure HTML5 templates.
1. CMD + Shift + P -> Format Document
OR
1. Select the text you want to Prettify
2. CMD + Shift + P -> Format Selection
If you don't like the defaults, you can rebind editor.action.formatDocument
and editor.action.formatSelection
in the keyboard shortcuts menu of vscode.
Respects editor.formatOnSave
setting.
You can turn on format-on-save on a per-language basis by scoping the setting:
// Set the default
"editor.formatOnSave": false,
// Enable per-language
"[javascript]": {
"editor.formatOnSave": true
}
The space width of your indentation level (default: 2)
Use tabs instead spaces for indentation (default: false)
Use different maximum line length (default: 80)
Use prettier for embedded content (default: true)
Use custom prettier settings for embedded content (default: local config)
Use single quote instead double quotes (default: false)
Force to wrap attributes (when it has multiple, default: false)
Sort attributes alphabetically (default: false)
By default the resolution algorithm of prettier is used:
- Prettier configuration file
.editorconfig
Or if no prettier configuration file exist
.editorconfig
Feel free to open issues or PRs!
- Open this repository inside VSCode
- Debug sidebar
Launch Extension
Tests open a VSCode instance and load ./testProject
as root workspace.
- Open this repository inside VSCode
- Debug sidebar
Launch Tests
OR
Without having an instance VSCode running (or it won't start)
npm run test