Vue project
Setting up Markuplint for a Vue project.
What you need
Install Markuplint with the Vue parser and Vue spec:
- npm
- Yarn
- pnpm
- Bun
npm install -D markuplint @markuplint/vue-parser @markuplint/vue-spec
yarn add --dev markuplint @markuplint/vue-parser @markuplint/vue-spec
pnpm add -D markuplint @markuplint/vue-parser @markuplint/vue-spec
bun add --dev markuplint @markuplint/vue-parser @markuplint/vue-spec
Configuration
.markuplintrc
{
"extends": ["markuplint:recommended-vue"],
"parser": {
"\\.vue$": "@markuplint/vue-parser"
},
"specs": {
"\\.vue$": "@markuplint/vue-spec"
}
}
This configuration:
- Applies the recommended-vue preset (includes all base presets + Vue-specific rules like
no-hard-code-id) - Parses
.vuefiles with the Vue parser - Recognizes Vue-specific attributes and directives (
v-if,v-for,:key,@click, etc.) via the Vue spec
With Pretenders
Scanning needs @markuplint/pretenders, which markuplint does not install:
- npm
- Yarn
- pnpm
- Bun
npm install -D @markuplint/pretenders
yarn add --dev @markuplint/pretenders
pnpm add -D @markuplint/pretenders
bun add --dev @markuplint/pretenders
If you want Markuplint to validate your custom components as if they were native HTML elements, add the Pretenders configuration. We recommend using automatic scanning — it discovers component-to-element mappings from your source files, so you don't need to maintain them manually:
.markuplintrc
{
"extends": ["markuplint:recommended-vue"],
"parser": {
"\\.vue$": "@markuplint/vue-parser"
},
"specs": {
"\\.vue$": "@markuplint/vue-spec"
},
"pretenders": {
"scan": [
{
"files": "./src/components/**/*.vue"
}
]
}
}
tip
The scan feature was introduced in v5. It replaces the need to manually list every component mapping — just point it at your component directory and Markuplint handles the rest.