CLI
¥Command summary
Biome 官方 CLI。使用它来检查项目的健康状况或运行它来检查单个文件。
¥Biome official CLI. Use it to check the health of your project or run it to check single files.
用法:biome COMMAND ...
¥Usage: biome COMMAND ...
可用选项:
¥Available options:
-
-h、--help— 打印帮助信息¥
-h,--help— Prints help information -
-V、--version— 打印版本信息¥
-V,--version— Prints version information
可用命令:
¥Available commands:
-
version— 显示 Biome 版本信息并退出。¥
version— Shows the Biome version information and quit. -
rage— 打印调试信息。¥
rage— Prints information for debugging. -
start— 启动 Biome 守护进程服务器进程。¥
start— Starts the Biome daemon server process. -
stop— 停止 Biome 守护进程服务器进程。¥
stop— Stops the Biome daemon server process. -
check— 对请求的文件运行格式化程序、linter 和导入排序。¥
check— Runs formatter, linter and import sorting to the requested files. -
lint— 在一组文件上运行各种检查。¥
lint— Run various checks on a set of files. -
format— 在一组文件上运行格式化程序。¥
format— Run the formatter on a set of files. -
ci— 在 CI 环境中使用的命令。对请求的文件运行格式化程序、linter 和导入排序。¥
ci— Command to use in CI environments. Runs formatter, linter and import sorting to the requested files. -
init— 引导新的 biome 项目。创建具有一些默认值的配置文件。¥
init— Bootstraps a new biome project. Creates a configuration file with some defaults. -
lsp-proxy— 充当 stdin/stdout 上的语言服务器协议的服务器。¥
lsp-proxy— Acts as a server for the Language Server Protocol over stdin/stdout. -
migrate— 发生重大更改时更新配置。¥
migrate— Updates the configuration when there are breaking changes. -
search— EXPERIMENTAL:在项目中搜索 Grit 模式。¥
search— EXPERIMENTAL: Searches for Grit patterns across a project. -
explain— 显示 CLI 各个方面的文档。¥
explain— Shows documentation of various aspects of the CLI. -
clean— 清除守护进程发出的日志。¥
clean— Cleans the logs emitted by the daemon.
biome version
Section titled “biome version”显示 Biome 版本信息并退出。
¥Shows the Biome version information and quit.
用法:biome version
¥Usage: biome version
应用于所有命令的全局选项
¥Global options applied to all commands
-
--colors=<off|force>— 设置标记的格式化模式:“off” 将所有内容打印为纯文本,即使确定控制台输出不兼容,“force” 也会强制使用 ANSI 格式化标记¥
--colors=<off|force>— Set the formatting mode for markup: “off” prints everything as plain text, “force” forces the formatting of markup using ANSI even if the console output is determined to be incompatible -
--use-server— 连接到 Biome 守护进程服务器的正在运行的实例。¥
--use-server— Connect to a running instance of the Biome daemon server. -
--verbose— 打印其他诊断信息,某些诊断信息会显示更多信息。此外,打印出处理了哪些文件以及修改了哪些文件。¥
--verbose— Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified. -
--config-path=PATH— 设置配置文件的文件路径,或查找biome.json或biome.jsonc的目录路径。如果使用,它将禁用默认配置文件解析。¥
--config-path=PATH— Set the file path to the configuration file, or the directory path to findbiome.jsonorbiome.jsonc. If used, it disables the default configuration file resolution.使用环境变量
BIOME_CONFIG_PATH¥Uses environment variable
BIOME_CONFIG_PATH -
--max-diagnostics=<none|<NUMBER>>— 限制显示的诊断数量。当提供none时,限制被解除。¥
--max-diagnostics=<none|<NUMBER>>— Cap the amount of diagnostics displayed. Whennoneis provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-parse-errors— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-parse-errors— Skip over files containing syntax errors instead of emitting an error diagnostic. -
--no-errors-on-unmatched— 如果在执行命令期间没有处理任何文件,则静音将发出的错误。¥
--no-errors-on-unmatched— Silence errors that would be emitted in case no files were processed during the execution of the command. -
--error-on-warnings— 如果某些诊断发出警告,则告诉 Biome 退出并显示错误代码。¥
--error-on-warnings— Tell Biome to exit with an error code if some diagnostics emit warnings. -
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— 允许更改诊断和摘要的报告方式。¥
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— Allows to change how diagnostics and summary are reported. -
--log-file=ARG— 日志消息重定向的可选路径。¥
--log-file=ARG— Optional path to redirect log messages to.如果省略,日志将输出到标准输出 (stdout)。
¥If omitted, logs are printed to stdout.
-
--log-level=<none|debug|info|warn|error>— 日志记录级别。按从最详细到最不详细的顺序:调试、信息、警告、错误。¥
--log-level=<none|debug|info|warn|error>— The level of logging. In order, from the most verbose to the least verbose: debug, info, warn, error.值
none不会显示任何日志记录。¥The value
nonewon’t show any logging.[默认:无]
¥[default: none]
-
--log-kind=<pretty|compact|json>— 日志应如何显示。¥
--log-kind=<pretty|compact|json>— How the log should look like.[默认:漂亮]
¥[default: pretty]
-
--diagnostic-level=<info|warn|error>— 要显示的诊断级别。按从最低到最重要的顺序:信息、警告、错误。传递--diagnostic-level=error将导致 Biome 仅打印仅包含错误的诊断信息。¥
--diagnostic-level=<info|warn|error>— The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing--diagnostic-level=errorwill cause Biome to print only diagnostics that contain only errors.[默认:信息]
¥[default: info]
可用选项:
¥Available options:
-
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome rage
Section titled “biome rage”打印信息以供调试。
¥Prints information for debugging.
用法:biome rage [--daemon-logs] [--formatter] [--linter]
¥Usage: biome rage [--daemon-logs] [--formatter] [--linter]
应用于所有命令的全局选项
¥Global options applied to all commands
-
--colors=<off|force>— 设置标记的格式化模式:“off” 将所有内容打印为纯文本,即使确定控制台输出不兼容,“force” 也会强制使用 ANSI 格式化标记¥
--colors=<off|force>— Set the formatting mode for markup: “off” prints everything as plain text, “force” forces the formatting of markup using ANSI even if the console output is determined to be incompatible -
--use-server— 连接到 Biome 守护进程服务器的正在运行的实例。¥
--use-server— Connect to a running instance of the Biome daemon server. -
--verbose— 打印其他诊断信息,某些诊断信息会显示更多信息。此外,打印出处理了哪些文件以及修改了哪些文件。¥
--verbose— Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified. -
--config-path=PATH— 设置配置文件的文件路径,或查找biome.json或biome.jsonc的目录路径。如果使用,它将禁用默认配置文件解析。¥
--config-path=PATH— Set the file path to the configuration file, or the directory path to findbiome.jsonorbiome.jsonc. If used, it disables the default configuration file resolution.使用环境变量
BIOME_CONFIG_PATH¥Uses environment variable
BIOME_CONFIG_PATH -
--max-diagnostics=<none|<NUMBER>>— 限制显示的诊断数量。当提供none时,限制被解除。¥
--max-diagnostics=<none|<NUMBER>>— Cap the amount of diagnostics displayed. Whennoneis provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-parse-errors— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-parse-errors— Skip over files containing syntax errors instead of emitting an error diagnostic. -
--no-errors-on-unmatched— 如果在执行命令期间没有处理任何文件,则静音将发出的错误。¥
--no-errors-on-unmatched— Silence errors that would be emitted in case no files were processed during the execution of the command. -
--error-on-warnings— 如果某些诊断发出警告,则告诉 Biome 退出并显示错误代码。¥
--error-on-warnings— Tell Biome to exit with an error code if some diagnostics emit warnings. -
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— 允许更改诊断和摘要的报告方式。¥
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— Allows to change how diagnostics and summary are reported. -
--log-file=ARG— 日志消息重定向的可选路径。¥
--log-file=ARG— Optional path to redirect log messages to.如果省略,日志将输出到标准输出 (stdout)。
¥If omitted, logs are printed to stdout.
-
--log-level=<none|debug|info|warn|error>— 日志记录级别。按从最详细到最不详细的顺序:调试、信息、警告、错误。¥
--log-level=<none|debug|info|warn|error>— The level of logging. In order, from the most verbose to the least verbose: debug, info, warn, error.值
none不会显示任何日志记录。¥The value
nonewon’t show any logging.[默认:无]
¥[default: none]
-
--log-kind=<pretty|compact|json>— 日志应如何显示。¥
--log-kind=<pretty|compact|json>— How the log should look like.[默认:漂亮]
¥[default: pretty]
-
--diagnostic-level=<info|warn|error>— 要显示的诊断级别。按从最低到最重要的顺序:信息、警告、错误。传递--diagnostic-level=error将导致 Biome 仅打印仅包含错误的诊断信息。¥
--diagnostic-level=<info|warn|error>— The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing--diagnostic-level=errorwill cause Biome to print only diagnostics that contain only errors.[默认:信息]
¥[default: info]
可用选项:
¥Available options:
-
--daemon-logs— 打印 Biome 守护进程服务器日志¥
--daemon-logs— Prints the Biome daemon server logs -
--formatter— 打印已应用的格式化程序选项¥
--formatter— Prints the formatter options applied -
--linter— 打印已应用的 linter 选项¥
--linter— Prints the linter options applied -
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome start
Section titled “biome start”启动 Biome 守护进程服务器进程。
¥Starts the Biome daemon server process.
用法:biome start
¥Usage: biome start
可用选项:
¥Available options:
-
--log-prefix-name=STRING— 允许更改应用于日志文件名的前缀。¥
--log-prefix-name=STRING— Allows to change the prefix applied to the file name of the logs.使用环境变量
BIOME_LOG_PREFIX_NAME¥Uses environment variable
BIOME_LOG_PREFIX_NAME[默认:server.log]
¥[default: server.log]
-
--log-path=PATH— 允许更改存储日志的文件夹。¥
--log-path=PATH— Allows to change the folder where logs are stored.使用环境变量
BIOME_LOG_PATH¥Uses environment variable
BIOME_LOG_PATH -
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome stop
Section titled “biome stop”停止 Biome 守护进程服务器进程。
¥Stops the Biome daemon server process.
用法:biome stop
¥Usage: biome stop
可用选项:
¥Available options:
-
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome check
Section titled “biome check”对请求的文件运行格式化程序、linter 和导入排序。
¥Runs formatter, linter and import sorting to the requested files.
用法:biome check [--write] [--unsafe] [--assist-enabled=<true|false>] [--enforce-assist=<true|false>] [--format-with-errors=<true|false>] [--staged] [--changed] [--since=REF] [PATH]…
¥Usage: biome check [--write] [--unsafe] [--assist-enabled=<true|false>] [--enforce-assist=<true|false>] [--format-with-errors=<true|false>] [--staged] [--changed] [--since=REF] [PATH]…
更改 JSON 解析器行为的选项
¥Options that changes how the JSON parser behaves
-
--json-parse-allow-comments=<true|false>— 允许解析.json文件中的注释。¥
--json-parse-allow-comments=<true|false>— Allow parsing comments in.jsonfiles -
--json-parse-allow-trailing-commas=<true|false>— 允许解析.json文件中的尾随逗号。¥
--json-parse-allow-trailing-commas=<true|false>— Allow parsing trailing commas in.jsonfiles
文件 biome.json 中包含的配置
¥The configuration that is contained inside the file biome.json
-
--vcs-enabled=<true|false>— Biome 是否应将自身与 VCS 客户端集成¥
--vcs-enabled=<true|false>— Whether Biome should integrate itself with the VCS client -
--vcs-client-kind=<git>— 客户端类型。¥
--vcs-client-kind=<git>— The kind of client. -
--vcs-use-ignore-file=<true|false>— Biome 是否应使用 VCS 忽略文件。当 [true] 时,Biome 将忽略忽略文件中指定的文件。¥
--vcs-use-ignore-file=<true|false>— Whether Biome should use the VCS ignore file. When [true], Biome will ignore the files specified in the ignore file. -
--vcs-root=PATH— Biome 应检查 VCS 文件的文件夹。默认情况下,Biome 将使用找到biome.json的同一文件夹。¥
--vcs-root=PATH— The folder where Biome should check for VCS files. By default, Biome will use the same folder wherebiome.jsonwas found.如果 Biome 找不到配置,它将尝试使用当前工作目录。如果找不到当前工作目录,Biome 将不会使用 VCS 集成,并且将发出诊断
¥If Biome can’t find the configuration, it will attempt to use the current working directory. If no current working directory can’t be found, Biome won’t use the VCS integration, and a diagnostic will be emitted
-
--vcs-default-branch=BRANCH— 项目的主要分支¥
--vcs-default-branch=BRANCH— The main branch of the project -
--files-max-size=NUMBER— 源代码文件的最大允许大小(以字节为单位)。出于性能原因,超过此限制的文件将被忽略。默认为 1 MiB¥
--files-max-size=NUMBER— The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB -
--files-ignore-unknown=<true|false>— 指示 Biome 在处理未知文件时不要发出诊断信息。¥
--files-ignore-unknown=<true|false>— Tells Biome to not emit diagnostics when handling files that it doesn’t know -
--format-with-errors=<true|false>— 如果给定文件存在语法错误,是否允许继续格式化¥
--format-with-errors=<true|false>— Whether formatting should be allowed to proceed if a given file has syntax errors -
--indent-style=<tab|space>— 缩进样式。¥
--indent-style=<tab|space>— The indent style. -
--indent-width=NUMBER— 缩进大小,默认为 2¥
--indent-width=NUMBER— The size of the indentation, 2 by default -
--line-ending=<lf|crlf|cr|auto>— 行尾类型。¥
--line-ending=<lf|crlf|cr|auto>— The type of line ending. -
--line-width=NUMBER— 行的最大宽度是多少。默认为 80。¥
--line-width=NUMBER— What’s the max width of a line. Defaults to 80. -
--attribute-position=<multiline|auto>— 类 HTML 语言中的属性位置样式。默认为 auto。¥
--attribute-position=<multiline|auto>— The attribute position style in HTML-ish languages. Defaults to auto. -
--bracket-same-line=<true|false>— 将多行 HTML 或 HTML 的>值设置为其他值。 JSX 元素位于最后一行的末尾,而不是单独位于下一行(不适用于自闭合元素)。¥
--bracket-same-line=<true|false>— Put the>of a multi-line HTML or JSX element at the end of the last line instead of being alone on the next line (does not apply to self closing elements). -
--bracket-spacing=<true|false>— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--bracket-spacing=<true|false>— Whether to insert spaces around brackets in object literals. Defaults to true. -
--expand=<auto|always|never>— 是否将数组和对象展开到多行设置为auto时,如果第一个属性包含换行符,则对象字面量将格式化为多行;如果数组字面量适合一行,则将其格式化为单行。设置为always时,无论列表长度如何,这些字面值都将格式化为多行。设置为never时,如果一行能够容纳所有字面值,则这些字面值将格式化为一行。格式化package.json时,除非另有配置,否则 Biome 将使用always。默认为 “auto”。¥
--expand=<auto|always|never>— Whether to expand arrays and objects on multiple lines. When set toauto, object literals are formatted on multiple lines if the first property has a newline, and array literals are formatted on a single line if it fits in the line. When set toalways, these literals are formatted on multiple lines, regardless of length of the list. When set tonever, these literals are formatted on a single line if it fits in the line. When formattingpackage.json, Biome will usealwaysunless configured otherwise. Defaults to “auto”. -
--use-editorconfig=<true|false>— 使用任何.editorconfig文件来配置格式化程序。biome.json中的配置将覆盖.editorconfig配置。¥
--use-editorconfig=<true|false>— Use any.editorconfigfiles to configure the formatter. Configuration inbiome.jsonwill override.editorconfigconfiguration.默认:
true。¥Default:
true. -
--jsx-everywhere=<true|false>— 启用后,.js/.mjs/.cjs等文件可以包含 JSX 语法。¥
--jsx-everywhere=<true|false>— When enabled, files like.js/.mjs/.cjsmay contain JSX syntax.默认为
true。¥Defaults to
true. -
--javascript-formatter-enabled=<true|false>— 控制 JavaScript(及其超级语言)文件的格式化程序。¥
--javascript-formatter-enabled=<true|false>— Control the formatter for JavaScript (and its super languages) files. -
--jsx-quote-style=<double|single>— JSX 中使用的引号类型。默认为 double。¥
--jsx-quote-style=<double|single>— The type of quotes used in JSX. Defaults to double. -
--quote-properties=<preserve|as-needed>— 对象中的属性被引用时。默认为 asNeeded。¥
--quote-properties=<preserve|as-needed>— When properties in objects are quoted. Defaults to asNeeded. -
--trailing-commas=<all|es5|none>— 在多行逗号分隔的语法结构中尽可能打印尾随逗号。默认为 “all”。¥
--trailing-commas=<all|es5|none>— Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to “all”. -
--semicolons=<always|as-needed>— 格式化程序是否为所有语句打印分号,还是仅在由于 ASI 而需要的 for 语句中打印分号。¥
--semicolons=<always|as-needed>— Whether the formatter prints semicolons for all statements or only in for statements where it is necessary because of ASI. -
--arrow-parentheses=<always|as-needed>— 是否向箭头函数添加不必要的括号。默认为 “always”。¥
--arrow-parentheses=<always|as-needed>— Whether to add non-necessary parentheses to arrow functions. Defaults to “always”. -
--bracket-same-line=<true|false>— 是否将多行 HTML/JSX 标签的右括号放在最后一行的末尾,而不是单独放在下一行。默认为 false。¥
--bracket-same-line=<true|false>— Whether to hug the closing bracket of multiline HTML/JSX tags to the end of the last line, rather than being alone on the following line. Defaults to false. -
--javascript-formatter-indent-style=<tab|space>— 应用于 JavaScript(及其超级语言)文件的缩进样式。¥
--javascript-formatter-indent-style=<tab|space>— The indent style applied to JavaScript (and its super languages) files. -
--javascript-formatter-indent-width=NUMBER— 应用于 JavaScript(及其超级语言)文件的缩进大小。默认为 2。¥
--javascript-formatter-indent-width=NUMBER— The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. -
--javascript-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 JavaScript(及其超级语言)文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--javascript-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to JavaScript (and its super languages) files.autouses CRLF on Windows and LF on other platforms. -
--javascript-formatter-line-width=NUMBER— 应用于 JavaScript(及其超级语言)文件的行的最大宽度是多少。默认为 80。¥
--javascript-formatter-line-width=NUMBER— What’s the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80. -
--javascript-formatter-quote-style=<double|single>— JavaScript 代码中使用的引号类型。默认为 double。¥
--javascript-formatter-quote-style=<double|single>— The type of quotes used in JavaScript code. Defaults to double. -
--javascript-formatter-attribute-position=<multiline|auto>— JSX 元素中的属性位置样式。默认为 auto。¥
--javascript-formatter-attribute-position=<multiline|auto>— The attribute position style in JSX elements. Defaults to auto. -
--javascript-formatter-bracket-spacing=<true|false>— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--javascript-formatter-bracket-spacing=<true|false>— Whether to insert spaces around brackets in object literals. Defaults to true. -
--javascript-formatter-expand=<auto|always|never>— 是否将数组和对象展开到多行设置为auto时,如果第一个属性包含换行符,则对象字面量将格式化为多行;如果数组字面量适合一行,则将其格式化为单行。设置为always时,无论列表长度如何,这些字面值都将格式化为多行。设置为never时,如果一行能够容纳所有字面值,则这些字面值将格式化为一行。格式化package.json时,除非另有配置,否则 Biome 将使用always。默认为 “auto”。¥
--javascript-formatter-expand=<auto|always|never>— Whether to expand arrays and objects on multiple lines. When set toauto, object literals are formatted on multiple lines if the first property has a newline, and array literals are formatted on a single line if it fits in the line. When set toalways, these literals are formatted on multiple lines, regardless of length of the list. When set tonever, these literals are formatted on a single line if it fits in the line. When formattingpackage.json, Biome will usealwaysunless configured otherwise. Defaults to “auto”. -
--javascript-formatter-operator-linebreak=<before|after>— 将二进制表达式拆分为多行时,是在二进制运算符之前还是之后进行拆分。默认为 “after”。¥
--javascript-formatter-operator-linebreak=<before|after>— When breaking binary expressions into multiple lines, whether to break them before or after the binary operator. Defaults to “after”. -
--javascript-linter-enabled=<true|false>— 控制 JavaScript(及其超级语言)文件的 linter。¥
--javascript-linter-enabled=<true|false>— Control the linter for JavaScript (and its super languages) files. -
--javascript-assist-enabled=<true|false>— 控制 JavaScript(及其上级语言)文件的辅助功能。 (及其上级语言)文件。¥
--javascript-assist-enabled=<true|false>— Control the assist for JavaScript (and its super languages) files. -
--json-parse-allow-comments=<true|false>— 允许解析.json文件中的注释。¥
--json-parse-allow-comments=<true|false>— Allow parsing comments in.jsonfiles -
--json-parse-allow-trailing-commas=<true|false>— 允许解析.json文件中的尾随逗号。¥
--json-parse-allow-trailing-commas=<true|false>— Allow parsing trailing commas in.jsonfiles -
--json-formatter-enabled=<true|false>— 控制 JSON(及其超级语言)文件的格式化程序。¥
--json-formatter-enabled=<true|false>— Control the formatter for JSON (and its super languages) files. -
--json-formatter-indent-style=<tab|space>— 应用于 JSON(及其超级语言)文件的缩进样式。¥
--json-formatter-indent-style=<tab|space>— The indent style applied to JSON (and its super languages) files. -
--json-formatter-indent-width=NUMBER— 应用于 JSON(及其超级语言)文件的缩进大小。默认为 2。¥
--json-formatter-indent-width=NUMBER— The size of the indentation applied to JSON (and its super languages) files. Default to 2. -
--json-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 JSON(及其超级语言)文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--json-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to JSON (and its super languages) files.autouses CRLF on Windows and LF on other platforms. -
--json-formatter-line-width=NUMBER— 应用于 JSON(及其超级语言)文件的行的最大宽度是多少。默认为 80。¥
--json-formatter-line-width=NUMBER— What’s the max width of a line applied to JSON (and its super languages) files. Defaults to 80. -
--json-formatter-trailing-commas=<none|all>— 在多行逗号分隔的语法结构中尽可能打印尾随逗号。默认为 “none”。¥
--json-formatter-trailing-commas=<none|all>— Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to “none”. -
--json-formatter-expand=<auto|always|never>— 是否将数组和对象展开到多行设置为auto时,如果第一个属性包含换行符,则对象字面量将格式化为多行;如果数组字面量适合一行,则将其格式化为单行。设置为always时,无论列表长度如何,这些字面值都将格式化为多行。设置为never时,如果一行能够容纳所有字面值,则这些字面值将格式化为一行。格式化package.json时,除非另有配置,否则 Biome 将使用always。默认为 “auto”。¥
--json-formatter-expand=<auto|always|never>— Whether to expand arrays and objects on multiple lines. When set toauto, object literals are formatted on multiple lines if the first property has a newline, and array literals are formatted on a single line if it fits in the line. When set toalways, these literals are formatted on multiple lines, regardless of length of the list. When set tonever, these literals are formatted on a single line if it fits in the line. When formattingpackage.json, Biome will usealwaysunless configured otherwise. Defaults to “auto”. -
--json-formatter-bracket-spacing=<true|false>— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--json-formatter-bracket-spacing=<true|false>— Whether to insert spaces around brackets in object literals. Defaults to true. -
--json-linter-enabled=<true|false>— 控制 JSON(及其超级语言)文件的 linter。¥
--json-linter-enabled=<true|false>— Control the linter for JSON (and its super languages) files. -
--json-assist-enabled=<true|false>— 控制 JSON(及其上级语言)文件的辅助功能。¥
--json-assist-enabled=<true|false>— Control the assist for JSON (and its super languages) files. -
--css-parse-css-modules=<true|false>— 启用 CSS Modules 特定功能的解析。¥
--css-parse-css-modules=<true|false>— Enables parsing of CSS Modules specific features. -
--css-parse-tailwind-directives=<true|false>— 启用 Tailwind CSS 4.0 指令和函数的解析。¥
--css-parse-tailwind-directives=<true|false>— Enables parsing of Tailwind CSS 4.0 directives and functions. -
--css-formatter-enabled=<true|false>— 控制 CSS(及其超级语言)文件的格式化程序。¥
--css-formatter-enabled=<true|false>— Control the formatter for CSS (and its super languages) files. -
--css-formatter-indent-style=<tab|space>— 应用于 CSS(及其超级语言)文件的缩进样式。¥
--css-formatter-indent-style=<tab|space>— The indent style applied to CSS (and its super languages) files. -
--css-formatter-indent-width=NUMBER— 应用于 CSS(及其超级语言)文件的缩进大小。默认为 2。¥
--css-formatter-indent-width=NUMBER— The size of the indentation applied to CSS (and its super languages) files. Default to 2. -
--css-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 CSS(及其超级语言)文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--css-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to CSS (and its super languages) files.autouses CRLF on Windows and LF on other platforms. -
--css-formatter-line-width=NUMBER— 应用于 CSS(及其超级语言)文件的行的最大宽度是多少。默认为 80。¥
--css-formatter-line-width=NUMBER— What’s the max width of a line applied to CSS (and its super languages) files. Defaults to 80. -
--css-formatter-quote-style=<double|single>— CSS 代码中使用的引号类型。默认为 double。¥
--css-formatter-quote-style=<double|single>— The type of quotes used in CSS code. Defaults to double. -
--css-linter-enabled=<true|false>— 控制 CSS 文件的 linter。¥
--css-linter-enabled=<true|false>— Control the linter for CSS files. -
--css-assist-enabled=<true|false>— 控制 CSS 文件的辅助功能。¥
--css-assist-enabled=<true|false>— Control the assist for CSS files. -
--graphql-formatter-enabled=<true|false>— 控制 GraphQL 文件的格式化程序。¥
--graphql-formatter-enabled=<true|false>— Control the formatter for GraphQL files. -
--graphql-formatter-indent-style=<tab|space>— 应用于 GraphQL 文件的缩进样式。¥
--graphql-formatter-indent-style=<tab|space>— The indent style applied to GraphQL files. -
--graphql-formatter-indent-width=NUMBER— 应用于 GraphQL 文件的缩进大小。默认为 2。¥
--graphql-formatter-indent-width=NUMBER— The size of the indentation applied to GraphQL files. Default to 2. -
--graphql-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 GraphQL 文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--graphql-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to GraphQL files.autouses CRLF on Windows and LF on other platforms. -
--graphql-formatter-line-width=NUMBER— 应用于 GraphQL 文件的行的最大宽度是多少。默认为 80。¥
--graphql-formatter-line-width=NUMBER— What’s the max width of a line applied to GraphQL files. Defaults to 80. -
--graphql-formatter-quote-style=<double|single>— GraphQL 代码中使用的引号类型。默认为 double。¥
--graphql-formatter-quote-style=<double|single>— The type of quotes used in GraphQL code. Defaults to double. -
--graphql-linter-enabled=<true|false>— 控制 GraphQL 文件的格式化程序。¥
--graphql-linter-enabled=<true|false>— Control the formatter for GraphQL files. -
--graphql-assist-enabled=<true|false>— 控制 GraphQL 文件的格式化程序。¥
--graphql-assist-enabled=<true|false>— Control the formatter for GraphQL files. -
--grit-formatter-enabled=<true|false>— 控制 Grit 文件的格式化程序。¥
--grit-formatter-enabled=<true|false>— Control the formatter for Grit files. -
--grit-formatter-indent-style=<tab|space>— 应用于 Grit 文件的缩进样式。¥
--grit-formatter-indent-style=<tab|space>— The indent style applied to Grit files. -
--grit-formatter-indent-width=NUMBER— 应用于 Grit 文件的缩进大小。默认为 2。¥
--grit-formatter-indent-width=NUMBER— The size of the indentation applied to Grit files. Default to 2. -
--grit-formatter-line-ending=<lf|crlf|cr>— 应用于 Grit 文件的行尾类型。¥
--grit-formatter-line-ending=<lf|crlf|cr>— The type of line ending applied to Grit files. -
--grit-formatter-line-width=NUMBER— 应用于 Grit 文件的最大行宽。默认为 80。¥
--grit-formatter-line-width=NUMBER— What’s the max width of a line applied to Grit files. Defaults to 80. -
--grit-linter-enabled=<true|false>— 控制 Grit 文件的代码检查器。¥
--grit-linter-enabled=<true|false>— Control the linter for Grit files. -
--grit-assist-enabled=<true|false>— 控制 Grit 文件的辅助功能。¥
--grit-assist-enabled=<true|false>— Control the assist functionality for Grit files. -
--html-formatter-enabled=<true|false>— 控制 HTML(及其上级语言)文件的格式化程序。¥
--html-formatter-enabled=<true|false>— Control the formatter for HTML (and its super languages) files. -
--html-formatter-indent-style=<tab|space>— 应用于 HTML(及其上级语言)文件的缩进样式。¥
--html-formatter-indent-style=<tab|space>— The indent style applied to HTML (and its super languages) files. -
--html-formatter-indent-width=NUMBER— 应用于 HTML(及其上级语言)文件的缩进大小。默认为 2。¥
--html-formatter-indent-width=NUMBER— The size of the indentation applied to HTML (and its super languages) files. Default to 2. -
--html-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 HTML(及其上级语言)文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--html-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to HTML (and its super languages) files.autouses CRLF on Windows and LF on other platforms. -
--html-formatter-line-width=NUMBER— 应用于 HTML(及其上级语言)文件的最大行宽。默认为 80。¥
--html-formatter-line-width=NUMBER— What’s the max width of a line applied to HTML (and its super languages) files. Defaults to 80. -
--html-formatter-attribute-position=<multiline|auto>— HTML 元素中的属性位置样式。默认为 auto。¥
--html-formatter-attribute-position=<multiline|auto>— The attribute position style in HTML elements. Defaults to auto. -
--html-formatter-bracket-same-line=<true|false>— 多行 HTML 标签的右括号是否紧贴最后一行末尾,而不是单独位于下一行默认为 false。¥
--html-formatter-bracket-same-line=<true|false>— Whether to hug the closing bracket of multiline HTML tags to the end of the last line, rather than being alone on the following line. Defaults to false. -
--html-formatter-whitespace-sensitivity=<css|strict|ignore>— 格式化 HTML(及其上级语言)时是否考虑空格敏感性默认为 “css”。¥
--html-formatter-whitespace-sensitivity=<css|strict|ignore>— Whether to account for whitespace sensitivity when formatting HTML (and its super languages). Defaults to “css”. -
--html-formatter-indent-script-and-style=<true|false>— 是否缩进 HTML(及其上级语言)的<script>和<style>标签默认为 false。¥
--html-formatter-indent-script-and-style=<true|false>— Whether to indent the<script>and<style>tags for HTML (and its super languages). Defaults to false. -
--html-formatter-self-close-void-elements=<always|never>— 空元素是否应该自闭合默认从不。¥
--html-formatter-self-close-void-elements=<always|never>— Whether void elements should be self-closed. Defaults to never. -
--html-linter-enabled=<true|false>— 控制 HTML(及其上级语言)文件的代码检查器。¥
--html-linter-enabled=<true|false>— Control the linter for HTML (and its super languages) files. -
--html-assist-enabled=<true|false>— 控制 HTML(及其上级语言)文件的辅助功能。¥
--html-assist-enabled=<true|false>— Control the assist for HTML (and its super languages) files. -
--assist-enabled=<true|false>— Biome 是否应通过 LSP 和 CLI 启用辅助功能。¥
--assist-enabled=<true|false>— Whether Biome should enable assist via LSP and CLI.
应用于所有命令的全局选项
¥Global options applied to all commands
-
--colors=<off|force>— 设置标记的格式化模式:“off” 将所有内容打印为纯文本,即使确定控制台输出不兼容,“force” 也会强制使用 ANSI 格式化标记¥
--colors=<off|force>— Set the formatting mode for markup: “off” prints everything as plain text, “force” forces the formatting of markup using ANSI even if the console output is determined to be incompatible -
--use-server— 连接到 Biome 守护进程服务器的正在运行的实例。¥
--use-server— Connect to a running instance of the Biome daemon server. -
--verbose— 打印其他诊断信息,某些诊断信息会显示更多信息。此外,打印出处理了哪些文件以及修改了哪些文件。¥
--verbose— Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified. -
--config-path=PATH— 设置配置文件的文件路径,或查找biome.json或biome.jsonc的目录路径。如果使用,它将禁用默认配置文件解析。¥
--config-path=PATH— Set the file path to the configuration file, or the directory path to findbiome.jsonorbiome.jsonc. If used, it disables the default configuration file resolution.使用环境变量
BIOME_CONFIG_PATH¥Uses environment variable
BIOME_CONFIG_PATH -
--max-diagnostics=<none|<NUMBER>>— 限制显示的诊断数量。当提供none时,限制被解除。¥
--max-diagnostics=<none|<NUMBER>>— Cap the amount of diagnostics displayed. Whennoneis provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-parse-errors— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-parse-errors— Skip over files containing syntax errors instead of emitting an error diagnostic. -
--no-errors-on-unmatched— 如果在执行命令期间没有处理任何文件,则静音将发出的错误。¥
--no-errors-on-unmatched— Silence errors that would be emitted in case no files were processed during the execution of the command. -
--error-on-warnings— 如果某些诊断发出警告,则告诉 Biome 退出并显示错误代码。¥
--error-on-warnings— Tell Biome to exit with an error code if some diagnostics emit warnings. -
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— 允许更改诊断和摘要的报告方式。¥
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— Allows to change how diagnostics and summary are reported. -
--log-file=ARG— 日志消息重定向的可选路径。¥
--log-file=ARG— Optional path to redirect log messages to.如果省略,日志将输出到标准输出 (stdout)。
¥If omitted, logs are printed to stdout.
-
--log-level=<none|debug|info|warn|error>— 日志记录级别。按从最详细到最不详细的顺序:调试、信息、警告、错误。¥
--log-level=<none|debug|info|warn|error>— The level of logging. In order, from the most verbose to the least verbose: debug, info, warn, error.值
none不会显示任何日志记录。¥The value
nonewon’t show any logging.[默认:无]
¥[default: none]
-
--log-kind=<pretty|compact|json>— 日志应如何显示。¥
--log-kind=<pretty|compact|json>— How the log should look like.[默认:漂亮]
¥[default: pretty]
-
--diagnostic-level=<info|warn|error>— 要显示的诊断级别。按从最低到最重要的顺序:信息、警告、错误。传递--diagnostic-level=error将导致 Biome 仅打印仅包含错误的诊断信息。¥
--diagnostic-level=<info|warn|error>— The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing--diagnostic-level=errorwill cause Biome to print only diagnostics that contain only errors.[默认:信息]
¥[default: info]
可用位置项:
¥Available positional items:
-
PATH— 单个文件、单个路径或路径列表¥
PATH— Single file, single path or list of paths
可用选项:
¥Available options:
-
--write— 应用安全修复、格式化和导入排序。¥
--write— Apply safe fixes, formatting and import sorting -
--unsafe— 应用不安全修复。应与--write或--fix一起使用。¥
--unsafe— Apply unsafe fixes. Should be used with--writeor--fix -
--fix—--write的别名,编写安全修复程序、格式化和导入排序¥
--fix— Alias for--write, writes safe fixes, formatting and import sorting -
--formatter-enabled=<true|false>— 允许启用或禁用格式化检查。¥
--formatter-enabled=<true|false>— Allow enabling or disabling the formatter check. -
--linter-enabled=<true|false>— 允许启用或禁用代码检查。¥
--linter-enabled=<true|false>— Allow enabling or disabling the linter check. -
--assist-enabled=<true|false>— 允许启用或禁用辅助功能。¥
--assist-enabled=<true|false>— Allow enabling or disabling the assist. -
--enforce-assist=<true|false>— 允许强制启用辅助功能,如果某些操作未执行,则 CLI 失败。默认为true。¥
--enforce-assist=<true|false>— Allows enforcing assist, and make the CLI fail if some actions aren’t applied. Defaults totrue. -
--format-with-errors=<true|false>— 如果给定文件存在语法错误,是否允许继续格式化¥
--format-with-errors=<true|false>— Whether formatting should be allowed to proceed if a given file has syntax errors -
--stdin-file-path=PATH— 当你想要格式化从stdin传输的代码并将输出打印到stdout时,请使用此选项。¥
--stdin-file-path=PATH— Use this option when you want to format code piped fromstdin, and print the output tostdout.文件不需要存在于磁盘上,重要的是文件的扩展名。基于扩展,Biome 知道如何检查代码。
¥The file doesn’t need to exist on disk, what matters is the extension of the file. Based on the extension, Biome knows how to check the code.
此外,如果你配置了覆盖设置和/或嵌套配置,路径可能会决定应用哪些设置。
¥Also, if you have overrides configured and/or nested configurations, the path may determine the settings being applied.
示例:
shell echo 'let a;' | biome check --stdin-file-path=file.js --write¥Example:
shell echo 'let a;' | biome check --stdin-file-path=file.js --write -
--staged— 设置为 true 时,只有已暂存的文件(准备提交的文件)才会被 linted。此选项应在本地工作时使用。¥
--staged— When set to true, only the files that have been staged (the ones prepared to be committed) will be linted. This option should be used when working locally. -
--changed— 设置为 true 时,只有与defaultBranch配置相比已更改的文件才会被 linted。此选项应在 CI 环境中使用。¥
--changed— When set to true, only the files that have been changed compared to yourdefaultBranchconfiguration will be linted. This option should be used in CI environments. -
--since=REF— 使用 —changed 标志并且biome.json中未设置defaultBranch时,使用此方法指定要与之比较的基本分支¥
--since=REF— Use this to specify the base branch to compare against when you’re using the —changed flag and thedefaultBranchis not set in yourbiome.json -
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome lint
Section titled “biome lint”在一组文件上运行各种检查。
¥Run various checks on a set of files.
用法:biome lint [--write] [--unsafe] [--suppress] [--reason=STRING] [--only=<GROUP|RULE|DOMAIN>]…[--skip=<GROUP|RULE|DOMAIN>]…[--staged] [--changed] [--since=REF] [PATH]…
¥Usage: biome lint [--write] [--unsafe] [--suppress] [--reason=STRING] [--only=<GROUP|RULE|DOMAIN>]… [--skip=<GROUP|RULE|DOMAIN>]… [--staged] [--changed] [--since=REF] [PATH]…
更改 JSON 解析器行为的选项
¥Options that changes how the JSON parser behaves
-
--json-parse-allow-comments=<true|false>— 允许解析.json文件中的注释。¥
--json-parse-allow-comments=<true|false>— Allow parsing comments in.jsonfiles -
--json-parse-allow-trailing-commas=<true|false>— 允许解析.json文件中的尾随逗号。¥
--json-parse-allow-trailing-commas=<true|false>— Allow parsing trailing commas in.jsonfiles
将 Biome 与 VCS 软件集成的属性集。
¥Set of properties to integrate Biome with a VCS software.
-
--vcs-enabled=<true|false>— Biome 是否应将自身与 VCS 客户端集成¥
--vcs-enabled=<true|false>— Whether Biome should integrate itself with the VCS client -
--vcs-client-kind=<git>— 客户端类型。¥
--vcs-client-kind=<git>— The kind of client. -
--vcs-use-ignore-file=<true|false>— Biome 是否应使用 VCS 忽略文件。当 [true] 时,Biome 将忽略忽略文件中指定的文件。¥
--vcs-use-ignore-file=<true|false>— Whether Biome should use the VCS ignore file. When [true], Biome will ignore the files specified in the ignore file. -
--vcs-root=PATH— Biome 应检查 VCS 文件的文件夹。默认情况下,Biome 将使用找到biome.json的同一文件夹。¥
--vcs-root=PATH— The folder where Biome should check for VCS files. By default, Biome will use the same folder wherebiome.jsonwas found.如果 Biome 找不到配置,它将尝试使用当前工作目录。如果找不到当前工作目录,Biome 将不会使用 VCS 集成,并且将发出诊断
¥If Biome can’t find the configuration, it will attempt to use the current working directory. If no current working directory can’t be found, Biome won’t use the VCS integration, and a diagnostic will be emitted
-
--vcs-default-branch=BRANCH— 项目的主要分支¥
--vcs-default-branch=BRANCH— The main branch of the project
文件系统的配置
¥The configuration of the filesystem
-
--files-max-size=NUMBER— 源代码文件的最大允许大小(以字节为单位)。出于性能原因,超过此限制的文件将被忽略。默认为 1 MiB¥
--files-max-size=NUMBER— The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB -
--files-ignore-unknown=<true|false>— 指示 Biome 在处理未知文件时不要发出诊断信息。¥
--files-ignore-unknown=<true|false>— Tells Biome to not emit diagnostics when handling files that it doesn’t know
特定于 JavaScript linter 的 Linter 选项
¥Linter options specific to the JavaScript linter
-
--javascript-linter-enabled=<true|false>— 控制 JavaScript(及其超级语言)文件的 linter。¥
--javascript-linter-enabled=<true|false>— Control the linter for JavaScript (and its super languages) files.
特定于 JSON linter 的 Linter 选项
¥Linter options specific to the JSON linter
-
--json-linter-enabled=<true|false>— 控制 JSON(及其超级语言)文件的 linter。¥
--json-linter-enabled=<true|false>— Control the linter for JSON (and its super languages) files.
应用于所有命令的全局选项
¥Global options applied to all commands
-
--colors=<off|force>— 设置标记的格式化模式:“off” 将所有内容打印为纯文本,即使确定控制台输出不兼容,“force” 也会强制使用 ANSI 格式化标记¥
--colors=<off|force>— Set the formatting mode for markup: “off” prints everything as plain text, “force” forces the formatting of markup using ANSI even if the console output is determined to be incompatible -
--use-server— 连接到 Biome 守护进程服务器的正在运行的实例。¥
--use-server— Connect to a running instance of the Biome daemon server. -
--verbose— 打印其他诊断信息,某些诊断信息会显示更多信息。此外,打印出处理了哪些文件以及修改了哪些文件。¥
--verbose— Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified. -
--config-path=PATH— 设置配置文件的文件路径,或查找biome.json或biome.jsonc的目录路径。如果使用,它将禁用默认配置文件解析。¥
--config-path=PATH— Set the file path to the configuration file, or the directory path to findbiome.jsonorbiome.jsonc. If used, it disables the default configuration file resolution.使用环境变量
BIOME_CONFIG_PATH¥Uses environment variable
BIOME_CONFIG_PATH -
--max-diagnostics=<none|<NUMBER>>— 限制显示的诊断数量。当提供none时,限制被解除。¥
--max-diagnostics=<none|<NUMBER>>— Cap the amount of diagnostics displayed. Whennoneis provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-parse-errors— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-parse-errors— Skip over files containing syntax errors instead of emitting an error diagnostic. -
--no-errors-on-unmatched— 如果在执行命令期间没有处理任何文件,则静音将发出的错误。¥
--no-errors-on-unmatched— Silence errors that would be emitted in case no files were processed during the execution of the command. -
--error-on-warnings— 如果某些诊断发出警告,则告诉 Biome 退出并显示错误代码。¥
--error-on-warnings— Tell Biome to exit with an error code if some diagnostics emit warnings. -
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— 允许更改诊断和摘要的报告方式。¥
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— Allows to change how diagnostics and summary are reported. -
--log-file=ARG— 日志消息重定向的可选路径。¥
--log-file=ARG— Optional path to redirect log messages to.如果省略,日志将输出到标准输出 (stdout)。
¥If omitted, logs are printed to stdout.
-
--log-level=<none|debug|info|warn|error>— 日志记录级别。按从最详细到最不详细的顺序:调试、信息、警告、错误。¥
--log-level=<none|debug|info|warn|error>— The level of logging. In order, from the most verbose to the least verbose: debug, info, warn, error.值
none不会显示任何日志记录。¥The value
nonewon’t show any logging.[默认:无]
¥[default: none]
-
--log-kind=<pretty|compact|json>— 日志应如何显示。¥
--log-kind=<pretty|compact|json>— How the log should look like.[默认:漂亮]
¥[default: pretty]
-
--diagnostic-level=<info|warn|error>— 要显示的诊断级别。按从最低到最重要的顺序:信息、警告、错误。传递--diagnostic-level=error将导致 Biome 仅打印仅包含错误的诊断信息。¥
--diagnostic-level=<info|warn|error>— The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing--diagnostic-level=errorwill cause Biome to print only diagnostics that contain only errors.[默认:信息]
¥[default: info]
可用位置项:
¥Available positional items:
-
PATH— 单个文件、单个路径或路径列表¥
PATH— Single file, single path or list of paths
可用选项:
¥Available options:
-
--write— 写入安全修复¥
--write— Writes safe fixes -
--unsafe— 应用不安全修复。应与--write或--fix一起使用。¥
--unsafe— Apply unsafe fixes. Should be used with--writeor--fix -
--fix—--write的别名,编写安全修复程序¥
--fix— Alias for--write, writes safe fixes -
--suppress— 使用注释抑制而非规则代码操作来修复 lint 规则违规(修复)。¥
--suppress— Fixes lint rule violations with comment suppressions instead of using a rule code action (fix) -
--reason=STRING— 说明如何使用--suppress抑制诊断信息。¥
--reason=STRING— Explanation for suppressing diagnostics with--suppress -
--only=<GROUP|RULE|DOMAIN>— 仅运行指定的规则、规则组或域。如果规则的严重性级别为off,则规则的严重性级别设置为推荐规则的error,否则设置为warn。¥
--only=<GROUP|RULE|DOMAIN>— Run only the given rule, group of rules or domain. If the severity level of a rule isoff, then the severity level of the rule is set toerrorif it is a recommended rule orwarnotherwise.示例:
¥Example:
Terminal window biome lint --only=correctness/noUnusedVariables --only=suspicious --only=test -
--skip=<GROUP|RULE|DOMAIN>— 通过将规则的严重级别设置为off来跳过指定的规则、规则组或域。此选项优先于--only。¥
--skip=<GROUP|RULE|DOMAIN>— Skip the given rule, group of rules or domain by setting the severity level of the rules tooff. This option takes precedence over--only.示例:
¥Example:
Terminal window biome lint --skip=correctness/noUnusedVariables --skip=suspicious --skip=project -
--stdin-file-path=PATH— 当你想要格式化从stdin传输的代码并将输出打印到stdout时,请使用此选项。¥
--stdin-file-path=PATH— Use this option when you want to format code piped fromstdin, and print the output tostdout.文件不需要存在于磁盘上,重要的是文件的扩展名。基于扩展,Biome 知道如何对代码进行 lint。
¥The file doesn’t need to exist on disk, what matters is the extension of the file. Based on the extension, Biome knows how to lint the code.
示例:
shell echo 'let a;' | biome lint --stdin-file-path=file.js --write¥Example:
shell echo 'let a;' | biome lint --stdin-file-path=file.js --write -
--staged— 设置为 true 时,只有已暂存的文件(准备提交的文件)才会被 linted。¥
--staged— When set to true, only the files that have been staged (the ones prepared to be committed) will be linted. -
--changed— 设置为 true 时,只有与defaultBranch配置相比已更改的文件才会被 linted。¥
--changed— When set to true, only the files that have been changed compared to yourdefaultBranchconfiguration will be linted. -
--since=REF— 当你使用 —changed 标志并且defaultBranch未在你的 biome.json 中设置时,使用此方法指定要与之比较的基本分支¥
--since=REF— Use this to specify the base branch to compare against when you’re using the —changed flag and thedefaultBranchis not set in your biome.json -
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome format
Section titled “biome format”在一组文件上运行格式化程序。
¥Run the formatter on a set of files.
用法:biome format [--write] [--staged] [--changed] [--since=REF] [PATH]…
¥Usage: biome format [--write] [--staged] [--changed] [--since=REF] [PATH]…
应用于所有文件的通用选项
¥Generic options applied to all files
-
--format-with-errors=<true|false>— 如果给定文件存在语法错误,是否允许继续格式化¥
--format-with-errors=<true|false>— Whether formatting should be allowed to proceed if a given file has syntax errors -
--indent-style=<tab|space>— 缩进样式。¥
--indent-style=<tab|space>— The indent style. -
--indent-width=NUMBER— 缩进大小,默认为 2¥
--indent-width=NUMBER— The size of the indentation, 2 by default -
--line-ending=<lf|crlf|cr|auto>— 行尾类型。¥
--line-ending=<lf|crlf|cr|auto>— The type of line ending. -
--line-width=NUMBER— 行的最大宽度是多少。默认为 80。¥
--line-width=NUMBER— What’s the max width of a line. Defaults to 80. -
--attribute-position=<multiline|auto>— 类 HTML 语言中的属性位置样式。默认为 auto。¥
--attribute-position=<multiline|auto>— The attribute position style in HTML-ish languages. Defaults to auto. -
--bracket-same-line=<true|false>— 将多行 HTML 或 HTML 的>值设置为其他值。 JSX 元素位于最后一行的末尾,而不是单独位于下一行(不适用于自闭合元素)。¥
--bracket-same-line=<true|false>— Put the>of a multi-line HTML or JSX element at the end of the last line instead of being alone on the next line (does not apply to self closing elements). -
--bracket-spacing=<true|false>— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--bracket-spacing=<true|false>— Whether to insert spaces around brackets in object literals. Defaults to true. -
--expand=<auto|always|never>— 是否将数组和对象展开到多行设置为auto时,如果第一个属性包含换行符,则对象字面量将格式化为多行;如果数组字面量适合一行,则将其格式化为单行。设置为always时,无论列表长度如何,这些字面值都将格式化为多行。设置为never时,如果一行能够容纳所有字面值,则这些字面值将格式化为一行。格式化package.json时,除非另有配置,否则 Biome 将使用always。默认为 “auto”。¥
--expand=<auto|always|never>— Whether to expand arrays and objects on multiple lines. When set toauto, object literals are formatted on multiple lines if the first property has a newline, and array literals are formatted on a single line if it fits in the line. When set toalways, these literals are formatted on multiple lines, regardless of length of the list. When set tonever, these literals are formatted on a single line if it fits in the line. When formattingpackage.json, Biome will usealwaysunless configured otherwise. Defaults to “auto”. -
--use-editorconfig=<true|false>— 使用任何.editorconfig文件来配置格式化程序。biome.json中的配置将覆盖.editorconfig配置。¥
--use-editorconfig=<true|false>— Use any.editorconfigfiles to configure the formatter. Configuration inbiome.jsonwill override.editorconfigconfiguration.默认:
true。¥Default:
true.
特定于 JavaScript 文件的格式化选项
¥Formatting options specific to the JavaScript files
-
--javascript-formatter-enabled=<true|false>— 控制 JavaScript(及其超级语言)文件的格式化程序。¥
--javascript-formatter-enabled=<true|false>— Control the formatter for JavaScript (and its super languages) files. -
--jsx-quote-style=<double|single>— JSX 中使用的引号类型。默认为 double。¥
--jsx-quote-style=<double|single>— The type of quotes used in JSX. Defaults to double. -
--quote-properties=<preserve|as-needed>— 对象中的属性被引用时。默认为 asNeeded。¥
--quote-properties=<preserve|as-needed>— When properties in objects are quoted. Defaults to asNeeded. -
--trailing-commas=<all|es5|none>— 在多行逗号分隔的语法结构中尽可能打印尾随逗号。默认为 “all”。¥
--trailing-commas=<all|es5|none>— Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to “all”. -
--semicolons=<always|as-needed>— 格式化程序是否为所有语句打印分号,还是仅在由于 ASI 而需要的 for 语句中打印分号。¥
--semicolons=<always|as-needed>— Whether the formatter prints semicolons for all statements or only in for statements where it is necessary because of ASI. -
--arrow-parentheses=<always|as-needed>— 是否向箭头函数添加不必要的括号。默认为 “always”。¥
--arrow-parentheses=<always|as-needed>— Whether to add non-necessary parentheses to arrow functions. Defaults to “always”. -
--bracket-same-line=<true|false>— 是否将多行 HTML/JSX 标签的右括号放在最后一行的末尾,而不是单独放在下一行。默认为 false。¥
--bracket-same-line=<true|false>— Whether to hug the closing bracket of multiline HTML/JSX tags to the end of the last line, rather than being alone on the following line. Defaults to false. -
--javascript-formatter-indent-style=<tab|space>— 应用于 JavaScript(及其超级语言)文件的缩进样式。¥
--javascript-formatter-indent-style=<tab|space>— The indent style applied to JavaScript (and its super languages) files. -
--javascript-formatter-indent-width=NUMBER— 应用于 JavaScript(及其超级语言)文件的缩进大小。默认为 2。¥
--javascript-formatter-indent-width=NUMBER— The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. -
--javascript-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 JavaScript(及其超级语言)文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--javascript-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to JavaScript (and its super languages) files.autouses CRLF on Windows and LF on other platforms. -
--javascript-formatter-line-width=NUMBER— 应用于 JavaScript(及其超级语言)文件的行的最大宽度是多少。默认为 80。¥
--javascript-formatter-line-width=NUMBER— What’s the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80. -
--javascript-formatter-quote-style=<double|single>— JavaScript 代码中使用的引号类型。默认为 double。¥
--javascript-formatter-quote-style=<double|single>— The type of quotes used in JavaScript code. Defaults to double. -
--javascript-formatter-attribute-position=<multiline|auto>— JSX 元素中的属性位置样式。默认为 auto。¥
--javascript-formatter-attribute-position=<multiline|auto>— The attribute position style in JSX elements. Defaults to auto. -
--javascript-formatter-bracket-spacing=<true|false>— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--javascript-formatter-bracket-spacing=<true|false>— Whether to insert spaces around brackets in object literals. Defaults to true. -
--javascript-formatter-expand=<auto|always|never>— 是否将数组和对象展开到多行设置为auto时,如果第一个属性包含换行符,则对象字面量将格式化为多行;如果数组字面量适合一行,则将其格式化为单行。设置为always时,无论列表长度如何,这些字面值都将格式化为多行。设置为never时,如果一行能够容纳所有字面值,则这些字面值将格式化为一行。格式化package.json时,除非另有配置,否则 Biome 将使用always。默认为 “auto”。¥
--javascript-formatter-expand=<auto|always|never>— Whether to expand arrays and objects on multiple lines. When set toauto, object literals are formatted on multiple lines if the first property has a newline, and array literals are formatted on a single line if it fits in the line. When set toalways, these literals are formatted on multiple lines, regardless of length of the list. When set tonever, these literals are formatted on a single line if it fits in the line. When formattingpackage.json, Biome will usealwaysunless configured otherwise. Defaults to “auto”. -
--javascript-formatter-operator-linebreak=<before|after>— 将二进制表达式拆分为多行时,是在二进制运算符之前还是之后进行拆分。默认为 “after”。¥
--javascript-formatter-operator-linebreak=<before|after>— When breaking binary expressions into multiple lines, whether to break them before or after the binary operator. Defaults to “after”.
更改 JSON 解析器行为的选项
¥Options that changes how the JSON parser behaves
-
--json-parse-allow-comments=<true|false>— 允许解析.json文件中的注释。¥
--json-parse-allow-comments=<true|false>— Allow parsing comments in.jsonfiles -
--json-parse-allow-trailing-commas=<true|false>— 允许解析.json文件中的尾随逗号。¥
--json-parse-allow-trailing-commas=<true|false>— Allow parsing trailing commas in.jsonfiles
将 Biome 与 VCS 软件集成的属性集。
¥Set of properties to integrate Biome with a VCS software.
-
--vcs-enabled=<true|false>— Biome 是否应将自身与 VCS 客户端集成¥
--vcs-enabled=<true|false>— Whether Biome should integrate itself with the VCS client -
--vcs-client-kind=<git>— 客户端类型。¥
--vcs-client-kind=<git>— The kind of client. -
--vcs-use-ignore-file=<true|false>— Biome 是否应使用 VCS 忽略文件。当 [true] 时,Biome 将忽略忽略文件中指定的文件。¥
--vcs-use-ignore-file=<true|false>— Whether Biome should use the VCS ignore file. When [true], Biome will ignore the files specified in the ignore file. -
--vcs-root=PATH— Biome 应检查 VCS 文件的文件夹。默认情况下,Biome 将使用找到biome.json的同一文件夹。¥
--vcs-root=PATH— The folder where Biome should check for VCS files. By default, Biome will use the same folder wherebiome.jsonwas found.如果 Biome 找不到配置,它将尝试使用当前工作目录。如果找不到当前工作目录,Biome 将不会使用 VCS 集成,并且将发出诊断
¥If Biome can’t find the configuration, it will attempt to use the current working directory. If no current working directory can’t be found, Biome won’t use the VCS integration, and a diagnostic will be emitted
-
--vcs-default-branch=BRANCH— 项目的主要分支¥
--vcs-default-branch=BRANCH— The main branch of the project
文件系统的配置
¥The configuration of the filesystem
-
--files-max-size=NUMBER— 源代码文件的最大允许大小(以字节为单位)。出于性能原因,超过此限制的文件将被忽略。默认为 1 MiB¥
--files-max-size=NUMBER— The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB -
--files-ignore-unknown=<true|false>— 指示 Biome 在处理未知文件时不要发出诊断信息。¥
--files-ignore-unknown=<true|false>— Tells Biome to not emit diagnostics when handling files that it doesn’t know
应用于所有命令的全局选项
¥Global options applied to all commands
-
--colors=<off|force>— 设置标记的格式化模式:“off” 将所有内容打印为纯文本,即使确定控制台输出不兼容,“force” 也会强制使用 ANSI 格式化标记¥
--colors=<off|force>— Set the formatting mode for markup: “off” prints everything as plain text, “force” forces the formatting of markup using ANSI even if the console output is determined to be incompatible -
--use-server— 连接到 Biome 守护进程服务器的正在运行的实例。¥
--use-server— Connect to a running instance of the Biome daemon server. -
--verbose— 打印其他诊断信息,某些诊断信息会显示更多信息。此外,打印出处理了哪些文件以及修改了哪些文件。¥
--verbose— Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified. -
--config-path=PATH— 设置配置文件的文件路径,或查找biome.json或biome.jsonc的目录路径。如果使用,它将禁用默认配置文件解析。¥
--config-path=PATH— Set the file path to the configuration file, or the directory path to findbiome.jsonorbiome.jsonc. If used, it disables the default configuration file resolution.使用环境变量
BIOME_CONFIG_PATH¥Uses environment variable
BIOME_CONFIG_PATH -
--max-diagnostics=<none|<NUMBER>>— 限制显示的诊断数量。当提供none时,限制被解除。¥
--max-diagnostics=<none|<NUMBER>>— Cap the amount of diagnostics displayed. Whennoneis provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-parse-errors— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-parse-errors— Skip over files containing syntax errors instead of emitting an error diagnostic. -
--no-errors-on-unmatched— 如果在执行命令期间没有处理任何文件,则静音将发出的错误。¥
--no-errors-on-unmatched— Silence errors that would be emitted in case no files were processed during the execution of the command. -
--error-on-warnings— 如果某些诊断发出警告,则告诉 Biome 退出并显示错误代码。¥
--error-on-warnings— Tell Biome to exit with an error code if some diagnostics emit warnings. -
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— 允许更改诊断和摘要的报告方式。¥
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— Allows to change how diagnostics and summary are reported. -
--log-file=ARG— 日志消息重定向的可选路径。¥
--log-file=ARG— Optional path to redirect log messages to.如果省略,日志将输出到标准输出 (stdout)。
¥If omitted, logs are printed to stdout.
-
--log-level=<none|debug|info|warn|error>— 日志记录级别。按从最详细到最不详细的顺序:调试、信息、警告、错误。¥
--log-level=<none|debug|info|warn|error>— The level of logging. In order, from the most verbose to the least verbose: debug, info, warn, error.值
none不会显示任何日志记录。¥The value
nonewon’t show any logging.[默认:无]
¥[default: none]
-
--log-kind=<pretty|compact|json>— 日志应如何显示。¥
--log-kind=<pretty|compact|json>— How the log should look like.[默认:漂亮]
¥[default: pretty]
-
--diagnostic-level=<info|warn|error>— 要显示的诊断级别。按从最低到最重要的顺序:信息、警告、错误。传递--diagnostic-level=error将导致 Biome 仅打印仅包含错误的诊断信息。¥
--diagnostic-level=<info|warn|error>— The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing--diagnostic-level=errorwill cause Biome to print only diagnostics that contain only errors.[默认:信息]
¥[default: info]
可用位置项:
¥Available positional items:
-
PATH— 单个文件、单个路径或路径列表。¥
PATH— Single file, single path or list of paths.
可用选项:
¥Available options:
-
--json-formatter-enabled=<true|false>— 控制 JSON(及其超级语言)文件的格式化程序。¥
--json-formatter-enabled=<true|false>— Control the formatter for JSON (and its super languages) files. -
--json-formatter-indent-style=<tab|space>— 应用于 JSON(及其超级语言)文件的缩进样式。¥
--json-formatter-indent-style=<tab|space>— The indent style applied to JSON (and its super languages) files. -
--json-formatter-indent-width=NUMBER— 应用于 JSON(及其超级语言)文件的缩进大小。默认为 2。¥
--json-formatter-indent-width=NUMBER— The size of the indentation applied to JSON (and its super languages) files. Default to 2. -
--json-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 JSON(及其超级语言)文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--json-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to JSON (and its super languages) files.autouses CRLF on Windows and LF on other platforms. -
--json-formatter-line-width=NUMBER— 应用于 JSON(及其超级语言)文件的行的最大宽度是多少。默认为 80。¥
--json-formatter-line-width=NUMBER— What’s the max width of a line applied to JSON (and its super languages) files. Defaults to 80. -
--json-formatter-trailing-commas=<none|all>— 在多行逗号分隔的语法结构中尽可能打印尾随逗号。默认为 “none”。¥
--json-formatter-trailing-commas=<none|all>— Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to “none”. -
--json-formatter-expand=<auto|always|never>— 是否将数组和对象展开到多行设置为auto时,如果第一个属性包含换行符,则对象字面量将格式化为多行;如果数组字面量适合一行,则将其格式化为单行。设置为always时,无论列表长度如何,这些字面值都将格式化为多行。设置为never时,如果一行能够容纳所有字面值,则这些字面值将格式化为一行。格式化package.json时,除非另有配置,否则 Biome 将使用always。默认为 “auto”。¥
--json-formatter-expand=<auto|always|never>— Whether to expand arrays and objects on multiple lines. When set toauto, object literals are formatted on multiple lines if the first property has a newline, and array literals are formatted on a single line if it fits in the line. When set toalways, these literals are formatted on multiple lines, regardless of length of the list. When set tonever, these literals are formatted on a single line if it fits in the line. When formattingpackage.json, Biome will usealwaysunless configured otherwise. Defaults to “auto”. -
--json-formatter-bracket-spacing=<true|false>— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--json-formatter-bracket-spacing=<true|false>— Whether to insert spaces around brackets in object literals. Defaults to true. -
--stdin-file-path=PATH— 当你想要格式化从stdin传输的代码并将输出打印到stdout时,请使用此选项。¥
--stdin-file-path=PATH— Use this option when you want to format code piped fromstdin, and print the output tostdout.文件不需要存在于磁盘上,重要的是文件的扩展名。基于扩展,Biome 知道如何格式化代码。
¥The file doesn’t need to exist on disk, what matters is the extension of the file. Based on the extension, Biome knows how to format the code.
示例:
shell echo 'let a;' | biome format --stdin-file-path=file.js --write¥Example:
shell echo 'let a;' | biome format --stdin-file-path=file.js --write -
--write— 将格式化文件写入文件系统。¥
--write— Writes formatted files to a file system. -
--fix—--write的别名,负责将格式化文件写入文件系统。¥
--fix— Alias of--write, writes formatted files to a file system. -
--staged— 设置为 true 时,只有已暂存的文件(准备提交的文件)才会被 linted。¥
--staged— When set to true, only the files that have been staged (the ones prepared to be committed) will be linted. -
--changed— 设置为 true 时,只有与defaultBranch配置相比已更改的文件才会被 linted。¥
--changed— When set to true, only the files that have been changed compared to yourdefaultBranchconfiguration will be linted. -
--since=REF— 当你使用--changed标志且 biome.json 中未设置defaultBranch时,请使用此设置指定要比较的基础分支。¥
--since=REF— Use this to specify the base branch to compare against when you’re using the —changed flag, and thedefaultBranchis not set in your biome.json -
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome ci
Section titled “biome ci”键盘编码对于无法使用鼠标、AT 兼容性和屏幕阅读器的主体残疾用户和屏幕阅读器用户来说非常重要。对请求的文件运行格式化程序、linter 和导入排序。
¥Command to use in CI environments. Runs formatter, linter and import sorting to the requested files.
文件不会被修改,该命令是只读操作。
¥Files won’t be modified, the command is a read-only operation.
用法:biome ci [--formatter-enabled=<true|false>] [--linter-enabled=<true|false>] [--assist-enabled=<true|false>] [--format-with-errors=<true|false>] [--enforce-assist=<true|false>] [--changed] [--since=REF] [PATH]…
¥Usage: biome ci [--formatter-enabled=<true|false>] [--linter-enabled=<true|false>] [--assist-enabled=<true|false>] [--format-with-errors=<true|false>] [--enforce-assist=<true|false>] [--changed] [--since=REF] [PATH]…
更改 JSON 解析器行为的选项
¥Options that changes how the JSON parser behaves
-
--json-parse-allow-comments=<true|false>— 允许解析.json文件中的注释。¥
--json-parse-allow-comments=<true|false>— Allow parsing comments in.jsonfiles -
--json-parse-allow-trailing-commas=<true|false>— 允许解析.json文件中的尾随逗号。¥
--json-parse-allow-trailing-commas=<true|false>— Allow parsing trailing commas in.jsonfiles
文件 biome.json 中包含的配置
¥The configuration that is contained inside the file biome.json
-
--vcs-enabled=<true|false>— Biome 是否应将自身与 VCS 客户端集成¥
--vcs-enabled=<true|false>— Whether Biome should integrate itself with the VCS client -
--vcs-client-kind=<git>— 客户端类型。¥
--vcs-client-kind=<git>— The kind of client. -
--vcs-use-ignore-file=<true|false>— Biome 是否应使用 VCS 忽略文件。当 [true] 时,Biome 将忽略忽略文件中指定的文件。¥
--vcs-use-ignore-file=<true|false>— Whether Biome should use the VCS ignore file. When [true], Biome will ignore the files specified in the ignore file. -
--vcs-root=PATH— Biome 应检查 VCS 文件的文件夹。默认情况下,Biome 将使用找到biome.json的同一文件夹。¥
--vcs-root=PATH— The folder where Biome should check for VCS files. By default, Biome will use the same folder wherebiome.jsonwas found.如果 Biome 找不到配置,它将尝试使用当前工作目录。如果找不到当前工作目录,Biome 将不会使用 VCS 集成,并且将发出诊断
¥If Biome can’t find the configuration, it will attempt to use the current working directory. If no current working directory can’t be found, Biome won’t use the VCS integration, and a diagnostic will be emitted
-
--vcs-default-branch=BRANCH— 项目的主要分支¥
--vcs-default-branch=BRANCH— The main branch of the project -
--files-max-size=NUMBER— 源代码文件的最大允许大小(以字节为单位)。出于性能原因,超过此限制的文件将被忽略。默认为 1 MiB¥
--files-max-size=NUMBER— The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB -
--files-ignore-unknown=<true|false>— 指示 Biome 在处理未知文件时不要发出诊断信息。¥
--files-ignore-unknown=<true|false>— Tells Biome to not emit diagnostics when handling files that it doesn’t know -
--format-with-errors=<true|false>— 如果给定文件存在语法错误,是否允许继续格式化¥
--format-with-errors=<true|false>— Whether formatting should be allowed to proceed if a given file has syntax errors -
--indent-style=<tab|space>— 缩进样式。¥
--indent-style=<tab|space>— The indent style. -
--indent-width=NUMBER— 缩进大小,默认为 2¥
--indent-width=NUMBER— The size of the indentation, 2 by default -
--line-ending=<lf|crlf|cr|auto>— 行尾类型。¥
--line-ending=<lf|crlf|cr|auto>— The type of line ending. -
--line-width=NUMBER— 行的最大宽度是多少。默认为 80。¥
--line-width=NUMBER— What’s the max width of a line. Defaults to 80. -
--attribute-position=<multiline|auto>— 类 HTML 语言中的属性位置样式。默认为 auto。¥
--attribute-position=<multiline|auto>— The attribute position style in HTML-ish languages. Defaults to auto. -
--bracket-same-line=<true|false>— 将多行 HTML 或 HTML 的>值设置为其他值。 JSX 元素位于最后一行的末尾,而不是单独位于下一行(不适用于自闭合元素)。¥
--bracket-same-line=<true|false>— Put the>of a multi-line HTML or JSX element at the end of the last line instead of being alone on the next line (does not apply to self closing elements). -
--bracket-spacing=<true|false>— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--bracket-spacing=<true|false>— Whether to insert spaces around brackets in object literals. Defaults to true. -
--expand=<auto|always|never>— 是否将数组和对象展开到多行设置为auto时,如果第一个属性包含换行符,则对象字面量将格式化为多行;如果数组字面量适合一行,则将其格式化为单行。设置为always时,无论列表长度如何,这些字面值都将格式化为多行。设置为never时,如果一行能够容纳所有字面值,则这些字面值将格式化为一行。格式化package.json时,除非另有配置,否则 Biome 将使用always。默认为 “auto”。¥
--expand=<auto|always|never>— Whether to expand arrays and objects on multiple lines. When set toauto, object literals are formatted on multiple lines if the first property has a newline, and array literals are formatted on a single line if it fits in the line. When set toalways, these literals are formatted on multiple lines, regardless of length of the list. When set tonever, these literals are formatted on a single line if it fits in the line. When formattingpackage.json, Biome will usealwaysunless configured otherwise. Defaults to “auto”. -
--use-editorconfig=<true|false>— 使用任何.editorconfig文件来配置格式化程序。biome.json中的配置将覆盖.editorconfig配置。¥
--use-editorconfig=<true|false>— Use any.editorconfigfiles to configure the formatter. Configuration inbiome.jsonwill override.editorconfigconfiguration.默认:
true。¥Default:
true. -
--jsx-everywhere=<true|false>— 启用后,.js/.mjs/.cjs等文件可以包含 JSX 语法。¥
--jsx-everywhere=<true|false>— When enabled, files like.js/.mjs/.cjsmay contain JSX syntax.默认为
true。¥Defaults to
true. -
--javascript-formatter-enabled=<true|false>— 控制 JavaScript(及其超级语言)文件的格式化程序。¥
--javascript-formatter-enabled=<true|false>— Control the formatter for JavaScript (and its super languages) files. -
--jsx-quote-style=<double|single>— JSX 中使用的引号类型。默认为 double。¥
--jsx-quote-style=<double|single>— The type of quotes used in JSX. Defaults to double. -
--quote-properties=<preserve|as-needed>— 对象中的属性被引用时。默认为 asNeeded。¥
--quote-properties=<preserve|as-needed>— When properties in objects are quoted. Defaults to asNeeded. -
--trailing-commas=<all|es5|none>— 在多行逗号分隔的语法结构中尽可能打印尾随逗号。默认为 “all”。¥
--trailing-commas=<all|es5|none>— Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to “all”. -
--semicolons=<always|as-needed>— 格式化程序是否为所有语句打印分号,还是仅在由于 ASI 而需要的 for 语句中打印分号。¥
--semicolons=<always|as-needed>— Whether the formatter prints semicolons for all statements or only in for statements where it is necessary because of ASI. -
--arrow-parentheses=<always|as-needed>— 是否向箭头函数添加不必要的括号。默认为 “always”。¥
--arrow-parentheses=<always|as-needed>— Whether to add non-necessary parentheses to arrow functions. Defaults to “always”. -
--bracket-same-line=<true|false>— 是否将多行 HTML/JSX 标签的右括号放在最后一行的末尾,而不是单独放在下一行。默认为 false。¥
--bracket-same-line=<true|false>— Whether to hug the closing bracket of multiline HTML/JSX tags to the end of the last line, rather than being alone on the following line. Defaults to false. -
--javascript-formatter-indent-style=<tab|space>— 应用于 JavaScript(及其超级语言)文件的缩进样式。¥
--javascript-formatter-indent-style=<tab|space>— The indent style applied to JavaScript (and its super languages) files. -
--javascript-formatter-indent-width=NUMBER— 应用于 JavaScript(及其超级语言)文件的缩进大小。默认为 2。¥
--javascript-formatter-indent-width=NUMBER— The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. -
--javascript-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 JavaScript(及其超级语言)文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--javascript-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to JavaScript (and its super languages) files.autouses CRLF on Windows and LF on other platforms. -
--javascript-formatter-line-width=NUMBER— 应用于 JavaScript(及其超级语言)文件的行的最大宽度是多少。默认为 80。¥
--javascript-formatter-line-width=NUMBER— What’s the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80. -
--javascript-formatter-quote-style=<double|single>— JavaScript 代码中使用的引号类型。默认为 double。¥
--javascript-formatter-quote-style=<double|single>— The type of quotes used in JavaScript code. Defaults to double. -
--javascript-formatter-attribute-position=<multiline|auto>— JSX 元素中的属性位置样式。默认为 auto。¥
--javascript-formatter-attribute-position=<multiline|auto>— The attribute position style in JSX elements. Defaults to auto. -
--javascript-formatter-bracket-spacing=<true|false>— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--javascript-formatter-bracket-spacing=<true|false>— Whether to insert spaces around brackets in object literals. Defaults to true. -
--javascript-formatter-expand=<auto|always|never>— 是否将数组和对象展开到多行设置为auto时,如果第一个属性包含换行符,则对象字面量将格式化为多行;如果数组字面量适合一行,则将其格式化为单行。设置为always时,无论列表长度如何,这些字面值都将格式化为多行。设置为never时,如果一行能够容纳所有字面值,则这些字面值将格式化为一行。格式化package.json时,除非另有配置,否则 Biome 将使用always。默认为 “auto”。¥
--javascript-formatter-expand=<auto|always|never>— Whether to expand arrays and objects on multiple lines. When set toauto, object literals are formatted on multiple lines if the first property has a newline, and array literals are formatted on a single line if it fits in the line. When set toalways, these literals are formatted on multiple lines, regardless of length of the list. When set tonever, these literals are formatted on a single line if it fits in the line. When formattingpackage.json, Biome will usealwaysunless configured otherwise. Defaults to “auto”. -
--javascript-formatter-operator-linebreak=<before|after>— 将二进制表达式拆分为多行时,是在二进制运算符之前还是之后进行拆分。默认为 “after”。¥
--javascript-formatter-operator-linebreak=<before|after>— When breaking binary expressions into multiple lines, whether to break them before or after the binary operator. Defaults to “after”. -
--javascript-linter-enabled=<true|false>— 控制 JavaScript(及其超级语言)文件的 linter。¥
--javascript-linter-enabled=<true|false>— Control the linter for JavaScript (and its super languages) files. -
--javascript-assist-enabled=<true|false>— 控制 JavaScript(及其上级语言)文件的辅助功能。 (及其上级语言)文件。¥
--javascript-assist-enabled=<true|false>— Control the assist for JavaScript (and its super languages) files. -
--json-parse-allow-comments=<true|false>— 允许解析.json文件中的注释。¥
--json-parse-allow-comments=<true|false>— Allow parsing comments in.jsonfiles -
--json-parse-allow-trailing-commas=<true|false>— 允许解析.json文件中的尾随逗号。¥
--json-parse-allow-trailing-commas=<true|false>— Allow parsing trailing commas in.jsonfiles -
--json-formatter-enabled=<true|false>— 控制 JSON(及其超级语言)文件的格式化程序。¥
--json-formatter-enabled=<true|false>— Control the formatter for JSON (and its super languages) files. -
--json-formatter-indent-style=<tab|space>— 应用于 JSON(及其超级语言)文件的缩进样式。¥
--json-formatter-indent-style=<tab|space>— The indent style applied to JSON (and its super languages) files. -
--json-formatter-indent-width=NUMBER— 应用于 JSON(及其超级语言)文件的缩进大小。默认为 2。¥
--json-formatter-indent-width=NUMBER— The size of the indentation applied to JSON (and its super languages) files. Default to 2. -
--json-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 JSON(及其超级语言)文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--json-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to JSON (and its super languages) files.autouses CRLF on Windows and LF on other platforms. -
--json-formatter-line-width=NUMBER— 应用于 JSON(及其超级语言)文件的行的最大宽度是多少。默认为 80。¥
--json-formatter-line-width=NUMBER— What’s the max width of a line applied to JSON (and its super languages) files. Defaults to 80. -
--json-formatter-trailing-commas=<none|all>— 在多行逗号分隔的语法结构中尽可能打印尾随逗号。默认为 “none”。¥
--json-formatter-trailing-commas=<none|all>— Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to “none”. -
--json-formatter-expand=<auto|always|never>— 是否将数组和对象展开到多行设置为auto时,如果第一个属性包含换行符,则对象字面量将格式化为多行;如果数组字面量适合一行,则将其格式化为单行。设置为always时,无论列表长度如何,这些字面值都将格式化为多行。设置为never时,如果一行能够容纳所有字面值,则这些字面值将格式化为一行。格式化package.json时,除非另有配置,否则 Biome 将使用always。默认为 “auto”。¥
--json-formatter-expand=<auto|always|never>— Whether to expand arrays and objects on multiple lines. When set toauto, object literals are formatted on multiple lines if the first property has a newline, and array literals are formatted on a single line if it fits in the line. When set toalways, these literals are formatted on multiple lines, regardless of length of the list. When set tonever, these literals are formatted on a single line if it fits in the line. When formattingpackage.json, Biome will usealwaysunless configured otherwise. Defaults to “auto”. -
--json-formatter-bracket-spacing=<true|false>— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--json-formatter-bracket-spacing=<true|false>— Whether to insert spaces around brackets in object literals. Defaults to true. -
--json-linter-enabled=<true|false>— 控制 JSON(及其超级语言)文件的 linter。¥
--json-linter-enabled=<true|false>— Control the linter for JSON (and its super languages) files. -
--json-assist-enabled=<true|false>— 控制 JSON(及其上级语言)文件的辅助功能。¥
--json-assist-enabled=<true|false>— Control the assist for JSON (and its super languages) files. -
--css-parse-css-modules=<true|false>— 启用 CSS Modules 特定功能的解析。¥
--css-parse-css-modules=<true|false>— Enables parsing of CSS Modules specific features. -
--css-parse-tailwind-directives=<true|false>— 启用 Tailwind CSS 4.0 指令和函数的解析。¥
--css-parse-tailwind-directives=<true|false>— Enables parsing of Tailwind CSS 4.0 directives and functions. -
--css-formatter-enabled=<true|false>— 控制 CSS(及其超级语言)文件的格式化程序。¥
--css-formatter-enabled=<true|false>— Control the formatter for CSS (and its super languages) files. -
--css-formatter-indent-style=<tab|space>— 应用于 CSS(及其超级语言)文件的缩进样式。¥
--css-formatter-indent-style=<tab|space>— The indent style applied to CSS (and its super languages) files. -
--css-formatter-indent-width=NUMBER— 应用于 CSS(及其超级语言)文件的缩进大小。默认为 2。¥
--css-formatter-indent-width=NUMBER— The size of the indentation applied to CSS (and its super languages) files. Default to 2. -
--css-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 CSS(及其超级语言)文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--css-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to CSS (and its super languages) files.autouses CRLF on Windows and LF on other platforms. -
--css-formatter-line-width=NUMBER— 应用于 CSS(及其超级语言)文件的行的最大宽度是多少。默认为 80。¥
--css-formatter-line-width=NUMBER— What’s the max width of a line applied to CSS (and its super languages) files. Defaults to 80. -
--css-formatter-quote-style=<double|single>— CSS 代码中使用的引号类型。默认为 double。¥
--css-formatter-quote-style=<double|single>— The type of quotes used in CSS code. Defaults to double. -
--css-linter-enabled=<true|false>— 控制 CSS 文件的 linter。¥
--css-linter-enabled=<true|false>— Control the linter for CSS files. -
--css-assist-enabled=<true|false>— 控制 CSS 文件的辅助功能。¥
--css-assist-enabled=<true|false>— Control the assist for CSS files. -
--graphql-formatter-enabled=<true|false>— 控制 GraphQL 文件的格式化程序。¥
--graphql-formatter-enabled=<true|false>— Control the formatter for GraphQL files. -
--graphql-formatter-indent-style=<tab|space>— 应用于 GraphQL 文件的缩进样式。¥
--graphql-formatter-indent-style=<tab|space>— The indent style applied to GraphQL files. -
--graphql-formatter-indent-width=NUMBER— 应用于 GraphQL 文件的缩进大小。默认为 2。¥
--graphql-formatter-indent-width=NUMBER— The size of the indentation applied to GraphQL files. Default to 2. -
--graphql-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 GraphQL 文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--graphql-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to GraphQL files.autouses CRLF on Windows and LF on other platforms. -
--graphql-formatter-line-width=NUMBER— 应用于 GraphQL 文件的行的最大宽度是多少。默认为 80。¥
--graphql-formatter-line-width=NUMBER— What’s the max width of a line applied to GraphQL files. Defaults to 80. -
--graphql-formatter-quote-style=<double|single>— GraphQL 代码中使用的引号类型。默认为 double。¥
--graphql-formatter-quote-style=<double|single>— The type of quotes used in GraphQL code. Defaults to double. -
--graphql-linter-enabled=<true|false>— 控制 GraphQL 文件的格式化程序。¥
--graphql-linter-enabled=<true|false>— Control the formatter for GraphQL files. -
--graphql-assist-enabled=<true|false>— 控制 GraphQL 文件的格式化程序。¥
--graphql-assist-enabled=<true|false>— Control the formatter for GraphQL files. -
--grit-formatter-enabled=<true|false>— 控制 Grit 文件的格式化程序。¥
--grit-formatter-enabled=<true|false>— Control the formatter for Grit files. -
--grit-formatter-indent-style=<tab|space>— 应用于 Grit 文件的缩进样式。¥
--grit-formatter-indent-style=<tab|space>— The indent style applied to Grit files. -
--grit-formatter-indent-width=NUMBER— 应用于 Grit 文件的缩进大小。默认为 2。¥
--grit-formatter-indent-width=NUMBER— The size of the indentation applied to Grit files. Default to 2. -
--grit-formatter-line-ending=<lf|crlf|cr>— 应用于 Grit 文件的行尾类型。¥
--grit-formatter-line-ending=<lf|crlf|cr>— The type of line ending applied to Grit files. -
--grit-formatter-line-width=NUMBER— 应用于 Grit 文件的最大行宽。默认为 80。¥
--grit-formatter-line-width=NUMBER— What’s the max width of a line applied to Grit files. Defaults to 80. -
--grit-linter-enabled=<true|false>— 控制 Grit 文件的代码检查器。¥
--grit-linter-enabled=<true|false>— Control the linter for Grit files. -
--grit-assist-enabled=<true|false>— 控制 Grit 文件的辅助功能。¥
--grit-assist-enabled=<true|false>— Control the assist functionality for Grit files. -
--html-formatter-enabled=<true|false>— 控制 HTML(及其上级语言)文件的格式化程序。¥
--html-formatter-enabled=<true|false>— Control the formatter for HTML (and its super languages) files. -
--html-formatter-indent-style=<tab|space>— 应用于 HTML(及其上级语言)文件的缩进样式。¥
--html-formatter-indent-style=<tab|space>— The indent style applied to HTML (and its super languages) files. -
--html-formatter-indent-width=NUMBER— 应用于 HTML(及其上级语言)文件的缩进大小。默认为 2。¥
--html-formatter-indent-width=NUMBER— The size of the indentation applied to HTML (and its super languages) files. Default to 2. -
--html-formatter-line-ending=<lf|crlf|cr|auto>— 应用于 HTML(及其上级语言)文件的行尾类型。auto在 Windows 上使用 CRLF,在其他平台上使用 LF。¥
--html-formatter-line-ending=<lf|crlf|cr|auto>— The type of line ending applied to HTML (and its super languages) files.autouses CRLF on Windows and LF on other platforms. -
--html-formatter-line-width=NUMBER— 应用于 HTML(及其上级语言)文件的最大行宽。默认为 80。¥
--html-formatter-line-width=NUMBER— What’s the max width of a line applied to HTML (and its super languages) files. Defaults to 80. -
--html-formatter-attribute-position=<multiline|auto>— HTML 元素中的属性位置样式。默认为 auto。¥
--html-formatter-attribute-position=<multiline|auto>— The attribute position style in HTML elements. Defaults to auto. -
--html-formatter-bracket-same-line=<true|false>— 多行 HTML 标签的右括号是否紧贴最后一行末尾,而不是单独位于下一行默认为 false。¥
--html-formatter-bracket-same-line=<true|false>— Whether to hug the closing bracket of multiline HTML tags to the end of the last line, rather than being alone on the following line. Defaults to false. -
--html-formatter-whitespace-sensitivity=<css|strict|ignore>— 格式化 HTML(及其上级语言)时是否考虑空格敏感性默认为 “css”。¥
--html-formatter-whitespace-sensitivity=<css|strict|ignore>— Whether to account for whitespace sensitivity when formatting HTML (and its super languages). Defaults to “css”. -
--html-formatter-indent-script-and-style=<true|false>— 是否缩进 HTML(及其上级语言)的<script>和<style>标签默认为 false。¥
--html-formatter-indent-script-and-style=<true|false>— Whether to indent the<script>and<style>tags for HTML (and its super languages). Defaults to false. -
--html-formatter-self-close-void-elements=<always|never>— 空元素是否应该自闭合默认从不。¥
--html-formatter-self-close-void-elements=<always|never>— Whether void elements should be self-closed. Defaults to never. -
--html-linter-enabled=<true|false>— 控制 HTML(及其上级语言)文件的代码检查器。¥
--html-linter-enabled=<true|false>— Control the linter for HTML (and its super languages) files. -
--html-assist-enabled=<true|false>— 控制 HTML(及其上级语言)文件的辅助功能。¥
--html-assist-enabled=<true|false>— Control the assist for HTML (and its super languages) files. -
--assist-enabled=<true|false>— Biome 是否应通过 LSP 和 CLI 启用辅助功能。¥
--assist-enabled=<true|false>— Whether Biome should enable assist via LSP and CLI.
应用于所有命令的全局选项
¥Global options applied to all commands
-
--colors=<off|force>— 设置标记的格式化模式:“off” 将所有内容打印为纯文本,即使确定控制台输出不兼容,“force” 也会强制使用 ANSI 格式化标记¥
--colors=<off|force>— Set the formatting mode for markup: “off” prints everything as plain text, “force” forces the formatting of markup using ANSI even if the console output is determined to be incompatible -
--use-server— 连接到 Biome 守护进程服务器的正在运行的实例。¥
--use-server— Connect to a running instance of the Biome daemon server. -
--verbose— 打印其他诊断信息,某些诊断信息会显示更多信息。此外,打印出处理了哪些文件以及修改了哪些文件。¥
--verbose— Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified. -
--config-path=PATH— 设置配置文件的文件路径,或查找biome.json或biome.jsonc的目录路径。如果使用,它将禁用默认配置文件解析。¥
--config-path=PATH— Set the file path to the configuration file, or the directory path to findbiome.jsonorbiome.jsonc. If used, it disables the default configuration file resolution.使用环境变量
BIOME_CONFIG_PATH¥Uses environment variable
BIOME_CONFIG_PATH -
--max-diagnostics=<none|<NUMBER>>— 限制显示的诊断数量。当提供none时,限制被解除。¥
--max-diagnostics=<none|<NUMBER>>— Cap the amount of diagnostics displayed. Whennoneis provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-parse-errors— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-parse-errors— Skip over files containing syntax errors instead of emitting an error diagnostic. -
--no-errors-on-unmatched— 如果在执行命令期间没有处理任何文件,则静音将发出的错误。¥
--no-errors-on-unmatched— Silence errors that would be emitted in case no files were processed during the execution of the command. -
--error-on-warnings— 如果某些诊断发出警告,则告诉 Biome 退出并显示错误代码。¥
--error-on-warnings— Tell Biome to exit with an error code if some diagnostics emit warnings. -
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— 允许更改诊断和摘要的报告方式。¥
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— Allows to change how diagnostics and summary are reported. -
--log-file=ARG— 日志消息重定向的可选路径。¥
--log-file=ARG— Optional path to redirect log messages to.如果省略,日志将输出到标准输出 (stdout)。
¥If omitted, logs are printed to stdout.
-
--log-level=<none|debug|info|warn|error>— 日志记录级别。按从最详细到最不详细的顺序:调试、信息、警告、错误。¥
--log-level=<none|debug|info|warn|error>— The level of logging. In order, from the most verbose to the least verbose: debug, info, warn, error.值
none不会显示任何日志记录。¥The value
nonewon’t show any logging.[默认:无]
¥[default: none]
-
--log-kind=<pretty|compact|json>— 日志应如何显示。¥
--log-kind=<pretty|compact|json>— How the log should look like.[默认:漂亮]
¥[default: pretty]
-
--diagnostic-level=<info|warn|error>— 要显示的诊断级别。按从最低到最重要的顺序:信息、警告、错误。传递--diagnostic-level=error将导致 Biome 仅打印仅包含错误的诊断信息。¥
--diagnostic-level=<info|warn|error>— The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing--diagnostic-level=errorwill cause Biome to print only diagnostics that contain only errors.[默认:信息]
¥[default: info]
可用位置项:
¥Available positional items:
-
PATH— 单个文件、单个路径或路径列表¥
PATH— Single file, single path or list of paths
可用选项:
¥Available options:
-
--formatter-enabled=<true|false>— 允许启用或禁用格式化检查。¥
--formatter-enabled=<true|false>— Allow enabling or disabling the formatter check. -
--linter-enabled=<true|false>— 允许启用或禁用代码检查。¥
--linter-enabled=<true|false>— Allow enabling or disable the linter check. -
--assist-enabled=<true|false>— 允许启用或禁用辅助功能。¥
--assist-enabled=<true|false>— Allow enabling or disabling the assist. -
--format-with-errors=<true|false>— 如果给定文件存在语法错误,是否允许继续格式化¥
--format-with-errors=<true|false>— Whether formatting should be allowed to proceed if a given file has syntax errors -
--enforce-assist=<true|false>— 允许强制启用辅助功能,如果某些操作未执行,则 CLI 失败。默认为true。¥
--enforce-assist=<true|false>— Allows enforcing assist, and make the CLI fail if some actions aren’t applied. Defaults totrue. -
--changed— 设置为 true 时,只有与defaultBranch配置相比已更改的文件才会被 linted。¥
--changed— When set to true, only the files that have been changed compared to yourdefaultBranchconfiguration will be linted. -
--since=REF— 当你使用 —changed 标志并且defaultBranch未在你的 biome.json 中设置时,使用此方法指定要与之比较的基本分支¥
--since=REF— Use this to specify the base branch to compare against when you’re using the —changed flag and thedefaultBranchis not set in your biome.json -
--threads=NUMBER— 数量要使用的线程。在资源有限的环境中运行 CLI 时(例如 CI),这将非常有用。¥
--threads=NUMBER— The number of threads to use. This is useful when running the CLI in environments with limited resource, for example CI.使用环境变量
BIOME_THREADS¥Uses environment variable
BIOME_THREADS -
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome init
Section titled “biome init”引导一个新的 biome 项目。创建具有一些默认值的配置文件。
¥Bootstraps a new biome project. Creates a configuration file with some defaults.
用法:biome init [--jsonc]
¥Usage: biome init [--jsonc]
可用选项:
¥Available options:
-
--jsonc— 告诉 Biome 发出biome.jsonc文件。¥
--jsonc— Tells Biome to emit abiome.jsoncfile. -
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome lsp-proxy
Section titled “biome lsp-proxy”充当 stdin/stdout 上的语言服务器协议的服务器。
¥Acts as a server for the Language Server Protocol over stdin/stdout.
用法:biome lsp-proxy
¥Usage: biome lsp-proxy
可用选项:
¥Available options:
-
--log-prefix-name=STRING— 允许更改应用于日志文件名的前缀。¥
--log-prefix-name=STRING— Allows to change the prefix applied to the file name of the logs.使用环境变量
BIOME_LOG_PREFIX_NAME¥Uses environment variable
BIOME_LOG_PREFIX_NAME[默认:server.log]
¥[default: server.log]
-
--log-path=PATH— 允许更改存储日志的文件夹。¥
--log-path=PATH— Allows to change the folder where logs are stored.使用环境变量
BIOME_LOG_PATH¥Uses environment variable
BIOME_LOG_PATH -
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome migrate
Section titled “biome migrate”在发生重大更改时更新配置。
¥Updates the configuration when there are breaking changes.
用法:biome migrate [--write] [COMMAND ...]
¥Usage: biome migrate [--write] [COMMAND ...]
应用于所有命令的全局选项
¥Global options applied to all commands
-
--colors=<off|force>— 设置标记的格式化模式:“off” 将所有内容打印为纯文本,即使确定控制台输出不兼容,“force” 也会强制使用 ANSI 格式化标记¥
--colors=<off|force>— Set the formatting mode for markup: “off” prints everything as plain text, “force” forces the formatting of markup using ANSI even if the console output is determined to be incompatible -
--use-server— 连接到 Biome 守护进程服务器的正在运行的实例。¥
--use-server— Connect to a running instance of the Biome daemon server. -
--verbose— 打印其他诊断信息,某些诊断信息会显示更多信息。此外,打印出处理了哪些文件以及修改了哪些文件。¥
--verbose— Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified. -
--config-path=PATH— 设置配置文件的文件路径,或查找biome.json或biome.jsonc的目录路径。如果使用,它将禁用默认配置文件解析。¥
--config-path=PATH— Set the file path to the configuration file, or the directory path to findbiome.jsonorbiome.jsonc. If used, it disables the default configuration file resolution.使用环境变量
BIOME_CONFIG_PATH¥Uses environment variable
BIOME_CONFIG_PATH -
--max-diagnostics=<none|<NUMBER>>— 限制显示的诊断数量。当提供none时,限制被解除。¥
--max-diagnostics=<none|<NUMBER>>— Cap the amount of diagnostics displayed. Whennoneis provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-parse-errors— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-parse-errors— Skip over files containing syntax errors instead of emitting an error diagnostic. -
--no-errors-on-unmatched— 如果在执行命令期间没有处理任何文件,则静音将发出的错误。¥
--no-errors-on-unmatched— Silence errors that would be emitted in case no files were processed during the execution of the command. -
--error-on-warnings— 如果某些诊断发出警告,则告诉 Biome 退出并显示错误代码。¥
--error-on-warnings— Tell Biome to exit with an error code if some diagnostics emit warnings. -
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— 允许更改诊断和摘要的报告方式。¥
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— Allows to change how diagnostics and summary are reported. -
--log-file=ARG— 日志消息重定向的可选路径。¥
--log-file=ARG— Optional path to redirect log messages to.如果省略,日志将输出到标准输出 (stdout)。
¥If omitted, logs are printed to stdout.
-
--log-level=<none|debug|info|warn|error>— 日志记录级别。按从最详细到最不详细的顺序:调试、信息、警告、错误。¥
--log-level=<none|debug|info|warn|error>— The level of logging. In order, from the most verbose to the least verbose: debug, info, warn, error.值
none不会显示任何日志记录。¥The value
nonewon’t show any logging.[默认:无]
¥[default: none]
-
--log-kind=<pretty|compact|json>— 日志应如何显示。¥
--log-kind=<pretty|compact|json>— How the log should look like.[默认:漂亮]
¥[default: pretty]
-
--diagnostic-level=<info|warn|error>— 要显示的诊断级别。按从最低到最重要的顺序:信息、警告、错误。传递--diagnostic-level=error将导致 Biome 仅打印仅包含错误的诊断信息。¥
--diagnostic-level=<info|warn|error>— The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing--diagnostic-level=errorwill cause Biome to print only diagnostics that contain only errors.[默认:信息]
¥[default: info]
可用选项:
¥Available options:
-
--write— 将新配置文件写入磁盘¥
--write— Writes the new configuration file to disk -
--fix—--write的别名,将新配置文件写入磁盘¥
--fix— Alias of--write, writes the new configuration file to disk -
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
可用命令:
¥Available commands:
-
prettier— 它尝试找到文件.prettierrc/prettier.json和.prettierignore,并将 Prettier 的配置映射到 Biome 的配置文件中。¥
prettier— It attempts to find the files.prettierrc/prettier.jsonand.prettierignore, and map the Prettier’s configuration into Biome’s configuration file. -
eslint— 它尝试在工作目录中找到 ESLint 配置文件,并据此更新 Biome 的配置文件。¥
eslint— It attempts to find the ESLint configuration file in the working directory, and update the Biome’s configuration file as a result.
biome migrate Prettier
Section titled “biome migrate Prettier”它尝试查找文件 .prettierrc/prettier.json 和 .prettierignore,并将 Prettier 的配置映射到 Biome 的配置文件中。
¥It attempts to find the files .prettierrc/prettier.json and .prettierignore, and map the Prettier’s configuration into Biome’s configuration file.
用法:biome migrate prettier
¥Usage: biome migrate prettier
可用选项:
¥Available options:
-
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome migrate eslint
Section titled “biome migrate eslint”它尝试在工作目录中找到 ESLint 配置文件,并因此更新 Biome 的配置文件。
¥It attempts to find the ESLint configuration file in the working directory, and update the Biome’s configuration file as a result.
用法:biome migrate eslint [--include-inspired] [--include-nursery]
¥Usage: biome migrate eslint [--include-inspired] [--include-nursery]
可用选项:
¥Available options:
-
--include-inspired— 在迁移中包含受 eslint 规则启发的规则¥
--include-inspired— Includes rules inspired from an eslint rule in the migration -
--include-nursery— 在迁移中包含托儿所规则¥
--include-nursery— Includes nursery rules in the migration -
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome search
Section titled “biome search”EXPERIMENTAL:在项目中搜索 Grit 模式。
¥EXPERIMENTAL: Searches for Grit patterns across a project.
注意:GritQL 使用反引号转义代码片段,但大多数 shell 将反引号解释为命令调用。为避免这种情况,最好在 Grit 查询周围加上单引号。
¥Note: GritQL escapes code snippets using backticks, but most shells interpret backticks as command invocations. To avoid this, it’s best to put single quotes around your Grit queries.
¥Example
biome search '`console.log($message)`' # find all `console.log` invocations用法:biome search [-l=ARG] PATTERN [PATH]…
¥Usage: biome search [-l=ARG] PATTERN [PATH]…
应用于所有命令的全局选项
¥Global options applied to all commands
-
--colors=<off|force>— 设置标记的格式化模式:“off” 将所有内容打印为纯文本,即使确定控制台输出不兼容,“force” 也会强制使用 ANSI 格式化标记¥
--colors=<off|force>— Set the formatting mode for markup: “off” prints everything as plain text, “force” forces the formatting of markup using ANSI even if the console output is determined to be incompatible -
--use-server— 连接到 Biome 守护进程服务器的正在运行的实例。¥
--use-server— Connect to a running instance of the Biome daemon server. -
--verbose— 打印其他诊断信息,某些诊断信息会显示更多信息。此外,打印出处理了哪些文件以及修改了哪些文件。¥
--verbose— Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified. -
--config-path=PATH— 设置配置文件的文件路径,或查找biome.json或biome.jsonc的目录路径。如果使用,它将禁用默认配置文件解析。¥
--config-path=PATH— Set the file path to the configuration file, or the directory path to findbiome.jsonorbiome.jsonc. If used, it disables the default configuration file resolution.使用环境变量
BIOME_CONFIG_PATH¥Uses environment variable
BIOME_CONFIG_PATH -
--max-diagnostics=<none|<NUMBER>>— 限制显示的诊断数量。当提供none时,限制被解除。¥
--max-diagnostics=<none|<NUMBER>>— Cap the amount of diagnostics displayed. Whennoneis provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-parse-errors— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-parse-errors— Skip over files containing syntax errors instead of emitting an error diagnostic. -
--no-errors-on-unmatched— 如果在执行命令期间没有处理任何文件,则静音将发出的错误。¥
--no-errors-on-unmatched— Silence errors that would be emitted in case no files were processed during the execution of the command. -
--error-on-warnings— 如果某些诊断发出警告,则告诉 Biome 退出并显示错误代码。¥
--error-on-warnings— Tell Biome to exit with an error code if some diagnostics emit warnings. -
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— 允许更改诊断和摘要的报告方式。¥
--reporter=<json|json-pretty|github|junit|summary|gitlab|checkstyle|rdjson>— Allows to change how diagnostics and summary are reported. -
--log-file=ARG— 日志消息重定向的可选路径。¥
--log-file=ARG— Optional path to redirect log messages to.如果省略,日志将输出到标准输出 (stdout)。
¥If omitted, logs are printed to stdout.
-
--log-level=<none|debug|info|warn|error>— 日志记录级别。按从最详细到最不详细的顺序:调试、信息、警告、错误。¥
--log-level=<none|debug|info|warn|error>— The level of logging. In order, from the most verbose to the least verbose: debug, info, warn, error.值
none不会显示任何日志记录。¥The value
nonewon’t show any logging.[默认:无]
¥[default: none]
-
--log-kind=<pretty|compact|json>— 日志应如何显示。¥
--log-kind=<pretty|compact|json>— How the log should look like.[默认:漂亮]
¥[default: pretty]
-
--diagnostic-level=<info|warn|error>— 要显示的诊断级别。按从最低到最重要的顺序:信息、警告、错误。传递--diagnostic-level=error将导致 Biome 仅打印仅包含错误的诊断信息。¥
--diagnostic-level=<info|warn|error>— The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing--diagnostic-level=errorwill cause Biome to print only diagnostics that contain only errors.[默认:信息]
¥[default: info]
文件系统的配置
¥The configuration of the filesystem
-
--files-max-size=NUMBER— 源代码文件的最大允许大小(以字节为单位)。出于性能原因,超过此限制的文件将被忽略。默认为 1 MiB¥
--files-max-size=NUMBER— The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB -
--files-ignore-unknown=<true|false>— 指示 Biome 在处理未知文件时不要发出诊断信息。¥
--files-ignore-unknown=<true|false>— Tells Biome to not emit diagnostics when handling files that it doesn’t know
将 Biome 与 VCS 软件集成的属性集。
¥Set of properties to integrate Biome with a VCS software.
-
--vcs-enabled=<true|false>— Biome 是否应将自身与 VCS 客户端集成¥
--vcs-enabled=<true|false>— Whether Biome should integrate itself with the VCS client -
--vcs-client-kind=<git>— 客户端类型。¥
--vcs-client-kind=<git>— The kind of client. -
--vcs-use-ignore-file=<true|false>— Biome 是否应使用 VCS 忽略文件。当 [true] 时,Biome 将忽略忽略文件中指定的文件。¥
--vcs-use-ignore-file=<true|false>— Whether Biome should use the VCS ignore file. When [true], Biome will ignore the files specified in the ignore file. -
--vcs-root=PATH— Biome 应检查 VCS 文件的文件夹。默认情况下,Biome 将使用找到biome.json的同一文件夹。¥
--vcs-root=PATH— The folder where Biome should check for VCS files. By default, Biome will use the same folder wherebiome.jsonwas found.如果 Biome 找不到配置,它将尝试使用当前工作目录。如果找不到当前工作目录,Biome 将不会使用 VCS 集成,并且将发出诊断
¥If Biome can’t find the configuration, it will attempt to use the current working directory. If no current working directory can’t be found, Biome won’t use the VCS integration, and a diagnostic will be emitted
-
--vcs-default-branch=BRANCH— 项目的主要分支¥
--vcs-default-branch=BRANCH— The main branch of the project
可用位置项:
¥Available positional items:
-
PATTERN— 要搜索的 GritQL 模式。¥
PATTERN— The GritQL pattern to search for.请注意,搜索命令(当前)不支持重写。
¥Note that the search command (currently) does not support rewrites.
-
PATH— 单个文件、单个路径或路径列表。¥
PATH— Single file, single path or list of paths.
可用选项:
¥Available options:
-
--stdin-file-path=PATH— 当你想要搜索从stdin传输的代码并将输出打印到stdout时,请使用此选项。¥
--stdin-file-path=PATH— Use this option when you want to search through code piped fromstdin, and print the output tostdout.文件不需要存在于磁盘上,重要的是文件的扩展名。基于扩展,Biome 知道如何解析代码。
¥The file doesn’t need to exist on disk, what matters is the extension of the file. Based on the extension, Biome knows how to parse the code.
示例:
shell echo 'let a;' | biome search 'let $var' --stdin-file-path=file.js¥Example:
shell echo 'let a;' | biome search '`let $var`' --stdin-file-path=file.js -
-l、--language和ARG— 此模式适用的语言。¥
-l,--language=ARG— The language to which the pattern applies.Grit 查询特定于其目标语言的语法,因此我们目前不支持编写同时适用于多种语言的查询。
¥Grit queries are specific to the grammar of the language they target, so we currently do not support writing queries that apply to multiple languages at once.
如果未指定语言,则默认语言为 JavaScript。
¥When none, the default language is JavaScript.
-
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome explain
Section titled “biome explain”显示 CLI 各个方面的文档。
¥Shows documentation of various aspects of the CLI.
¥Examples
biome explain noDebuggerbiome explain daemon-logs用法:biome explain NAME
¥Usage: biome explain NAME
可用位置项:
¥Available positional items:
-
NAME— 显示文档的单个名称。¥
NAME— Single name to display documentation for.
可用选项:
¥Available options:
-
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
biome clean
Section titled “biome clean”清除守护进程发出的日志。
¥Cleans the logs emitted by the daemon.
用法:biome clean
¥Usage: biome clean
可用选项:
¥Available options:
-
-h、--help— 打印帮助信息¥
-h,--help— Prints help information
¥Useful information
-
遇到符号链接时,CLI 会将其扩展至三级深度。更深的级别将导致错误诊断。
¥When encountering symbolic links, the CLI will expand them until three levels deep. Deeper levels will result into an error diagnostic.
Biome v2.1 中文网 - 粤ICP备13048890号