Skip to content

Commit d0dd561

Browse files
Konfektchrisbra
authored andcommitted
runtime(compiler): add biome linter
closes: #18685 Signed-off-by: Konfekt <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent f46616f commit d0dd561

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

.github/MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ runtime/colors/torte.vim @habamax @romainl @neutaaaaan
4545
runtime/colors/wildcharm.vim @habamax @romainl @neutaaaaan
4646
runtime/colors/zaibatsu.vim @habamax @romainl @neutaaaaan
4747
runtime/colors/zellner.vim @habamax @romainl @neutaaaaan
48+
runtime/compiler/biome.vim @Konfekt
4849
runtime/compiler/checkstyle.vim @dkearns
4950
runtime/compiler/cm3.vim @dkearns
5051
runtime/compiler/cucumber.vim @tpope

runtime/compiler/biome.vim

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
" Vim compiler file
2+
" Compiler: Biome (= linter for JavaScript, TypeScript, JSX, TSX, JSON,
3+
" JSONC, HTML, Vue, Svelte, Astro, CSS, GraphQL and GritQL files)
4+
" Maintainer: @Konfekt
5+
" Last Change: 2025 Nov 12
6+
if exists("current_compiler") | finish | endif
7+
let current_compiler = "biome"
8+
9+
let s:cpo_save = &cpo
10+
set cpo&vim
11+
12+
exe 'CompilerSet makeprg=' .. escape('biome check --linter-enabled=true --formatter-enabled=false --assist-enabled=false --reporter=github '
13+
\ .. get(b:, 'biome_makeprg_params', get(g:, 'biome_makeprg_params', '')), ' \|"')
14+
15+
CompilerSet errorformat=::%trror%.%#file=%f\\,line=%l\\,%.%#col=%c\\,%.%#::%m
16+
CompilerSet errorformat+=::%tarning%.%#file=%f\\,line=%l\\,%.%#col=%c\\,%.%#::%m
17+
CompilerSet errorformat+=::%totice%.%#file=%f\\,line=%l\\,%.%#col=%c\\,%.%#::%m
18+
CompilerSet errorformat+=%-G\\s%#
19+
CompilerSet errorformat+=%-Gcheck\ %.%#
20+
CompilerSet errorformat+=%-G%.%#Some\ errors\ were\ emitted\ while\ running\ checks%.
21+
22+
let &cpo = s:cpo_save
23+
unlet s:cpo_save

runtime/doc/quickfix.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,17 @@ For writing a compiler plugin, see |write-compiler-plugin|.
12811281

12821282
Use the |compiler-make| plugin to undo the effect of a compiler plugin.
12831283

1284+
BIOME *compiler-biome* *quickfix-biome*
1285+
1286+
Biome check lints JavaScript, TypeScript, JSX, TSX, JSON, JSONC, HTML, Vue,
1287+
Svelte, Astro, CSS, GraphQL and GritQL files.
1288+
1289+
Commonly used compiler options can be added to 'makeprg' by setting the
1290+
b/g:biome_makeprg_params variable. For example (global default is ""): >
1291+
1292+
let b:biome_makeprg_params = "--diagnostic-level=error --staged"
1293+
1294+
12841295
CPPCHECK *quickfix-cppcheck* *compiler-cppcheck*
12851296

12861297
Use g/b:`c_cppcheck_params` to set cppcheck parameters. The global

runtime/doc/tags

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6739,6 +6739,7 @@ compile-changes-7 version7.txt /*compile-changes-7*
67396739
compile-changes-8 version8.txt /*compile-changes-8*
67406740
compile-changes-9 version9.txt /*compile-changes-9*
67416741
compile-changes-9.2 version9.txt /*compile-changes-9.2*
6742+
compiler-biome quickfix.txt /*compiler-biome*
67426743
compiler-compaqada ft_ada.txt /*compiler-compaqada*
67436744
compiler-cppcheck quickfix.txt /*compiler-cppcheck*
67446745
compiler-decada ft_ada.txt /*compiler-decada*
@@ -9932,6 +9933,7 @@ quickfix quickfix.txt /*quickfix*
99329933
quickfix-6 version6.txt /*quickfix-6*
99339934
quickfix-ID quickfix.txt /*quickfix-ID*
99349935
quickfix-buffer quickfix.txt /*quickfix-buffer*
9936+
quickfix-biome quickfix.txt /*quickfix-biome*
99359937
quickfix-changedtick quickfix.txt /*quickfix-changedtick*
99369938
quickfix-context quickfix.txt /*quickfix-context*
99379939
quickfix-cppcheck quickfix.txt /*quickfix-cppcheck*

0 commit comments

Comments
 (0)