設定
$schema
Section titled “$schema”JSONスキーマファイルへのパスを指定できます。
biome.json
用のJSONスキーマファイルを公開しています。
@biomejs/biome
パッケージが node_modules
フォルダにインストールされている場合、そのスキーマへの相対パスを指定できます。
{ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json"}
スキーマファイルの解決に問題がある場合は、このサイトで提供されているスキーマも使用できます。
{ "$schema": "https://biomejs.dev/schemas/2.0.0-beta/schema.json"}
extends
Section titled “extends”他のJSONファイルへのパスのリストです。Biomeは extends
リストに含まれるファイルのオプションを解決して適用し、最終的に biome.json
ファイルに含まれるオプションを適用します。
{ "extends": ["./biome.base.json"]}
files.maxSize
Section titled “files.maxSize”ソースコードファイルの最大許容サイズをバイト単位で指定します。この制限を超えるファイルは、パフォーマンス上の理由で無視されます。
デフォルト:
1048576
(1024*1024, 1MB)
files.ignore
Section titled “files.ignore”Biomeは、パターンに一致するファイルやフォルダを無視します。 Unixシェル形式のパターンのリストで指定します。
{ "files": { "ignore": ["scripts/*.js"] }}
files.include
Section titled “files.include”Biomeは、これらのパターンに一致するファイルやフォルダのみを処理します。 Unixシェル形式のパターンのリストで指定します。
{ "files": { "include": ["scripts/*.js"] }}
例えば、下記のような指定を考えます。
{ "files": { "include": ["scripts/**/*.js", "src/**/*.js"], "ignore": ["scripts/**/*.js"] }}
パターン src/**/*.js
に一致するファイルのみが処理され、パターン scripts/**/*.js
に一致するファイルは無視されます。
files.ignoreUnknown
Section titled “files.ignoreUnknown”Biomeは、処理できないファイルに遭遇した場合、診断情報を出力しません。
{ "files": { "ignoreUnknown": true }}
デフォルト:
false
BiomeをVCS(バージョン管理システム)ソフトウェアと統合するためのプロパティのセットです。
vcs.enabled
Section titled “vcs.enabled”BiomeがVCSクライアントと統合するかどうかを指定します。
デフォルト:
false
vcs.clientKind
Section titled “vcs.clientKind”VCSクライアントの種類を指定します。
値:
"git"
vcs.useIgnoreFile
Section titled “vcs.useIgnoreFile”BiomeがVCSの除外ファイルを使用するかどうかを指定します。true
に設定すると、Biomeは除外ファイルに指定されたファイルを無視します。
vcs.root
Section titled “vcs.root”BiomeがVCSファイルを探すフォルダを指定します。デフォルトでは、Biomeは biome.json
が見つかったフォルダを使用します。
もしBiomeが設定を見つけられない場合、現在の作業ディレクトリを使用しようとします。現在の作業ディレクトリも見つからない場合、BiomeはVCS統合を使用せず、診断情報が出力されます。
vcs.defaultBranch
Section titled “vcs.defaultBranch”プロジェクトのメインブランチです。Biomeは、変更されたファイルを評価する際にこのブランチを使用します。
linter
Section titled “linter”linter.enabled
Section titled “linter.enabled”Biomeのリンタを有効にします。
デフォルト:
true
linter.ignore
Section titled “linter.ignore”Biomeのリンタは、パターンに一致するファイルやフォルダを無視します。 Unixシェル形式のパターンのリストで指定します。
{ "linter": { "ignore": ["scripts/*.js"] }}
linter.include
Section titled “linter.include”Biomeのリンタは、これらのパターンに一致するファイルやフォルダのみを処理します。 Unixシェル形式のパターンのリストで指定します。
{ "linter": { "include": ["scripts/*.js"] }}
例えば、下記のような指定を考えます。
{ "linter": { "include": ["scripts/**/*.js", "src/**/*.js"], "ignore": ["scripts/**/*.js"] }}
パターン src/**/*.js
に一致するファイルのみが処理され、パターン scripts/**/*.js
に一致するファイルは無視されます。
linter.rules.recommended
Section titled “linter.rules.recommended”すべてのグループに対して推奨ルールを有効にします。
デフォルト:
true
linter.rules.[group]
Section titled “linter.rules.[group]”単一のグループのルールに影響を与えるオプションです。Biomeは次のグループをサポートしています。
- accessibility: アクセシビリティの問題を防ぐためのルール。
- complexity: より簡潔に記述できる可能性のある複雑なコードを見つけるためのルール。
- correctness: 間違っているか、不要なコードを検出するルール。
- nursery: まだ開発中の新しいルール。バグやパフォーマンスの問題が残っている可能性があるため、安定バージョンにおいては設定で明示的に有効化する必要があります。nightlyビルドではデフォルトで有効ですが、これらは不安定であるため、安定化する際に推奨ルールとなるかに応じて診断の重大度がエラーまたは警告に設定されることがあります。これらのルールは安定化して他のグループへ昇格されるか、削除されます。このグループに属するルールはセマンティックバージョンの対象ではありません。
- performance: より速く、または効率的に実行できる可能性のあるコードを見つけるルール。
- security: 潜在的なセキュリティ上の欠陥を検出するルール。
- style: 一貫性があり、慣用的なコードスタイルを強制するルール。
- suspicious: 間違っているか、不要な可能性のあるコードを検出するルール。
それぞれのグループは値として、重大度を表す文字列か、設定可能な各ルールのオブジェクトを受け入れます。
重大度を渡すときは、グループに属するすべてのルールに対して重大度を設定できます。
例えば、a11y
グループは情報の診断を出力するように設定できます:
{ "linter": { "rules": { "a11y": "info" } }}
以下が許容される値です:
"on"
: グループに属する各ルールは、デフォルトの重大度で診断を出力します。ルールのドキュメントを参照するか、explain
コマンドを利用してください:Terminal window biome explain noDebugger"off"
: グループに属するすべてのルールは診断を出力しません。"info"
: グループに属するすべてのルールは 重大度が情報の診断 を出力します。"warn"
: グループに属するすべてのルールは 重大度が警告の診断 を出力します。"error"
: グループに属するすべてのルールは 重大度がエラーの診断 を出力します。
linter.rules.[group].recommended
Section titled “linter.rules.[group].recommended”特定のグループに対して推奨されるルールを有効にします。
例:
{ "linter": { "enabled": true, "rules": { "nursery": { "recommended": true } } }}
formatter
Section titled “formatter”これらのオプションはすべての言語に適用されます。 下記には、言語固有のフォーマッタオプションが追加で記載されています。
formatter.enabled
Section titled “formatter.enabled”Biomeのフォーマッタを有効にします。
デフォルト:
true
formatter.ignore
Section titled “formatter.ignore”Biomeのフォーマッタは、パターンに一致するファイルやフォルダを無視します。 Unixシェル形式のパターンのリストで指定します。
{ "formatter": { "ignore": ["scripts/*.js"] }}
formatter.include
Section titled “formatter.include”Biomeのフォーマッタは、これらのパターンに一致するファイルやフォルダのみを処理します。 Unixシェル形式のパターンのリストで指定します。
{ "formatter": { "include": ["scripts/*.js"] }}
例えば、下記のような指定を考えます。
{ "formatter": { "include": ["scripts/**/*.js", "src/**/*.js"], "ignore": ["scripts/**/*.js"] }}
パターン src/**/*.js
に一致するファイルのみが処理され、パターン scripts/**/*.js
に一致するファイルは無視されます。
formatter.formatWithErrors
Section titled “formatter.formatWithErrors”構文エラーがあるドキュメントをフォーマットできるようにします。
{ "formatter": { "formatWithErrors": true }}
デフォルト:
false
formatter.indentStyle
Section titled “formatter.indentStyle”インデントのスタイルです。 "tab"
または "space"
のいずれかを指定できます。
デフォルト:
"tab"
formatter.indentSize
Section titled “formatter.indentSize”このオプションは廃止されました。代わりに formatter.indentWidth
を使用してください。
廃止されました
インデントのサイズを指定します。
デフォルト:
2
formatter.indentWidth
Section titled “formatter.indentWidth”インデントのサイズを指定します。
デフォルト:
2
formatter.lineEnding
Section titled “formatter.lineEnding”改行コードの種類を指定します。
"lf"
: Line Feedのみ (\n
)、LinuxやmacOS、またはgitリポジトリ内で一般的です。"crlf"
: Carriage Return + Line Feed文字 (\r\n
)、Windowsで一般的です。"cr"
: Carriage Return文字のみ (\r
)、非常にまれに使用されます。
デフォルト:
"lf"
formatter.lineWidth
Section titled “formatter.lineWidth”行の文字数を指定します。
デフォルト:
80
formatter.attributePosition
Section titled “formatter.attributePosition”HTML言語(あるいはHTMLベースの言語)における属性の位置スタイルを指定します。
"auto"
: 属性は自動的にフォーマットされ、特定の基準に達したときのみ複数行に折り返されます。"multiline"
: 属性は常に複数行でフォーマットされます。
デフォルト:
"auto"
formatter.bracketSpacing
Section titled “formatter.bracketSpacing”括弧と内部の値の間にスペースを追加するかどうかを指定します。
デフォルト:
true
formatter.useEditorconfig
Section titled “formatter.useEditorconfig”フォーマットのオプションを導出するために .editorconfig
ファイルを利用するかを指定します。
true
の場合、.editorconfig
ファイルの中の適用可能なオプションが利用されますが、biome.json
ファイルの設定が優先されます。
biome migrate
でPrettierから移行する場合、このオプションはPrettierの動作と一致させるため true
に設定されます。
デフォルト:
false
organizeImports
Section titled “organizeImports”organizeImports.enabled
Section titled “organizeImports.enabled”Biomeのインポートのソート機能を有効にします。
デフォルト:
true
organizeImports.ignore
Section titled “organizeImports.ignore”Biomeは、パターンに一致するファイルやフォルダを無視します。 Unixシェル形式のパターンのリストで指定します。
{ "organizeImports": { "ignore": ["scripts/*.js"] }}
organizeImports.include
Section titled “organizeImports.include”Biomeは、これらのパターンに一致するファイルやフォルダのみを処理します。 Unixシェル形式のパターンのリストで指定します。
{ "organizeImports": { "include": ["scripts/*.js"] }}
例えば、下記のような指定を考えます。
{ "organizeImports": { "include": ["scripts/**/*.js", "src/**/*.js"], "ignore": ["scripts/**/*.js"] }}
パターン src/**/*.js
に一致するファイルのみが処理され、パターン scripts/**/*.js
に一致するファイルは無視されます。
javascript
Section titled “javascript”これらのオプションは、JavaScript(およびTypeScript)ファイルにのみ適用されます。
javascript.parser.unsafeParameterDecoratorsEnabled
Section titled “javascript.parser.unsafeParameterDecoratorsEnabled”安全でない/実験的なパラメータデコレーターをサポートするようにします。
{ "javascript": { "parser": { "unsafeParameterDecoratorsEnabled": true } }}
デフォルト:
false
javascript.parser.jsxEverywhere
Section titled “javascript.parser.jsxEverywhere”true
に設定すると、.js
ファイルの中でJSX文法をパースすることを許可します。
false
に設定すると、.js
ファイルの中でJSX文法に遭遇したときにBiomeは診断を出力します。
デフォルト:
true
{ "javascript": { "parser": { "jsxEverywhere": false } }}
javascript.formatter.quoteStyle
Section titled “javascript.formatter.quoteStyle”文字列リテラルを表現する際に使用する引用符の種類です。 "single"
または "double"
のいずれかを指定できます。
デフォルト:
"double"
javascript.formatter.jsxQuoteStyle
Section titled “javascript.formatter.jsxQuoteStyle”JSXの文字列リテラルを表現する際に使用する引用符の種類です。 "single"
または "double"
のいずれかを指定できます。
デフォルト:
"double"
{ "javascript": { "formatter": { "jsxQuoteStyle": "single" } }}
javascript.formatter.quoteProperties
Section titled “javascript.formatter.quoteProperties”オブジェクト内のプロパティをいつ引用符で囲むかを指定します、。 "asNeeded"
または "preserve"
のいずれかを選択できます。
デフォルト:
"asNeeded"
{ "javascript": { "formatter": { "quoteProperties": "preserve" } }}
javascript.formatter.trailingCommas
Section titled “javascript.formatter.trailingCommas”複数行のカンマ区切りの構文構造で、可能な限り末尾カンマを追加します。可能な値は次の通りです。
"all"
: 末尾カンマが常に追加されます。"es5"
: 末尾カンマが、古いバージョンのJavaScriptでサポートされている場所にのみ追加されます。"none"
: 末尾カンマは決して追加されません。
デフォルト:
"all"
javascript.formatter.semicolons
Section titled “javascript.formatter.semicolons”フォーマッタがセミコロンを出力する場所を指定します。
"always"
: 各ステートメントの末尾に常にセミコロンが追加されます。"asNeeded"
: セミコロンは必要な場所にのみ追加され、ASIから保護します。
デフォルト:
"always"
例:
{ "javascript": { "formatter": { "semicolons": "asNeeded" } }}
javascript.formatter.arrowParentheses
Section titled “javascript.formatter.arrowParentheses”アロー関数に不要な括弧を追加するかどうかを指定します:
"always"
: 括弧が常に追加されます。"asNeeded"
: 必要な場合にのみ括弧が追加されます。
デフォルト:
"always"
javascript.formatter.enabled
Section titled “javascript.formatter.enabled”JavaScript(およびその拡張言語)ファイル用のBiomeフォーマッタを有効にします。
デフォルト
true
javascript.formatter.indentStyle
Section titled “javascript.formatter.indentStyle”JavaScript(およびその拡張言語)ファイルのインデントスタイルです。 "tab"
または "space"
のいずれかを指定できます。
デフォルト:
"tab"
javascript.formatter.indentWidth
Section titled “javascript.formatter.indentWidth”JavaScript(およびその拡張言語)ファイルのインデントサイズを指定します。
デフォルト:
2
javascript.formatter.lineEnding
Section titled “javascript.formatter.lineEnding”JavaScript(およびその拡張言語)ファイルの改行コードの種類を指定します。
"lf"
: Line Feedのみ (\n
)、LinuxやmacOS、またはgitリポジトリ内で一般的です。"crlf"
: Carriage Return + Line Feed文字 (\r\n
)、Windowsで一般的です。"cr"
: Carriage Return文字のみ (\r
)、非常にまれに使用されます。
デフォルト:
"lf"
javascript.formatter.lineWidth
Section titled “javascript.formatter.lineWidth”JavaScript(およびその拡張言語)ファイルの行の文字数を指定します。
デフォルト:
80
javascript.formatter.bracketSameLine
Section titled “javascript.formatter.bracketSameLine”複数行のJSX要素の終了タグ >
を最後の属性行に配置するかどうかを指定します。
デフォルト:
false
javascript.formatter.bracketSpacing
Section titled “javascript.formatter.bracketSpacing”括弧と内部の値の間にスペースを追加するかどうかを指定します。
デフォルト:
true
javascript.formatter.attributePosition
Section titled “javascript.formatter.attributePosition”JSX要素における属性の位置スタイルを指定します。
"auto"
: 属性は自動的にフォーマットされ、特定の基準に達したときのみ複数行に折り返されます。"multiline"
: 属性は常に複数行でフォーマットされます。
デフォルト:
"auto"
javascript.globals
Section titled “javascript.globals”Biomeが無視すべきグローバル名前のリストです。
{ "javascript": { "globals": ["$", "_", "externalVariable"] }}
javascript.jsxRuntime
Section titled “javascript.jsxRuntime”JSXを解釈するために使用されるランタイムまたは変換のタイプを示します。
"transparent"
— 特別な処理がBiomeによって必要ない、モダンまたはネイティブなJSX環境を示します。"reactClassic"
—React
インポートが必要な古いReact環境を示します。TypeScriptのtsconfig.json
におけるjsx
オプションのreact
値に対応します。
{ "javascript": { "jsxRuntime": "reactClassic" }}
古いJSXランタイムと新しいJSXランタイムについての詳細は、以下をご覧ください。 https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
デフォルト:
"transparent"
javascript.linter.enabled
Section titled “javascript.linter.enabled”JavaScript(およびその拡張言語)ファイル用のBiomeリンタを有効にします。
デフォルト:
true
{ "javascript": { "linter": { "enabled": false } }}
javascript.assist.enabled
Section titled “javascript.assist.enabled”JavaScript(およびその拡張言語)ファイル用のBiomeアシストを有効にします。
デフォルト:
true
{ "javascript": { "assist": { "enabled": false } }}
JSONファイルに適用されるオプションです。
json.parser.allowComments
Section titled “json.parser.allowComments”JSONファイル内のコメントの解析を有効にします。
{ "json": { "parser": { "allowComments": true } }}
json.parser.allowTrailingCommas
Section titled “json.parser.allowTrailingCommas”JSONファイル内の末尾カンマの解析を有効にします。
{ "json": { "parser": { "allowTrailingCommas": true } }}
json.formatter.enabled
Section titled “json.formatter.enabled”JSON(およびその拡張言語)ファイル用のBiomeフォーマッタを有効にします。
デフォルト:
true
{ "json": { "formatter": { "enabled": false } }}
json.formatter.indentStyle
Section titled “json.formatter.indentStyle”JSON(およびその拡張言語)ファイルのインデントスタイルです。 "tab"
または "space"
のいずれかを指定できます。
デフォルト:
"tab"
json.formatter.indentWidth
Section titled “json.formatter.indentWidth”JSON(およびその拡張言語)ファイルのインデントサイズを指定します。
デフォルト:
2
json.formatter.lineEnding
Section titled “json.formatter.lineEnding”JSON(およびその拡張言語)ファイルの改行コードの種類を指定します。
"lf"
: Line Feedのみ (\n
)、LinuxやmacOS、またはgitリポジトリ内で一般的です。"crlf"
: Carriage Return + Line Feed文字 (\r\n
)、Windowsで一般的です。"cr"
: Carriage Return文字のみ (\r
)、非常にまれに使用されます。
デフォルト:
"lf"
json.formatter.lineWidth
Section titled “json.formatter.lineWidth”JSON(およびその拡張言語)ファイルの行の文字数を指定します。
デフォルト:
80
json.formatter.trailingCommas
Section titled “json.formatter.trailingCommas”複数行のカンマ区切りの構文構造で、可能な限り末尾カンマを追加します。
許可される値は次の通りです。
"none"
: 末尾カンマは削除されます。"all"
: 末尾カンマは保持され、推奨されます。
デフォルト:
"none"
json.formatter.bracketSpacing
Section titled “json.formatter.bracketSpacing”括弧と内部の値の間にスペースを追加するかどうかを指定します。
デフォルト:
true
json.formatter.expand
Section titled “json.formatter.expand”配列とオブジェクトのリテラルを複数行に展開するかどうかを指定します。
"followSource"
: すでに複数行にあった場合と、単一行に収まらない場合に、配列とオブジェクトのリテラルは複数行にフォーマットされます。"always"
: リストの長さに関わらず、配列とオブジェクトのリテラルは複数行にフォーマットされます。
デフォルト:
"followSource"
json.linter.enabled
Section titled “json.linter.enabled”JSON(およびその拡張言語)ファイル用のBiomeのリンタを有効にします。
デフォルト:
true
{ "json": { "linter": { "enabled": false } }}
json.assist.enabled
Section titled “json.assist.enabled”JSON(およびその拡張言語)ファイル用のBiomeのアシストを有効にします。
デフォルト:
true
{ "json": { "assist": { "enabled": false } }}
CSSファイルに適用されるオプションです。
css.parser.cssModules
Section titled “css.parser.cssModules”CSS modules の解析を有効にします。
デフォルト:
false
css.formatter.enabled
Section titled “css.formatter.enabled”CSSファイル用のBiomeのフォーマッタを有効にします。
デフォルト:
false
{ "css": { "formatter": { "enabled": false } }}
css.formatter.indentStyle
Section titled “css.formatter.indentStyle”CSSファイルのインデントスタイルです。 "tab"
または "space"
のいずれかを指定できます。
デフォルト:
"tab"
css.formatter.indentWidth
Section titled “css.formatter.indentWidth”CSSファイルのインデントサイズを指定します。
デフォルト:
2
css.formatter.lineEnding
Section titled “css.formatter.lineEnding”CSSファイルの改行コードの種類を指定します。
"lf"
: Line Feedのみ (\n
)、LinuxやmacOS、またはgitリポジトリ内で一般的です。"crlf"
: Carriage Return + Line Feed文字 (\r\n
)、Windowsで一般的です。"cr"
: Carriage Return文字のみ (\r
)、非常にまれに使用されます。
デフォルト:
"lf"
css.formatter.lineWidth
Section titled “css.formatter.lineWidth”CSSファイルの行の文字数を指定します。
デフォルト:
80
css.formatter.quoteStyle
Section titled “css.formatter.quoteStyle”文字列リテラルを表現する際に使用する引用符の種類です。 "single"
または "double"
のいずれかを指定できます。
デフォルト:
"double"
css.linter.enabled
Section titled “css.linter.enabled”CSSファイル用のBiomeのリンタを有効にします。
デフォルト:
false
{ "css": { "linter": { "enabled": false } }}
css.assist.enabled
Section titled “css.assist.enabled”CSSファイル用のBiomeのアシストを有効にします。
デフォルト:
false
{ "css": { "assist": { "enabled": false } }}
graphql
Section titled “graphql”GraphQLファイルに適用されるオプションです。
graphql.formatter.enabled
Section titled “graphql.formatter.enabled”GraphQLファイル用のBiomeのフォーマッタを有効にします。
デフォルト:
false
graphql.formatter.indentStyle
Section titled “graphql.formatter.indentStyle”GraphQLファイルのインデントスタイルです。 "tab"
または "space"
のいずれかを指定できます。
デフォルト:
"tab"
graphql.formatter.indentWidth
Section titled “graphql.formatter.indentWidth”GraphQLファイルのインデントサイズを指定します。
デフォルト:
2
graphql.formatter.lineEnding
Section titled “graphql.formatter.lineEnding”GraphQLファイルの改行コードの種類を指定します。
"lf"
: Line Feedのみ (\n
)、LinuxやmacOS、またはgitリポジトリ内で一般的です。"crlf"
: Carriage Return + Line Feed文字 (\r\n
)、Windowsで一般的です。"cr"
: Carriage Return文字のみ (\r
)、非常にまれに使用されます。
デフォルト:
"lf"
graphql.formatter.lineWidth
Section titled “graphql.formatter.lineWidth”GraphQLファイルの行の文字数を指定します。
デフォルト:
80
graphql.formatter.quoteStyle
Section titled “graphql.formatter.quoteStyle”文字列リテラルを表現する際に使用する引用符の種類です。 "single"
または "double"
のいずれかを指定できます。
デフォルト:
"double"
graphql.linter.enabled
Section titled “graphql.linter.enabled”GraphQLファイル用のBiomeのリンタを有効にします。
デフォルト:
false
graphql.assist.enabled
Section titled “graphql.assist.enabled”GraphQLファイル用のBiomeのアシストを有効にします。
デフォルト:
false
Gritファイルに適用されるオプションです。
grit.formatter.enabled
Section titled “grit.formatter.enabled”Gritファイル用のBiomeのフォーマッタを有効にします。
デフォルト:
false
grit.formatter.indentStyle
Section titled “grit.formatter.indentStyle”Gritファイルのインデントスタイルです。 "tab"
または "space"
のいずれかを指定できます。
デフォルト:
"tab"
grit.formatter.indentWidth
Section titled “grit.formatter.indentWidth”Gritファイルのインデントサイズを指定します。
デフォルト:
2
grit.formatter.lineEnding
Section titled “grit.formatter.lineEnding”Gritファイルの改行コードの種類を指定します。
"lf"
: Line Feedのみ (\n
)、LinuxやmacOS、またはgitリポジトリ内で一般的です。"crlf"
: Carriage Return + Line Feed文字 (\r\n
)、Windowsで一般的です。"cr"
: Carriage Return文字のみ (\r
)、非常にまれに使用されます。
デフォルト:
"lf"
grit.formatter.lineWidth
Section titled “grit.formatter.lineWidth”Gritファイルの行の文字数を指定します。
デフォルト:
80
grit.formatter.quoteStyle
Section titled “grit.formatter.quoteStyle”文字列リテラルを表現する際に使用する引用符の種類です。 "single"
または "double"
のいずれかを指定できます。
デフォルト:
"double"
grit.linter.enabled
Section titled “grit.linter.enabled”Gritファイル用のBiomeのリンタを有効にします。
デフォルト:
false
grit.assist.enabled
Section titled “grit.assist.enabled”Gritファイル用のBiomeのアシストを有効にします。
デフォルト:
false
overrides
Section titled “overrides”パターンのリストです。 この設定を使用して、特定のファイルに対するツールの動作を変更します。 ファイルがオーバーライドパターンに一致すると、そのパターンに指定された設定がトップレベルの設定を上書きします。 パターンの順序は重要です。ファイルが3つのパターンに一致する場合、最初のパターンのみが使用されます。
overrides.<ITEM>.ignore
Section titled “overrides.<ITEM>.ignore”Unixシェル形式のパターンのリストです。Biomeは、これらのパターンに一致するファイルに対してオーバーライドを適用しません。
{ "overrides": [{ "ignore": ["scripts/*.js"] }]}
overrides.<ITEM>.include
Section titled “overrides.<ITEM>.include”Unixシェル形式のパターンのリストです。Biomeは、これらのパターンに一致するファイルにのみオーバーライドを適用します。
{ "overrides": [{ "include": ["scripts/*.js"] }]}
overrides.<ITEM>.formatter
Section titled “overrides.<ITEM>.formatter”ignore
と include
を除いた、上位のformatter 設定のオプションが含まれます。
Examples
Section titled “Examples”例えば、generated/**
のグロブパスに含まれる特定のファイルに対して、フォーマッタの lineWidth
や indentStyle
を変更することが可能です。
{ "formatter": { "lineWidth": 100 }, "overrides": [ { "include": ["generated/**"], "formatter": { "lineWidth": 160, "indentStyle": "space" } } ]}
overrides.<ITEM>.linter
Section titled “overrides.<ITEM>.linter”ignore
と include
を除いた、上位のlinter 設定のオプションが含まれます。
Examples
Section titled “Examples”特定のグロブパスに対しては特定のルールを無効にし、他のグロブパスに対してはリンタを無効にすることができます。
{ "linter": { "enabled": true, "rules": { "recommended": true } }, "overrides": [ { "include": ["lib/**"], "linter": { "rules": { "suspicious": { "noDebugger": "off" } } } }, { "include": ["shims/**"], "linter": { "enabled": false } } ]}
overrides.<ITEM>.organizeImports
Section titled “overrides.<ITEM>.organizeImports”ignore
と include
を除いた、上位のorganizeImports 設定のオプションが含まれます。
overrides.<ITEM>.javascript
Section titled “overrides.<ITEM>.javascript”上位のjavascript 設定のオプションが含まれます。
Examples
Section titled “Examples”特定のフォルダ内のJavaScriptファイルのフォーマット動作を変更することができます。
{ "formatter": { "lineWidth": 120 }, "javascript": { "formatter": { "quoteStyle": "single" } }, "overrides": [ { "include": ["lib/**"], "javascript": { "formatter": { "quoteStyle": "double" } } } ]}
overrides.<ITEM>.json
Section titled “overrides.<ITEM>.json”上位のjson 設定のオプションが含まれます。
Examples
Section titled “Examples”特定のJSONファイルに対して解析機能を有効にすることができます。
{ "linter": { "enabled": true, "rules": { "recommended": true } }, "overrides": [ { "include": [".vscode/**"], "json": { "parser": { "allowComments": true, "allowTrailingCommas": true } } } ]}