自版本 v1.8.0 以来,Biome 的 CLI 接受 --reporter
参数,允许更改诊断和摘要打印到终端的方式。
¥Since version v1.8.0 , Biome’s CLI accepts a --reporter
argument that allows to change how diagnostics and summary are printed to terminal.
¥Summary
biome check --reporter=summary
Formatter ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The following files needs to be formatted:
Organize Imports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The following files needs to have their imports sorted:
Analyzer ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Some analyzer rules were triggered
lint/suspicious/noImplicitAnyLet 12 (12 error(s), 0 warning(s), 0 info(s))
lint/suspicious/noDoubleEquals 8 (8 error(s), 0 warning(s), 0 info(s))
lint/suspicious/noRedeclare 12 (12 error(s), 0 warning(s), 0 info(s))
lint/suspicious/noDebugger 20 (20 error(s), 0 warning(s), 0 info(s))
它以 JSON 格式发出摘要和诊断信息。
¥It emits the summary and diagnostics in a JSON format.
与 --reporter=json
相同,它以 JSON 格式发出摘要和诊断信息,并使用当前 JSON 格式选项(配置文件或默认值)对输出进行格式化。
¥Same as --reporter=json
, it emits the summary and diagnostics in a JSON format, and the output is formatted using the current JSON formatting options (configuration file or defaults).
biome ci --reporter=json-pretty
在 GitHub 工作流中使用此报告器。在 PR 工作流中正确配置后,GitHub 将为发出的每个信息/警告/错误打印一条消息。
¥Use this reporter in a GitHub workflow. When properly configured in a PR workflow, GitHub will print a message for each info/warning/error emitted.
biome ci --reporter=github
::error title=lint/suspicious/noDoubleEquals,file=main.ts,line=4,endLine=4,col=3,endColumn=5::Use === instead of ==
::error title=lint/suspicious/noDebugger,file=main.ts,line=6,endLine=6,col=1,endColumn=9::This is an unexpected use of the debugger statement.
::error title=lint/nursery/noEvolvingAny,file=main.ts,line=8,endLine=8,col=5,endColumn=6::This variable's type is not allowed to evolve implicitly, leading to potential any types.
biome check --reporter=junit
<? xml version = " 1.0 " encoding = " UTF-8 " ?>
< testsuites name = " Biome " tests = " 16 " failures = " 16 " errors = " 20 " time = " <TIME> " >
< testsuite name = " main.ts " tests = " 1 " disabled = " 0 " errors = " 0 " failures = " 1 " package = " org.biome " >
< testcase name = " org.biome.lint.suspicious.noDoubleEquals " line = " 4 " column = " 3 " >
< failure message = " Use === instead of ==. == is only allowed when comparing against `null` " > line 3, col 2, Use === instead of ==. == is only allowed when comparing against `null` </ failure >
< testsuite name = " main.ts " tests = " 1 " disabled = " 0 " errors = " 0 " failures = " 1 " package = " org.biome " >
< testcase name = " org.biome.lint.suspicious.noDebugger " line = " 6 " column = " 1 " >
< failure message = " This is an unexpected use of the debugger statement. " > line 5, col 0, This is an unexpected use of the debugger statement. </ failure >
< testsuite name = " main.ts " tests = " 1 " disabled = " 0 " errors = " 0 " failures = " 1 " package = " org.biome " >
< testcase name = " org.biome.lint.nursery.noEvolvingAny " line = " 8 " column = " 5 " >
< failure message = " This variable's type is not allowed to evolve implicitly, leading to potential any types. " > line 7, col 4, This variable's type is not allowed to evolve implicitly, leading to potential any types. </ failure >