CLI
¥Command summary
biome
Section titled biomeBiome 官方 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.json
orbiome.jsonc
. If used, it disables the default configuration file resolution. -
--max-diagnostics
=<none|<NUMBER>>
— 限制显示的诊断数量。当提供none
时,限制被解除。¥
--max-diagnostics
=<none|<NUMBER>>
— Cap the amount of diagnostics displayed. Whennone
is provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-errors
— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-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>
— 允许更改诊断和摘要的报告方式。¥
--reporter
=<json|json-pretty|github|junit|summary|gitlab>
— Allows to change how diagnostics and summary are reported. -
--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
none
won’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=error
will 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.json
orbiome.jsonc
. If used, it disables the default configuration file resolution. -
--max-diagnostics
=<none|<NUMBER>>
— 限制显示的诊断数量。当提供none
时,限制被解除。¥
--max-diagnostics
=<none|<NUMBER>>
— Cap the amount of diagnostics displayed. Whennone
is provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-errors
— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-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>
— 允许更改诊断和摘要的报告方式。¥
--reporter
=<json|json-pretty|github|junit|summary|gitlab>
— Allows to change how diagnostics and summary are reported. -
--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
none
won’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=error
will 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
[--config-path
=PATH
]
¥Usage: biome
start
[--config-path
=PATH
]
可用选项:
¥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
-
--config-path
=PATH
— 允许设置配置文件的自定义文件路径,或设置查找biome.json
或biome.jsonc
的自定义目录路径¥
--config-path
=PATH
— Allows to set a custom file path to the configuration file, or a custom directory path to findbiome.json
orbiome.jsonc
使用环境变量
BIOME_CONFIG_PATH
¥Uses environment variable
BIOME_CONFIG_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
] [--assists-enabled
=<true|false>
] [--staged
] [--changed
] [--since
=REF
] [PATH
]…
¥Usage: biome
check
[--write
] [--unsafe
] [--assists-enabled
=<true|false>
] [--staged
] [--changed
] [--since
=REF
] [PATH
]…
文件 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.json
was 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 doesn’t know -
--use-editorconfig
=<true|false>
— 使用任何.editorconfig
文件来配置格式化程序。biome.json
中的配置将覆盖.editorconfig
配置。默认:false。¥
--use-editorconfig
=<true|false>
— Use any.editorconfig
files to configure the formatter. Configuration inbiome.json
will override.editorconfig
configuration. Default: false. -
--indent-style
=<tab|space>
— 缩进样式。¥
--indent-style
=<tab|space>
— The indent style. -
--indent-size
=NUMBER
— 缩进大小,默认为 2(已弃用,使用indent-width
)¥
--indent-size
=NUMBER
— The size of the indentation, 2 by default (deprecated, useindent-width
) -
--indent-width
=NUMBER
— 缩进大小,默认为 2¥
--indent-width
=NUMBER
— The size of the indentation, 2 by default -
--line-ending
=<lf|crlf|cr>
— 行尾类型。¥
--line-ending
=<lf|crlf|cr>
— 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>
— HTMLish 语言中的属性位置样式。默认自动。¥
--attribute-position
=<multiline|auto>
— The attribute position style in HTMLish languages. By default auto. -
--bracket-spacing
=<true|false>
— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--bracket-spacing
=<true|false>
— Whether to insert spaces around brackets in object literals. Defaults to true. -
--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-comma
=<all|es5|none>
— 在多行逗号分隔的语法结构中尽可能打印尾随逗号。默认为 “all”。¥
--trailing-comma
=<all|es5|none>
— Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to “all”. -
--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-enabled
=<true|false>
— 控制 JavaScript(及其超级语言)文件的格式化程序。¥
--javascript-formatter-enabled
=<true|false>
— Control the formatter for JavaScript (and its super languages) files. -
--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-size
=NUMBER
— 应用于 JavaScript(及其超级语言)文件的缩进大小。默认为 2。¥
--javascript-formatter-indent-size
=NUMBER
— The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. -
--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>
— 应用于 JavaScript(及其超级语言)文件的行尾类型。¥
--javascript-formatter-line-ending
=<lf|crlf|cr>
— The type of line ending applied to JavaScript (and its super languages) files. -
--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. -
--quote-style
=<double|single>
— JavaScript 代码中使用的引号类型。默认为 double。¥
--quote-style
=<double|single>
— The type of quotes used in JavaScript code. Defaults to double. -
--javascript-attribute-position
=<multiline|auto>
— jsx 元素中的属性位置样式。默认为 auto。¥
--javascript-attribute-position
=<multiline|auto>
— The attribute position style in jsx elements. Defaults to auto. -
--javascript-linter-enabled
=<true|false>
— 控制 JavaScript(及其超级语言)文件的 linter。¥
--javascript-linter-enabled
=<true|false>
— Control the linter for JavaScript (and its super languages) files. -
--javascript-assists-enabled
=<true|false>
— 控制 JavaScript(及其超级语言)文件的 linter。¥
--javascript-assists-enabled
=<true|false>
— Control the linter for JavaScript (and its super languages) files. -
--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-indent-size
=NUMBER
— 应用于 JSON(及其超级语言)文件的缩进大小。默认为 2。¥
--json-formatter-indent-size
=NUMBER
— The size of the indentation applied to JSON (and its super languages) files. Default to 2. -
--json-formatter-line-ending
=<lf|crlf|cr>
— 应用于 JSON(及其超级语言)文件的行尾类型。¥
--json-formatter-line-ending
=<lf|crlf|cr>
— The type of line ending applied to JSON (and its super languages) files. -
--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-linter-enabled
=<true|false>
— 控制 JSON(及其超级语言)文件的 linter。¥
--json-linter-enabled
=<true|false>
— Control the linter for JSON (and its super languages) files. -
--json-assists-enabled
=<true|false>
— 控制 JSON(及其超级语言)文件的 linter。¥
--json-assists-enabled
=<true|false>
— Control the linter for JSON (and its super languages) files. -
--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>
— 应用于 CSS(及其超级语言)文件的行尾类型。¥
--css-formatter-line-ending
=<lf|crlf|cr>
— The type of line ending applied to CSS (and its super languages) files. -
--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-assists-enabled
=<true|false>
— 控制 CSS 文件的辅助。¥
--css-assists-enabled
=<true|false>
— Control the assists 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>
— 应用于 GraphQL 文件的行尾类型。¥
--graphql-formatter-line-ending
=<lf|crlf|cr>
— The type of line ending applied to GraphQL files. -
--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. -
--assists-enabled
=<true|false>
— Biome 是否应通过 LSP 启用辅助。¥
--assists-enabled
=<true|false>
— Whether Biome should enable assists via LSP.
应用于所有命令的全局选项
¥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.json
orbiome.jsonc
. If used, it disables the default configuration file resolution. -
--max-diagnostics
=<none|<NUMBER>>
— 限制显示的诊断数量。当提供none
时,限制被解除。¥
--max-diagnostics
=<none|<NUMBER>>
— Cap the amount of diagnostics displayed. Whennone
is provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-errors
— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-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>
— 允许更改诊断和摘要的报告方式。¥
--reporter
=<json|json-pretty|github|junit|summary|gitlab>
— Allows to change how diagnostics and summary are reported. -
--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
none
won’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=error
will 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, formatting and import sorting -
--unsafe
— 允许进行不安全的修复,应与--write
或--fix
一起使用¥
--unsafe
— Allow to do unsafe fixes, should be used with--write
or--fix
-
--fix
—--write
的别名,编写安全修复程序、格式化和导入排序¥
--fix
— Alias for--write
, writes safe fixes, formatting and import sorting -
--apply
—--write
的别名,编写安全修复程序、格式化和导入排序(已弃用,使用--write
)¥
--apply
— Alias for--write
, writes safe fixes, formatting and import sorting (deprecated, use--write
) -
--apply-unsafe
—--write --unsafe
的别名,编写安全和不安全的修复程序、格式化和导入排序(已弃用,使用--write --unsafe
)¥
--apply-unsafe
— Alias for--write --unsafe
, writes safe and unsafe fixes, formatting and import sorting (deprecated, use--write --unsafe
) -
--formatter-enabled
=<true|false>
— 允许启用或禁用格式化程序检查。¥
--formatter-enabled
=<true|false>
— Allow to enable or disable the formatter check. -
--linter-enabled
=<true|false>
— 允许启用或禁用 linter 检查。¥
--linter-enabled
=<true|false>
— Allow to enable or disable the linter check. -
--organize-imports-enabled
=<true|false>
— 允许启用或禁用组织导入。¥
--organize-imports-enabled
=<true|false>
— Allow to enable or disable the organize imports. -
--assists-enabled
=<true|false>
— 允许启用或禁用辅助。¥
--assists-enabled
=<true|false>
— Allow to enable or disable the assists. -
--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.
示例:
echo 'let a;' | biome check --stdin-file-path=file.js
¥Example:
echo 'let a;' | biome check --stdin-file-path=file.js
-
--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 yourdefaultBranch
configuration 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 thedefaultBranch
is 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
] [--only
=<GROUP|RULE>
]…[--skip
=<GROUP|RULE>
]…[--staged
] [--changed
] [--since
=REF
] [PATH
]…
¥Usage: biome
lint
[--write
] [--unsafe
] [--only
=<GROUP|RULE>
]… [--skip
=<GROUP|RULE>
]… [--staged
] [--changed
] [--since
=REF
] [PATH
]…
将 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.json
was 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 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.json
orbiome.jsonc
. If used, it disables the default configuration file resolution. -
--max-diagnostics
=<none|<NUMBER>>
— 限制显示的诊断数量。当提供none
时,限制被解除。¥
--max-diagnostics
=<none|<NUMBER>>
— Cap the amount of diagnostics displayed. Whennone
is provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-errors
— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-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>
— 允许更改诊断和摘要的报告方式。¥
--reporter
=<json|json-pretty|github|junit|summary|gitlab>
— Allows to change how diagnostics and summary are reported. -
--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
none
won’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=error
will 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
— Allow to do unsafe fixes, should be used with--write
or--fix
-
--fix
—--write
的别名,编写安全修复程序¥
--fix
— Alias for--write
, writes safe fixes -
--apply
—--write
的别名,编写安全修复程序(已弃用,使用--write
)¥
--apply
— Alias for--write
, writes safe fixes (deprecated, use--write
) -
--apply-unsafe
—--write --unsafe
的别名,编写安全和不安全的修复程序(已弃用,使用--write --unsafe
)¥
--apply-unsafe
— Alias for--write --unsafe
, writes safe and unsafe fixes (deprecated, use--write --unsafe
) -
--only
=<GROUP|RULE>
— 仅运行给定的规则或规则组。如果规则的严重性级别为off
,则规则的严重性级别设置为推荐规则的error
,否则设置为warn
。¥
--only
=<GROUP|RULE>
— Run only the given rule or group of rules. If the severity level of a rule isoff
, then the severity level of the rule is set toerror
if it is a recommended rule orwarn
otherwise.示例:
biome lint --only=correctness/noUnusedVariables --only=suspicious
¥Example:
biome lint --only=correctness/noUnusedVariables --only=suspicious
-
--skip
=<GROUP|RULE>
— 通过将规则的严重性级别设置为off
来跳过给定的规则或规则组。此选项优先于--only
。¥
--skip
=<GROUP|RULE>
— Skip the given rule or group of rules by setting the severity level of the rules tooff
. This option takes precedence over--only
.示例:
biome lint --skip=correctness/noUnusedVariables --skip=suspicious
¥Example:
biome lint --skip=correctness/noUnusedVariables --skip=suspicious
-
--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.
示例:
echo 'let a;' | biome lint --stdin-file-path=file.js
¥Example:
echo 'let a;' | biome lint --stdin-file-path=file.js
-
--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 yourdefaultBranch
configuration 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 thedefaultBranch
is 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
-
--use-editorconfig
=<true|false>
— 使用任何.editorconfig
文件来配置格式化程序。biome.json
中的配置将覆盖.editorconfig
配置。默认:false。¥
--use-editorconfig
=<true|false>
— Use any.editorconfig
files to configure the formatter. Configuration inbiome.json
will override.editorconfig
configuration. Default: false. -
--indent-style
=<tab|space>
— 缩进样式。¥
--indent-style
=<tab|space>
— The indent style. -
--indent-size
=NUMBER
— 缩进大小,默认为 2(已弃用,使用indent-width
)¥
--indent-size
=NUMBER
— The size of the indentation, 2 by default (deprecated, useindent-width
) -
--indent-width
=NUMBER
— 缩进大小,默认为 2¥
--indent-width
=NUMBER
— The size of the indentation, 2 by default -
--line-ending
=<lf|crlf|cr>
— 行尾类型。¥
--line-ending
=<lf|crlf|cr>
— 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>
— HTMLish 语言中的属性位置样式。默认自动。¥
--attribute-position
=<multiline|auto>
— The attribute position style in HTMLish languages. By default auto. -
--bracket-spacing
=<true|false>
— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--bracket-spacing
=<true|false>
— Whether to insert spaces around brackets in object literals. Defaults to true.
特定于 JavaScript 文件的格式化选项
¥Formatting options specific to the JavaScript 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-comma
=<all|es5|none>
— 在多行逗号分隔的语法结构中尽可能打印尾随逗号。默认为 “all”。¥
--trailing-comma
=<all|es5|none>
— Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to “all”. -
--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-enabled
=<true|false>
— 控制 JavaScript(及其超级语言)文件的格式化程序。¥
--javascript-formatter-enabled
=<true|false>
— Control the formatter for JavaScript (and its super languages) files. -
--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-size
=NUMBER
— 应用于 JavaScript(及其超级语言)文件的缩进大小。默认为 2。¥
--javascript-formatter-indent-size
=NUMBER
— The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. -
--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>
— 应用于 JavaScript(及其超级语言)文件的行尾类型。¥
--javascript-formatter-line-ending
=<lf|crlf|cr>
— The type of line ending applied to JavaScript (and its super languages) files. -
--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. -
--quote-style
=<double|single>
— JavaScript 代码中使用的引号类型。默认为 double。¥
--quote-style
=<double|single>
— The type of quotes used in JavaScript code. Defaults to double. -
--javascript-attribute-position
=<multiline|auto>
— jsx 元素中的属性位置样式。默认为 auto。¥
--javascript-attribute-position
=<multiline|auto>
— The attribute position style in jsx elements. Defaults to auto. -
--bracket-spacing
=<true|false>
— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--bracket-spacing
=<true|false>
— Whether to insert spaces around brackets in object literals. Defaults to true.
将 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.json
was 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 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.json
orbiome.jsonc
. If used, it disables the default configuration file resolution. -
--max-diagnostics
=<none|<NUMBER>>
— 限制显示的诊断数量。当提供none
时,限制被解除。¥
--max-diagnostics
=<none|<NUMBER>>
— Cap the amount of diagnostics displayed. Whennone
is provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-errors
— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-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>
— 允许更改诊断和摘要的报告方式。¥
--reporter
=<json|json-pretty|github|junit|summary|gitlab>
— Allows to change how diagnostics and summary are reported. -
--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
none
won’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=error
will 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-indent-size
=NUMBER
— 应用于 JSON(及其超级语言)文件的缩进大小。默认为 2。¥
--json-formatter-indent-size
=NUMBER
— The size of the indentation applied to JSON (and its super languages) files. Default to 2. -
--json-formatter-line-ending
=<lf|crlf|cr>
— 应用于 JSON(及其超级语言)文件的行尾类型。¥
--json-formatter-line-ending
=<lf|crlf|cr>
— The type of line ending applied to JSON (and its super languages) files. -
--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”. -
--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.
示例:
echo 'let a;' | biome format --stdin-file-path=file.js
¥Example:
echo 'let a;' | biome format --stdin-file-path=file.js
-
--write
— 将格式化的文件写入文件系统。¥
--write
— Writes formatted files to file system. -
--fix
—--write
的别名,将格式化的文件写入文件系统。¥
--fix
— Alias of--write
, writes formatted files to 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 yourdefaultBranch
configuration 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 thedefaultBranch
is 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>
] [--organize-imports-enabled
=<true|false>
] [--assists-enabled
=<true|false>
] [--changed
] [--since
=REF
] [PATH
]…
¥Usage: biome
ci
[--formatter-enabled
=<true|false>
] [--linter-enabled
=<true|false>
] [--organize-imports-enabled
=<true|false>
] [--assists-enabled
=<true|false>
] [--changed
] [--since
=REF
] [PATH
]…
文件 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.json
was 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 doesn’t know -
--use-editorconfig
=<true|false>
— 使用任何.editorconfig
文件来配置格式化程序。biome.json
中的配置将覆盖.editorconfig
配置。默认:false。¥
--use-editorconfig
=<true|false>
— Use any.editorconfig
files to configure the formatter. Configuration inbiome.json
will override.editorconfig
configuration. Default: false. -
--indent-style
=<tab|space>
— 缩进样式。¥
--indent-style
=<tab|space>
— The indent style. -
--indent-size
=NUMBER
— 缩进大小,默认为 2(已弃用,使用indent-width
)¥
--indent-size
=NUMBER
— The size of the indentation, 2 by default (deprecated, useindent-width
) -
--indent-width
=NUMBER
— 缩进大小,默认为 2¥
--indent-width
=NUMBER
— The size of the indentation, 2 by default -
--line-ending
=<lf|crlf|cr>
— 行尾类型。¥
--line-ending
=<lf|crlf|cr>
— 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>
— HTMLish 语言中的属性位置样式。默认自动。¥
--attribute-position
=<multiline|auto>
— The attribute position style in HTMLish languages. By default auto. -
--bracket-spacing
=<true|false>
— 是否在对象文字中的括号周围插入空格。默认为 true。¥
--bracket-spacing
=<true|false>
— Whether to insert spaces around brackets in object literals. Defaults to true. -
--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-comma
=<all|es5|none>
— 在多行逗号分隔的语法结构中尽可能打印尾随逗号。默认为 “all”。¥
--trailing-comma
=<all|es5|none>
— Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to “all”. -
--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-enabled
=<true|false>
— 控制 JavaScript(及其超级语言)文件的格式化程序。¥
--javascript-formatter-enabled
=<true|false>
— Control the formatter for JavaScript (and its super languages) files. -
--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-size
=NUMBER
— 应用于 JavaScript(及其超级语言)文件的缩进大小。默认为 2。¥
--javascript-formatter-indent-size
=NUMBER
— The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. -
--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>
— 应用于 JavaScript(及其超级语言)文件的行尾类型。¥
--javascript-formatter-line-ending
=<lf|crlf|cr>
— The type of line ending applied to JavaScript (and its super languages) files. -
--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. -
--quote-style
=<double|single>
— JavaScript 代码中使用的引号类型。默认为 double。¥
--quote-style
=<double|single>
— The type of quotes used in JavaScript code. Defaults to double. -
--javascript-attribute-position
=<multiline|auto>
— jsx 元素中的属性位置样式。默认为 auto。¥
--javascript-attribute-position
=<multiline|auto>
— The attribute position style in jsx elements. Defaults to auto. -
--javascript-linter-enabled
=<true|false>
— 控制 JavaScript(及其超级语言)文件的 linter。¥
--javascript-linter-enabled
=<true|false>
— Control the linter for JavaScript (and its super languages) files. -
--javascript-assists-enabled
=<true|false>
— 控制 JavaScript(及其超级语言)文件的 linter。¥
--javascript-assists-enabled
=<true|false>
— Control the linter for JavaScript (and its super languages) files. -
--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-indent-size
=NUMBER
— 应用于 JSON(及其超级语言)文件的缩进大小。默认为 2。¥
--json-formatter-indent-size
=NUMBER
— The size of the indentation applied to JSON (and its super languages) files. Default to 2. -
--json-formatter-line-ending
=<lf|crlf|cr>
— 应用于 JSON(及其超级语言)文件的行尾类型。¥
--json-formatter-line-ending
=<lf|crlf|cr>
— The type of line ending applied to JSON (and its super languages) files. -
--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-linter-enabled
=<true|false>
— 控制 JSON(及其超级语言)文件的 linter。¥
--json-linter-enabled
=<true|false>
— Control the linter for JSON (and its super languages) files. -
--json-assists-enabled
=<true|false>
— 控制 JSON(及其超级语言)文件的 linter。¥
--json-assists-enabled
=<true|false>
— Control the linter for JSON (and its super languages) files. -
--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>
— 应用于 CSS(及其超级语言)文件的行尾类型。¥
--css-formatter-line-ending
=<lf|crlf|cr>
— The type of line ending applied to CSS (and its super languages) files. -
--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-assists-enabled
=<true|false>
— 控制 CSS 文件的辅助。¥
--css-assists-enabled
=<true|false>
— Control the assists 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>
— 应用于 GraphQL 文件的行尾类型。¥
--graphql-formatter-line-ending
=<lf|crlf|cr>
— The type of line ending applied to GraphQL files. -
--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. -
--assists-enabled
=<true|false>
— Biome 是否应通过 LSP 启用辅助。¥
--assists-enabled
=<true|false>
— Whether Biome should enable assists via LSP.
应用于所有命令的全局选项
¥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.json
orbiome.jsonc
. If used, it disables the default configuration file resolution. -
--max-diagnostics
=<none|<NUMBER>>
— 限制显示的诊断数量。当提供none
时,限制被解除。¥
--max-diagnostics
=<none|<NUMBER>>
— Cap the amount of diagnostics displayed. Whennone
is provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-errors
— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-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>
— 允许更改诊断和摘要的报告方式。¥
--reporter
=<json|json-pretty|github|junit|summary|gitlab>
— Allows to change how diagnostics and summary are reported. -
--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
none
won’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=error
will 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 to enable or disable the formatter check. -
--linter-enabled
=<true|false>
— 允许启用或禁用 linter 检查。¥
--linter-enabled
=<true|false>
— Allow to enable or disable the linter check. -
--organize-imports-enabled
=<true|false>
— 允许启用或禁用组织导入。¥
--organize-imports-enabled
=<true|false>
— Allow to enable or disable the organize imports. -
--assists-enabled
=<true|false>
— 允许启用或禁用辅助。¥
--assists-enabled
=<true|false>
— Allow to enable or disable the assists. -
--changed
— 设置为 true 时,只有与defaultBranch
配置相比已更改的文件才会被 linted。¥
--changed
— When set to true, only the files that have been changed compared to yourdefaultBranch
configuration 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 thedefaultBranch
is not set in your biome.json -
-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.jsonc
file. -
-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
[--config-path
=PATH
]
¥Usage: biome
lsp-proxy
[--config-path
=PATH
]
可用选项:
¥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
-
--config-path
=PATH
— 允许设置配置文件的自定义文件路径,或设置查找biome.json
或biome.jsonc
的自定义目录路径¥
--config-path
=PATH
— Allows to set a custom file path to the configuration file, or a custom directory path to findbiome.json
orbiome.jsonc
使用环境变量
BIOME_CONFIG_PATH
¥Uses environment variable
BIOME_CONFIG_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.json
orbiome.jsonc
. If used, it disables the default configuration file resolution. -
--max-diagnostics
=<none|<NUMBER>>
— 限制显示的诊断数量。当提供none
时,限制被解除。¥
--max-diagnostics
=<none|<NUMBER>>
— Cap the amount of diagnostics displayed. Whennone
is provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-errors
— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-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>
— 允许更改诊断和摘要的报告方式。¥
--reporter
=<json|json-pretty|github|junit|summary|gitlab>
— Allows to change how diagnostics and summary are reported. -
--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
none
won’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=error
will 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.json
and.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 searchEXPERIMENTAL:在项目中搜索 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
PATTERN
[PATH
]…
¥Usage: biome
search
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.json
orbiome.jsonc
. If used, it disables the default configuration file resolution. -
--max-diagnostics
=<none|<NUMBER>>
— 限制显示的诊断数量。当提供none
时,限制被解除。¥
--max-diagnostics
=<none|<NUMBER>>
— Cap the amount of diagnostics displayed. Whennone
is provided, the limit is lifted.[默认:20]
¥[default: 20]
-
--skip-errors
— 跳过包含语法错误的文件,而不是发出错误诊断。¥
--skip-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>
— 允许更改诊断和摘要的报告方式。¥
--reporter
=<json|json-pretty|github|junit|summary|gitlab>
— Allows to change how diagnostics and summary are reported. -
--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
none
won’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=error
will 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 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.json
was 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.
示例:
echo 'let a;' | biome search '
let $var' --stdin-file-path=file.js
¥Example:
echo 'let a;' | biome search '
let $var' --stdin-file-path=file.js
-
-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
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
有用的信息
Section titled 有用的信息¥Useful information
-
遇到符号链接时,CLI 会将其扩展至三级深度。更深的级别将导致错误诊断。
¥When encountering symbolic links, the CLI will expand them until three levels deep. Deeper levels will result into an error diagnostic.