@golar-rstack/rsbuild
v0.2.0
Published
Run golar type checking and linting in a separate process as an Rsbuild plugin
Maintainers
Readme
@golar-rstack/rsbuild
Run golar type checking and type-aware linting alongside your Rsbuild build, in a separate process.
Because golar is built on typescript-go and understands embedded languages,
type errors inside .vue, .svelte, .astro and .gts files are reported at
their real position in the source file.
Install
pnpm add -D @golar-rstack/rsbuild golarUsage
Create golar.config.ts in your project root. golar discovers it relative to
its working directory:
import { defineConfig } from 'golar/unstable'
import '@golar/vue'
export default defineConfig({})// rsbuild.config.ts
import { pluginGolar } from '@golar-rstack/rsbuild'
import { defineConfig } from '@rsbuild/core'
import { pluginVue } from '@rsbuild/plugin-vue'
export default defineConfig({
plugins: [pluginVue(), pluginGolar()],
})In dev the check runs asynchronously so it never delays HMR; results land in
the terminal and the browser error overlay. In build the compilation waits for
golar, so type errors fail the build.
Options
See the repository README for the full list. Two worth knowing up front:
lintSeveritydefaults to'warning', because golar exits 0 when only lint rules fire.cwddefaults to Rsbuild'srootPathand is what selects the golar config, since golar has no--configflag.
Requirements
- Node.js >= 22.12
golarinstalled in the project
License
MIT
