Skip to content

Vue

Use @golar/vue to add Vue support to Golar.

Make sure vue is installed in your project.

Then install the Golar plugin:

Terminal window
npm i -D @golar/vue

Add the plugin import to golar.config.ts:

golar.config.ts
import { defineConfig } from 'golar/unstable'
import '@golar/vue'
export default defineConfig({})

Once the plugin is registered, run Golar in the default mode:

Terminal window
npx golar

This command loads golar.config.ts, runs linting, and then type-checks your project files.

If you need declaration emit for Vue files, use tsc mode:

Terminal window
npx golar tsc --declaration --emitDeclarationOnly

This emits .vue.d.ts files for Vue components.

Vue Language Tools supports <template lang="pug"> through @vue/language-plugin-pug.

Install the Pug language plugin:

Terminal window
npm i -D @vue/language-plugin-pug

Then add it to vueCompilerOptions.plugins in tsconfig.json:

tsconfig.json
{
"vueCompilerOptions": {
"plugins": ["@vue/language-plugin-pug"]
}
}

Vue Language Tools supports specifying VitePress file extensions via vitePressExtensions in tsconfig.json.

To enable typechecking support for VitePress .md files, it’s required to explicitly configure the Vue plugin:

golar.config.ts
import { defineConfig } from 'golar/unstable'
import * as vue from '@golar/vue'
vue.configure({
vitePressExtensions: ['.md'],
})
export default defineConfig({})
tsconfig.json
{
"vueCompilerOptions": {
"vitePressExtensions": [".md"]
}
}

Golar’s Vue support is built on the official @vue/language-core package.