mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 20:54:26 +08:00
feat(biome): add support for json and jsonc (#4805)
- adds biome linter for json and jsonc - enables biome by default for json and jsonc - suggests biome as a fixer for json and jsonc
This commit is contained in:
10
ale_linters/json/biome.vim
Normal file
10
ale_linters/json/biome.vim
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
" Description: biome for json files
|
||||||
|
|
||||||
|
call ale#linter#Define('json', {
|
||||||
|
\ 'name': 'biome',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'language': function('ale#handlers#biome#GetLanguage'),
|
||||||
|
\ 'executable': function('ale#handlers#biome#GetExecutable'),
|
||||||
|
\ 'command': '%e lsp-proxy',
|
||||||
|
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
|
||||||
|
\})
|
||||||
10
ale_linters/jsonc/biome.vim
Normal file
10
ale_linters/jsonc/biome.vim
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
" Description: biome for jsonc files
|
||||||
|
|
||||||
|
call ale#linter#Define('jsonc', {
|
||||||
|
\ 'name': 'biome',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'language': function('ale#handlers#biome#GetLanguage'),
|
||||||
|
\ 'executable': function('ale#handlers#biome#GetExecutable'),
|
||||||
|
\ 'command': '%e lsp-proxy',
|
||||||
|
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -39,7 +39,7 @@ let s:default_registry = {
|
|||||||
\ },
|
\ },
|
||||||
\ 'biome': {
|
\ 'biome': {
|
||||||
\ 'function': 'ale#fixers#biome#Fix',
|
\ 'function': 'ale#fixers#biome#Fix',
|
||||||
\ 'suggested_filetypes': ['javascript', 'typescript'],
|
\ 'suggested_filetypes': ['javascript', 'typescript', 'json', 'jsonc'],
|
||||||
\ 'description': 'Fix JavaScript and TypeScript using biome.',
|
\ 'description': 'Fix JavaScript and TypeScript using biome.',
|
||||||
\ },
|
\ },
|
||||||
\ 'black': {
|
\ 'black': {
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ let s:default_ale_linters = {
|
|||||||
\ 'hack': ['hack'],
|
\ 'hack': ['hack'],
|
||||||
\ 'help': [],
|
\ 'help': [],
|
||||||
\ 'inko': ['inko'],
|
\ 'inko': ['inko'],
|
||||||
\ 'json': ['jsonlint', 'spectral', 'vscodejson'],
|
\ 'json': ['biome', 'jsonlint', 'spectral', 'vscodejson'],
|
||||||
\ 'json5': [],
|
\ 'json5': [],
|
||||||
\ 'jsonc': [],
|
\ 'jsonc': ['biome'],
|
||||||
\ 'perl': ['perlcritic'],
|
\ 'perl': ['perlcritic'],
|
||||||
\ 'perl6': [],
|
\ 'perl6': [],
|
||||||
\ 'python': ['flake8', 'mypy', 'pylint', 'pyright', 'ruff'],
|
\ 'python': ['flake8', 'mypy', 'pylint', 'pyright', 'ruff'],
|
||||||
|
|||||||
@@ -2,6 +2,12 @@
|
|||||||
ALE JSON Integration *ale-json-options*
|
ALE JSON Integration *ale-json-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
biome *ale-json-biome*
|
||||||
|
|
||||||
|
Check the docs over at |ale-typescript-biome|.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
clang-format *ale-json-clangformat*
|
clang-format *ale-json-clangformat*
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,12 @@
|
|||||||
ALE JSONC Integration *ale-jsonc-options*
|
ALE JSONC Integration *ale-jsonc-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
biome *ale-jsonc-biome*
|
||||||
|
|
||||||
|
Check the docs over at |ale-typescript-biome|.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
eslint *ale-jsonc-eslint*
|
eslint *ale-jsonc-eslint*
|
||||||
|
|
||||||
|
|||||||
@@ -314,6 +314,7 @@ Notes:
|
|||||||
* `xo`
|
* `xo`
|
||||||
* JSON
|
* JSON
|
||||||
* `VSCode JSON language server`
|
* `VSCode JSON language server`
|
||||||
|
* `biome`
|
||||||
* `clang-format`
|
* `clang-format`
|
||||||
* `cspell`
|
* `cspell`
|
||||||
* `dprint`
|
* `dprint`
|
||||||
@@ -326,6 +327,7 @@ Notes:
|
|||||||
* JSON5
|
* JSON5
|
||||||
* `eslint`
|
* `eslint`
|
||||||
* JSONC
|
* JSONC
|
||||||
|
* `biome`
|
||||||
* `eslint`
|
* `eslint`
|
||||||
* Jsonnet
|
* Jsonnet
|
||||||
* `jsonnet-lint`
|
* `jsonnet-lint`
|
||||||
|
|||||||
@@ -3137,6 +3137,7 @@ documented in additional help files.
|
|||||||
standard..............................|ale-javascript-standard|
|
standard..............................|ale-javascript-standard|
|
||||||
xo....................................|ale-javascript-xo|
|
xo....................................|ale-javascript-xo|
|
||||||
json....................................|ale-json-options|
|
json....................................|ale-json-options|
|
||||||
|
biome.................................|ale-json-biome|
|
||||||
clang-format..........................|ale-json-clangformat|
|
clang-format..........................|ale-json-clangformat|
|
||||||
cspell................................|ale-json-cspell|
|
cspell................................|ale-json-cspell|
|
||||||
dprint................................|ale-json-dprint|
|
dprint................................|ale-json-dprint|
|
||||||
@@ -3148,6 +3149,7 @@ documented in additional help files.
|
|||||||
spectral..............................|ale-json-spectral|
|
spectral..............................|ale-json-spectral|
|
||||||
vscodejson............................|ale-json-vscode|
|
vscodejson............................|ale-json-vscode|
|
||||||
jsonc...................................|ale-jsonc-options|
|
jsonc...................................|ale-jsonc-options|
|
||||||
|
biome.................................|ale-jsonc-biome|
|
||||||
eslint................................|ale-jsonc-eslint|
|
eslint................................|ale-jsonc-eslint|
|
||||||
jsonnet.................................|ale-jsonnet-options|
|
jsonnet.................................|ale-jsonnet-options|
|
||||||
jsonnetfmt............................|ale-jsonnet-jsonnetfmt|
|
jsonnetfmt............................|ale-jsonnet-jsonnetfmt|
|
||||||
|
|||||||
@@ -323,6 +323,7 @@ formatting.
|
|||||||
* [xo](https://github.com/sindresorhus/xo)
|
* [xo](https://github.com/sindresorhus/xo)
|
||||||
* JSON
|
* JSON
|
||||||
* [VSCode JSON language server](https://github.com/hrsh7th/vscode-langservers-extracted)
|
* [VSCode JSON language server](https://github.com/hrsh7th/vscode-langservers-extracted)
|
||||||
|
* [biome](https://biomejs.dev/)
|
||||||
* [clang-format](https://clang.llvm.org/docs/ClangFormat.html)
|
* [clang-format](https://clang.llvm.org/docs/ClangFormat.html)
|
||||||
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) :warning:
|
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) :warning:
|
||||||
* [dprint](https://dprint.dev)
|
* [dprint](https://dprint.dev)
|
||||||
@@ -335,6 +336,7 @@ formatting.
|
|||||||
* JSON5
|
* JSON5
|
||||||
* [eslint](http://eslint.org/) :warning:
|
* [eslint](http://eslint.org/) :warning:
|
||||||
* JSONC
|
* JSONC
|
||||||
|
* [biome](https://biomejs.dev/)
|
||||||
* [eslint](http://eslint.org/) :warning:
|
* [eslint](http://eslint.org/) :warning:
|
||||||
* Jsonnet
|
* Jsonnet
|
||||||
* [jsonnet-lint](https://jsonnet.org/learning/tools.html)
|
* [jsonnet-lint](https://jsonnet.org/learning/tools.html)
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Execute(The defaults for the inko filetype should be correct):
|
|||||||
AssertEqual [], GetLinterNames('inko')
|
AssertEqual [], GetLinterNames('inko')
|
||||||
|
|
||||||
Execute(The defaults for the json filetype should be correct):
|
Execute(The defaults for the json filetype should be correct):
|
||||||
AssertEqual ['jsonlint', 'spectral', 'vscodejson'], GetLinterNames('json')
|
AssertEqual ['biome', 'jsonlint', 'spectral', 'vscodejson'], GetLinterNames('json')
|
||||||
|
|
||||||
let g:ale_linters_explicit = 1
|
let g:ale_linters_explicit = 1
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ Execute(The defaults for the json5 filetype should be correct):
|
|||||||
AssertEqual [], GetLinterNames('json5')
|
AssertEqual [], GetLinterNames('json5')
|
||||||
|
|
||||||
Execute(The defaults for the jsonc filetype should be correct):
|
Execute(The defaults for the jsonc filetype should be correct):
|
||||||
AssertEqual [], GetLinterNames('jsonc')
|
AssertEqual ['biome'], GetLinterNames('jsonc')
|
||||||
|
|
||||||
Execute(The defaults for the perl filetype should be correct):
|
Execute(The defaults for the perl filetype should be correct):
|
||||||
AssertEqual ['perlcritic'], GetLinterNames('perl')
|
AssertEqual ['perlcritic'], GetLinterNames('perl')
|
||||||
|
|||||||
Reference in New Issue
Block a user