配置
$schema
Section titled $schema允许将路径传递给 JSON 模式文件。
¥Allows to pass a path to a JSON schema file.
我们发布了 biome.json
的 JSON 模式文件。
¥We publish a JSON schema file for the biome.json
.
如果 @biomejs/biome
安装在 node_modules
文件夹中,你可以指定 @biomejs/biome
npm 包架构的相对路径:
¥You can specify a relative path to the schema of the @biomejs/biome
npm package if @biomejs/biome
is installed in the node_modules
folder:
如果你在解析物理文件时遇到问题,可以使用此站点中发布的文件:
¥If you have problems with resolving the physical file, you can use the one published in this site:
extends
Section titled extends其他 JSON 文件的路径列表。Biome 解析并应用 extends
列表中包含的文件的选项,并最终应用 biome.json
文件中包含的选项。
¥A list of paths to other JSON files. Biome resolves and applies the options of the files contained in the extends
list, and eventually applies the options contained in the biome.json
file.
files
Section titled filesfiles.maxSize
Section titled files.maxSize源代码文件的最大允许大小(以字节为单位)。出于性能原因,超过此限制的文件将被忽略。
¥The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons.
默认:
1048576
(1024*1024, 1MB)¥Default:
1048576
(1024*1024, 1MB)
files.ignore
Section titled files.ignoreUnix shell 样式模式列表。Biome 忽略与这些模式匹配的文件和文件夹。
¥A list of Unix shell style patterns. Biome ignores files and folders that match these patterns.
files.include
Section titled files.includeUnix shell 样式模式列表。Biome 仅处理与这些模式匹配的文件和文件夹。
¥A list of Unix shell style patterns. Biome handles only the files and folders that match these patterns.
给出以下示例:
¥Given the following example:
仅处理与模式 src/**/*.js
匹配的文件,而忽略与模式 scripts/**/*.js
匹配的文件。
¥Only the files that match the pattern src/**/*.js
will be handled, while the files that match the pattern
scripts/**/*.js
will be ignored.
files.ignoreUnknown
Section titled files.ignoreUnknown如果遇到无法处理的文件,Biome 将不会发出诊断信息。
¥Biome won’t emit diagnostics if it encounters files that can’t handle.
默认:
false
¥Default:
false
将 Biome 与 VCS 软件集成的属性集。
¥Set of properties to integrate Biome with a VCS software.
vcs.enabled
Section titled vcs.enabledBiome 是否应该将自身与 VCS 客户端集成
¥Whether Biome should integrate itself with the VCS client
默认:
false
¥Default:
false
vcs.clientKind
Section titled vcs.clientKind客户端类型。
¥The kind of client.
值:
¥Values:
"git"
vcs.useIgnoreFile
Section titled vcs.useIgnoreFileBiome 是否应该使用 VCS 忽略文件。当 true
时,Biome 将忽略忽略文件中指定的文件。
¥Whether Biome should use the VCS ignore file. When true
, Biome will ignore the files
specified in the ignore file.
vcs.root
Section titled vcs.rootBiome 应检查 VCS 文件的文件夹。默认情况下,Biome 将使用找到 biome.json
的同一文件夹。
¥The folder where Biome should check for VCS files. By default, Biome will use the same
folder where biome.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.defaultBranch
Section titled vcs.defaultBranch项目的主分支。Biome 将在评估更改的文件时使用此分支。
¥The main branch of the project. Biome will use this branch when evaluating the changed files.
linter
Section titled linterlinter.enabled
Section titled linter.enabled启用 Biome 的 linter
¥Enables Biome’s linter
默认:
true
¥Default:
true
linter.ignore
Section titled linter.ignoreUnix shell 样式模式数组。
¥An array of Unix shell style patterns.
linter.include
Section titled linter.includeUnix shell 样式模式列表。Biome 仅处理与这些模式匹配的文件和文件夹。
¥A list of Unix shell style patterns. Biome handles only the files and folders that match these patterns.
给出以下示例:
¥Given the following example:
仅对与模式 src/**/*.js
匹配的文件进行 linted,而忽略与模式 scripts/**/*.js
匹配的文件。
¥Only the files that match the patter src/**/*.js
will be linted, while the files that match the pattern
scripts/**/*.js
will be ignored.
linter.rules.recommended
Section titled linter.rules.recommended为所有组启用 推荐规则。
¥Enables the recommended rules for all groups.
默认:
true
¥Default:
true
linter.rules.all
Section titled linter.rules.all为所有组启用或禁用所有 rules。
¥Enable or disable all rules for all groups.
如果 recommended
和 all
都是 true
,Biome 将发出诊断并恢复到其默认值。
¥If recommended
and all
are both true
, Biome will emit a diagnostic and fallback to its defaults.
也可以组合此标志来启用/禁用不同的规则组:
¥It’s also possible to combine this flag to enable/disable different rule groups:
在前面的例子中,Biome 将启用所有规则,但属于 style
和 complexity
组的规则除外。
¥In the previous example, Biome will enable all rules, exception for rules that belong to the style
and complexity
groups.
linter.rules.[group]
Section titled linter.rules.[group]影响单个组规则的选项。Biome 支持以下组:
¥Options that influence the rules of a single group. Biome supports the following groups:
accessibility
: Rules focused on preventing accessibility problems.complexity
: Rules that focus on inspecting complex code that could be simplified.correctness
: Rules that detect code that is guaranteed to be incorrect or useless.nursery
: New rules that are still under development. Nursery rules require explicit opt-in via configuration on stable versions because they may still have bugs or performance problems. They are enabled by default on nightly builds, but as they are unstable their diagnostic severity may be set to either error or warning, depending on whether we intend for the rule to be recommended or not when it eventually gets stabilized. Nursery rules get promoted to other groups once they become stable or may be removed. Rules that belong to this group are not subject to semantic version.performance
: Rules catching ways your code could be written to run faster, or generally be more efficient.security
: Rules that detect potential security flaws.style
: Rules enforcing a consistent and idiomatic way of writing your code.suspicious
: Rules that detect code that is likely to be incorrect or useless.linter.rules.[group].recommended
Section titled linter.rules.[group].recommended为单个组启用推荐规则。
¥Enables the recommended rules for a single group.
示例:
¥Example:
linter.rules.[group].all
Section titled linter.rules.[group].all为单个组启用所有规则。
¥Enables all rules for a single group.
示例:
¥Example:
formatter
Section titled formatter这些选项适用于所有语言。下面还有其他特定于语言的格式选项。
¥These options apply to all languages. There are additional language-specific formatting options below.
formatter.enabled
Section titled formatter.enabled启用 Biome 的格式化程序
¥Enables Biome’s formatter
默认:
true
¥Default:
true
formatter.ignore
Section titled formatter.ignoreUnix shell 样式模式数组。
¥An array of Unix shell style patterns.
formatter.include
Section titled formatter.includeUnix shell 样式模式列表。Biome 仅处理与这些模式匹配的文件和文件夹。
¥A list of Unix shell style patterns. Biome handles only the files and folders that match these patterns.
给出以下示例:
¥Given the following example:
仅格式化与模式 src/**/*.js
匹配的文件,而忽略与模式 scripts/**/*.js
匹配的文件。
¥Only the files that match the patter src/**/*.js
will be formatted, while the files that match the pattern
scripts/**/*.js
will be ignored.
formatter.formatWithErrors
Section titled formatter.formatWithErrors允许格式化有语法错误的文档。
¥Allows to format a document that has syntax errors.
默认:
false
¥Default:
false
formatter.indentStyle
Section titled formatter.indentStyle缩进样式。它可以是 "tab"
或 "space"
。
¥The style of the indentation. It can be "tab"
or "space"
.
默认:
"tab"
¥Default:
"tab"
formatter.indentSize
Section titled formatter.indentSize此选项已弃用,请改用 formatter.indentWidth
。
¥This option is deprecated, please use formatter.indentWidth
instead.
Deprecated
缩进应该有多大。
¥How big the indentation should be.
默认:
2
¥Default:
2
formatter.indentWidth
Section titled formatter.indentWidth缩进应该有多大。
¥How big the indentation should be.
默认:
2
¥Default:
2
formatter.lineEnding
Section titled formatter.lineEnding行尾类型。
¥The type of line ending.
-
"lf"
,仅换行符(\n
),在 Linux 和 macOS 以及 git repos 内部很常见;¥
"lf"
, Line Feed only (\n
), common on Linux and macOS as well as inside git repos; -
"crlf"
,回车符 + 换行符(\r\n
),在 Windows 上很常见;¥
"crlf"
, Carriage Return + Line Feed characters (\r\n
), common on Windows; -
"cr"
,仅回车符(\r
),很少使用。¥
"cr"
, Carriage Return character only (\r
), used very rarely.
默认:
"lf"
¥Default:
"lf"
formatter.lineWidth
Section titled formatter.lineWidth一行可以写多少个字符。
¥How many characters can be written on a single line.
默认:
80
¥Default:
80
formatter.attributePosition
Section titled formatter.attributePositionHTMLish 语言中的属性位置样式。
¥The attribute position style in HTMLish languages.
-
"auto"
,属性会自动格式化,只有当它们符合某些条件时,它们才会折叠在多行中;¥
"auto"
, the attributes are automatically formatted, and they will collapse in multiple lines only when they hit certain criteria; -
"multiline"
,无论如何,属性总是格式化为多行。¥
"multiline"
, the attributes are always formatted on multiple lines, regardless.
默认:
"auto"
¥Default:
"auto"
organizeImports
Section titled organizeImportsorganizeImports.enabled
Section titled organizeImports.enabled启用 Biome 的排序导入。
¥Enables Biome’s sort imports.
默认:
true
¥Default:
true
organizeImports.ignore
Section titled organizeImports.ignoreUnix shell 样式模式列表。Biome 忽略与这些模式匹配的文件和文件夹。
¥A list of Unix shell style patterns. Biome ignores files and folders that match these patterns.
organizeImports.include
Section titled organizeImports.includeUnix shell 样式模式列表。Biome 仅处理与这些模式匹配的文件和文件夹。
¥A list of Unix shell style patterns. Biome handles only the files and folders that match these patterns.
给出以下示例:
¥Given the following example:
仅对与模式 src/**/*.js
匹配的文件进行导入排序,而忽略与模式 scripts/**/*.js
匹配的文件。
¥Only the files that match the patter src/**/*.js
will have their imports sorted, while the files that match the pattern
scripts/**/*.js
will be ignored.
javascript
Section titled javascript这些选项仅适用于 JavaScript(和 TypeScript)文件。
¥These options apply only to JavaScript (and TypeScript) files.
javascript.parser.unsafeParameterDecoratorsEnabled
Section titled javascript.parser.unsafeParameterDecoratorsEnabled允许支持不安全/实验性参数装饰器。
¥Allows to support the unsafe/experimental parameter decorators.
默认:
false
¥Default:
false
javascript.formatter.quoteStyle
Section titled javascript.formatter.quoteStyle表示字符串文字时使用的引号类型。它可以是 "single"
或 "double"
。
¥The type of quote used when representing string literals. It can be "single"
or "double"
.
默认:
"double"
¥Default:
"double"
javascript.formatter.jsxQuoteStyle
Section titled javascript.formatter.jsxQuoteStyle表示 jsx 字符串文字时使用的引号类型。它可以是 "single"
或 "double"
。
¥The type of quote used when representing jsx string literals. It can be "single"
or "double"
.
默认:
"double"
¥Default:
"double"
javascript.formatter.quoteProperties
Section titled javascript.formatter.quoteProperties对象内的属性应何时用引号引起来。它可以是 "asNeeded"
或 "preserve"
。
¥When properties inside objects should be quoted. It can be "asNeeded"
or "preserve"
.
默认:
"asNeeded"
¥Default:
"asNeeded"
javascript.formatter.trailingComma
Section titled javascript.formatter.trailingComma此选项已弃用,请改用 javascript.formatter.trailingCommas
。
¥This option is deprecated, please use javascript.formatter.trailingCommas
instead.
Deprecated
在多行逗号分隔的语法结构中尽可能打印尾随逗号。可能的值:
¥Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Possible values:
-
"all"
,始终添加尾随逗号;¥
"all"
, the trailing comma is always added; -
"es5"
,仅在旧版本 JavaScript 支持的地方添加尾随逗号;¥
"es5"
, the trailing comma is added only in places where it’s supported by older version of JavaScript; -
"none"
,从不添加尾随逗号。¥
"none"
, trailing commas are never added.
默认:
"all"
¥Default:
"all"
javascript.formatter.trailingCommas
Section titled javascript.formatter.trailingCommas在多行逗号分隔的语法结构中尽可能打印尾随逗号。可能的值:
¥Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Possible values:
-
"all"
,始终添加尾随逗号;¥
"all"
, the trailing comma is always added; -
"es5"
,仅在旧版本 JavaScript 支持的地方添加尾随逗号;¥
"es5"
, the trailing comma is added only in places where it’s supported by older version of JavaScript; -
"none"
,从不添加尾随逗号。¥
"none"
, trailing commas are never added.
默认:
"all"
¥Default:
"all"
javascript.formatter.semicolons
Section titled javascript.formatter.semicolons它配置格式化程序打印分号的位置:
¥It configures where the formatter prints semicolons:
-
"always"
,分号始终添加在每个语句的末尾;¥
"always"
, the semicolons is always added at the end of each statement; -
"asNeeded"
,仅在需要的地方添加分号,以防止 ASI。¥
"asNeeded"
, the semicolons are added only in places where it’s needed, to protect from ASI.
默认:
"always"
¥Default:
"always"
示例:
¥Example:
javascript.formatter.arrowParentheses
Section titled javascript.formatter.arrowParentheses是否向箭头函数添加不必要的括号:
¥Whether to add non-necessary parentheses to arrow functions:
-
"always"
,始终添加括号;¥
"always"
, the parentheses are always added; -
"asNeeded"
,只有在需要时才添加括号。¥
"asNeeded"
, the parentheses are added only when they are needed.
默认:
"always"
¥Default:
"always"
javascript.formatter.enabled
Section titled javascript.formatter.enabled为 JavaScript(及其超级语言)文件启用 Biome 的格式化程序。
¥Enables Biome’s formatter for JavaScript (and its super languages) files.
默认:
true
¥Default:
true
javascript.formatter.indentStyle
Section titled javascript.formatter.indentStyleJavaScript(及其超级语言)文件的缩进样式。它可以是 "tab"
或 "space"
。
¥The style of the indentation for JavaScript (and its super languages) files. It can be "tab"
or "space"
.
默认:
"tab"
¥Default:
"tab"
javascript.formatter.indentSize
Section titled javascript.formatter.indentSize此选项已弃用,请改用 javascript.formatter.indentWidth
。
¥This option is deprecated, please use javascript.formatter.indentWidth
instead.
Deprecated
JavaScript(及其超级语言)文件的缩进应该有多大。
¥How big the indentation should be for JavaScript (and its super languages) files.
默认:
2
¥Default:
2
javascript.formatter.indentWidth
Section titled javascript.formatter.indentWidthJavaScript(及其超级语言)文件的缩进应该有多大。
¥How big the indentation should be for JavaScript (and its super languages) files.
默认:
2
¥Default:
2
javascript.formatter.lineEnding
Section titled javascript.formatter.lineEndingJavaScript(及其超级语言)文件的行尾类型。
¥The type of line ending for JavaScript (and its super languages) files.
-
"lf"
,仅换行符(\n
),在 Linux 和 macOS 以及 git repos 内部很常见;¥
"lf"
, Line Feed only (\n
), common on Linux and macOS as well as inside git repos; -
"crlf"
,回车符 + 换行符(\r\n
),在 Windows 上很常见;¥
"crlf"
, Carriage Return + Line Feed characters (\r\n
), common on Windows; -
"cr"
,仅回车符(\r
),很少使用。¥
"cr"
, Carriage Return character only (\r
), used very rarely.
默认:
"lf"
¥Default:
"lf"
javascript.formatter.lineWidth
Section titled javascript.formatter.lineWidthJavaScript(及其超级语言)文件中的一行可以写多少个字符。
¥How many characters can be written on a single line in JavaScript (and its super languages) files.
默认:
80
¥Default:
80
javascript.formatter.bracketSameLine
Section titled javascript.formatter.bracketSameLine选择是否应在括号和内部值之间添加空格
¥Choose whether the ending >
of a multi-line JSX element should be on the last attribute line or not
默认:
false
¥Default:
false
javascript.formatter.bracketSpacing
Section titled javascript.formatter.bracketSpacing检查断言函数(例如 )是否放置在 函数调用中。
¥Choose whether spaces should be added between brackets and inner values
默认:
true
¥Default:
true
javascript.formatter.attributePosition
Section titled javascript.formatter.attributePositionjsx 元素中的属性位置样式。
¥The attribute position style in jsx elements.
-
"auto"
,属性会自动格式化,只有当它们符合某些条件时,它们才会折叠在多行中;¥
"auto"
, the attributes are automatically formatted, and they will collapse in multiple lines only when they hit certain criteria; -
"multiline"
,无论如何,属性总是格式化为多行。¥
"multiline"
, the attributes are always formatted on multiple lines, regardless.
默认:
"auto"
¥Default:
"auto"
javascript.globals
Section titled javascript.globalsBiome 应忽略的全局名称列表(分析器、linter 等)
¥A list of global names that Biome should ignore (analyzer, linter, etc.)
javascript.jsxRuntime
Section titled javascript.jsxRuntime表示用于解释 JSX 的运行时或转换的类型。
¥Indicates the type of runtime or transformation used for interpreting JSX.
-
"transparent"
— 表示现代或原生 JSX 环境,不需要 Biome 进行特殊处理。¥
"transparent"
— Indicates a modern or native JSX environment, that doesn’t require special handling by Biome. -
"reactClassic"
— 表示需要React
导入的经典 React 环境。对应于 TypeScript 的tsconfig.json
中jsx
选项的react
值。¥
"reactClassic"
— Indicates a classic React environment that requires theReact
import. Corresponds to thereact
value for thejsx
option in TypeScript’stsconfig.json
.
有关旧 JSX 运行时与新 JSX 运行时的更多信息,请参阅:https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
¥For more information about the old vs. new JSX runtime, please see: https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
默认:
"transparent"
¥Default:
"transparent"
javascript.linter.enabled
Section titled javascript.linter.enabled为 JavaScript(及其超级语言)文件启用 Biome 的格式化程序。
¥Enables Biome’s formatter for JavaScript (and its super languages) files.
默认:
true
¥Default:
true
应用于 JSON 文件的选项。
¥Options applied to the JSON files.
json.parser.allowComments
Section titled json.parser.allowComments启用 JSON 文件中注释的解析。
¥Enables the parsing of comments in JSON files.
json.parser.allowTrailingCommas
Section titled json.parser.allowTrailingCommas启用 JSON 文件中尾随逗号的解析。
¥Enables the parsing of trailing Commas in JSON files.
json.formatter.enabled
Section titled json.formatter.enabled为 JSON(及其超级语言)文件启用 Biome 的格式化程序。
¥Enables Biome’s formatter for JSON (and its super languages) files.
默认:
true
¥Default:
true
json.formatter.indentStyle
Section titled json.formatter.indentStyleJSON(及其超级语言)文件的缩进样式。它可以是 "tab"
或 "space"
。
¥The style of the indentation for JSON (and its super languages) files. It can be "tab"
or "space"
.
默认:
"tab"
¥Default:
"tab"
json.formatter.indentSize
Section titled json.formatter.indentSize此选项已弃用,请改用 json.formatter.indentWidth
。
¥This option is deprecated, please use json.formatter.indentWidth
instead.
Deprecated
JSON(及其超级语言)文件的缩进应该有多大。
¥How big the indentation should be for JSON (and its super languages) files.
默认:
2
¥Default:
2
json.formatter.indentWidth
Section titled json.formatter.indentWidthJSON(及其超级语言)文件的缩进应该有多大。
¥How big the indentation should be for JSON (and its super languages) files.
默认:
2
¥Default:
2
json.formatter.lineEnding
Section titled json.formatter.lineEndingJSON(及其超级语言)文件的行尾类型。
¥The type of line ending for JSON (and its super languages) files.
-
"lf"
,仅换行符(\n
),在 Linux 和 macOS 以及 git repos 内部很常见;¥
"lf"
, Line Feed only (\n
), common on Linux and macOS as well as inside git repos; -
"crlf"
,回车符 + 换行符(\r\n
),在 Windows 上很常见;¥
"crlf"
, Carriage Return + Line Feed characters (\r\n
), common on Windows; -
"cr"
,仅回车符(\r
),很少使用。¥
"cr"
, Carriage Return character only (\r
), used very rarely.
默认:
"lf"
¥Default:
"lf"
json.formatter.lineWidth
Section titled json.formatter.lineWidthJSON(及其超级语言)文件中的一行可以写多少个字符。
¥How many characters can be written on a single line in JSON (and its super languages) files.
默认:
80
¥Default:
80
json.formatter.trailingCommas
Section titled json.formatter.trailingCommas在多行逗号分隔的语法结构中尽可能打印尾随逗号。
¥Print trailing commas wherever possible in multi-line comma-separated syntactic structures.
允许的值:
¥Allowed values:
-
"none"
:尾随逗号被删除;¥
"none"
: the trailing comma is removed; -
"all"
:保留尾随逗号并优先使用。¥
"all"
: the trailing comma is kept and preferred.
默认:
"none"
¥Default:
"none"
json.linter.enabled
Section titled json.linter.enabled为 JSON(及其超级语言)文件启用 Biome 的格式化程序。
¥Enables Biome’s formatter for JSON (and its super languages) files.
默认:
true
¥Default:
true
应用于 CSS 文件的选项。
¥Options applied to the CSS files.
css.parser.cssModules
Section titled css.parser.cssModules启用 CSS 模块 的解析
¥Enables parsing of CSS modules
默认:
false
¥Default:
false
css.formatter.enabled
Section titled css.formatter.enabled为 CSS(及其超级语言)文件启用 Biome 的格式化程序。
¥Enables Biome’s formatter for CSS (and its super languages) files.
默认:
false
¥Default:
false
css.formatter.indentStyle
Section titled css.formatter.indentStyleCSS(及其超级语言)文件的缩进样式。它可以是 "tab"
或 "space"
。
¥The style of the indentation for CSS (and its super languages) files. It can be "tab"
or "space"
.
默认:
"tab"
¥Default:
"tab"
css.formatter.indentWidth
Section titled css.formatter.indentWidthCSS(及其超级语言)文件的缩进应该有多大。
¥How big the indentation should be for CSS (and its super languages) files.
默认:
2
¥Default:
2
css.formatter.lineEnding
Section titled css.formatter.lineEndingCSS(及其超级语言)文件的行尾类型。
¥The type of line ending for CSS (and its super languages) files.
-
"lf"
,仅换行符(\n
),在 Linux 和 macOS 以及 git repos 内部很常见;¥
"lf"
, Line Feed only (\n
), common on Linux and macOS as well as inside git repos; -
"crlf"
,回车符 + 换行符(\r\n
),在 Windows 上很常见;¥
"crlf"
, Carriage Return + Line Feed characters (\r\n
), common on Windows; -
"cr"
,仅回车符(\r
),很少使用。¥
"cr"
, Carriage Return character only (\r
), used very rarely.
默认:
"lf"
¥Default:
"lf"
css.formatter.lineWidth
Section titled css.formatter.lineWidthJSON(及其超级语言)文件中的一行可以写多少个字符。
¥How many characters can be written on a single line in JSON (and its super languages) files.
默认:
80
¥Default:
80
css.formatter.quoteStyle
Section titled css.formatter.quoteStyle表示字符串文字时使用的引号类型。它可以是 "single"
或 "double"
。
¥The type of quote used when representing string literals. It can be "single"
or "double"
.
默认:
"double"
¥Default:
"double"
css.linter.enabled
Section titled css.linter.enabled启用 Biome 的 CSS(及其超级语言)文件的 linter。
¥Enables Biome’s linter for CSS (and its super languages) files.
默认:
false
¥Default:
false
overrides
Section titled overrides模式列表。
¥A list of patterns.
使用此配置更改工具对某些文件的行为。
¥Use this configuration to change the behaviour of the tools for certain files.
当文件与覆盖模式匹配时,该模式中指定的配置将覆盖顶层配置。
¥When a file is matched against an override pattern, the configuration specified in that pattern will be override the top-level configuration.
模式的顺序很重要。如果文件可以匹配三种模式,则仅使用第一个模式。
¥The order of the patterns matter. If a file can match three patterns, only the first one is used.
overrides.<ITEM>.ignore
Section titled overrides.<ITEM>.ignoreUnix shell 样式模式列表。Biome 不会将覆盖应用于与模式匹配的文件。
¥A list of Unix shell style patterns. Biome will not apply the override to files that match the pattern.
overrides.<ITEM>.include
Section titled overrides.<ITEM>.includeUnix shell 样式模式列表。Biome 将仅将覆盖应用于与模式匹配的文件。
¥A list of Unix shell style patterns. Biome will apply the override only to files that match the pattern.
overrides.<ITEM>.formatter
Section titled overrides.<ITEM>.formatter它将包括 顶层格式化程序 配置的选项,减去 ignore
和 include
。
¥It will include the options of top level formatter configuration, minus ignore
and include
.
¥Examples
例如,可以修改 glob 路径 generated/**
中包含的某些文件的格式化程序 lineWidth
、indentStyle
:
¥For example, it’s possible to modify the formatter lineWidth
, indentStyle
for certain files that are included in the glob path generated/**
:
overrides.<ITEM>.linter
Section titled overrides.<ITEM>.linter它将包括 顶层 linter 配置的选项,减去 ignore
和 include
。
¥It will include the options of top level linter configuration, minus ignore
and include
.
¥Examples
你可以禁用某些 glob 路径的某些规则,并禁用其他 glob 路径的 linter:
¥You can disable certain rules for certain glob paths, and disable the linter for other glob paths:
overrides.<ITEM>.organizeImports
Section titled overrides.<ITEM>.organizeImports它将包括 顶层组织导入 的选项,减去 ignore
和 include
。
¥It will include the options of top level organize imports, minus ignore
and include
.
overrides.<ITEM>.javascript
Section titled overrides.<ITEM>.javascript它将包括 顶层 javascript 配置的选项。
¥It will include the options of top level javascript configuration.
¥Examples
你可以更改某些文件夹中 JavaScript 文件的格式行为:
¥You can change the formatting behaviour of JavaScript files in certain folders:
overrides.<ITEM>.json
Section titled overrides.<ITEM>.json它将包括 顶层 json 配置的选项。
¥It will include the options of top level json configuration.
¥Examples
你可以为某些 JSON 文件启用解析功能:
¥You can enable parsing features for certain JSON files: