@golar-rstack/rspack
v0.2.0
Published
Run golar type checking and linting in a separate process as an Rspack plugin
Maintainers
Readme
@golar-rstack/rspack
Run golar type checking and type-aware linting in a separate process as an Rspack plugin.
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.
Using Rsbuild? Use @golar-rstack/rsbuild
instead.
Install
pnpm add -D @golar-rstack/rspack 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({})// rspack.config.ts
import { GolarRspackPlugin } from '@golar-rstack/rspack'
export default {
plugins: [new GolarRspackPlugin()],
}In watch mode the check runs asynchronously and is pushed to the dev server's error overlay. In a one-off 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 the compilercontextand is what selects the golar config, since golar has no--configflag.
Requirements
- Node.js >= 22.12
golarinstalled in the project
License
MIT
