診断
Biomeの診断結果には多くの情報が含まれており、通常エラーを理解して修正するために必要なすべての情報を提供します。
診断はエラーだけでなく、構造的な情報、警告、ヒントも提供します。
このページでは診断が含むすべての情報について詳しく説明します。 診断のさまざまな箇所について知ることで、重要な部分や “秘密” を見つけることに役立ちます。
診断の重要度
Section titled “診断の重要度”診断の重要度はCLIに影響します。例えば、エラーの診断はCLIをエラーコードで終了させます。
深刻(Fatal)
Section titled “深刻(Fatal)”エラーの診断は赤色のテキストです。深刻な診断は通常、Biomeの内部で予期しないエラーが起きた場合に出力されます。エラーと違って、fatalタグを持ちます。
FATAL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
⚠ Biome exited as this error could not be handled and resulted in a fatal error. Please report it if necessary.
エラー(Error)
Section titled “エラー(Error)”エラーの診断は赤色のテキストです。通常、CLIが検知した場合エラーコードを出力するため、エラーを解決するべきです。
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
警告(Warning)
Section titled “警告(Warning)”警告の診断は黄色のテキストです。通常、これらは解決されるべきです。警告はブロッカではなく、CLIの動作を停止させません。
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
情報(Information)
Section titled “情報(Information)”情報の診断は緑色のテキストです。これらは通常有用な情報を提供し、CLIをブロックしません。
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Tags can be seen as metadata attached to a diagnostic, and they can affect the clients in different ways.
詳細(Verbose)
Section titled “詳細(Verbose)”詳細な診断は通常表示されません。CLIでは、--verbose
オプションでこうした診断を表示できます。
VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
内部(Internal)
Section titled “内部(Internal)”内部の診断は内部的なエラーが発生したときに出力されます。これに遭遇した場合は、バグを報告することが推奨されます。
INTERNAL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
⚠ This diagnostic was derived from an internal Biome error. Potential bug, please report it if necessary.
修正可能(Fixable)
Section titled “修正可能(Fixable)”修正可能な診断は、ユーザによって修正可能な状況について出力されます。これらは通常コードアクションを持つリントの診断に使われます。
FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
非推奨(Deprecated)
Section titled “非推奨(Deprecated)”非推奨なコードを含む場合の診断です。
DEPRECATED ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
診断カテゴリ
Section titled “診断カテゴリ”カテゴリは診断をグループ化します。以下の例のように、リントのルールが属するカテゴリによってはリンクが付く場合があります。
シンプルなカテゴリ
Section titled “シンプルなカテゴリ”この診断は “check
” カテゴリに属し、check
コマンドを実行したときに出力されます:
check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
リンク付きのカテゴリ
Section titled “リンク付きのカテゴリ”この診断は “lint/a11y/noAccessKey
” カテゴリに属します。リンクはユーザを noAccessKey
のWebページへ誘導します。
lint/a11y/noAccessKey ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
診断は “場所” を持つことがあります。場所は3つの任意な部分からなります:
- 診断が出力された元のリソース
- ファイルのソースコード
- スパン(またはテキストの範囲)。通常、ファイル内の行と列です。
診断のファイルパス
Section titled “診断のファイルパス”ファイルパスは通常、最初に目に入る情報で、診断の左上にあります。
path/to/file.js ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
診断のソースコード
Section titled “診断のソースコード”これはソースコードがどのようにファイルに紐づけられるかを示します。行と列は表示されません。
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
> 1 │ Some source code
│ ^^^^^
診断の行と列
Section titled “診断の行と列”行と列は通常、ソースコードが紐づいている場合にファイルパスと一緒に表示されます。
path/to/file.txt:1:6 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
> 1 │ Some source code
│ ^^^^^^
診断がIDEのターミナルの中で表示される場合、path/to/file.js:2:2
をクリックするとIDEが関連するファイルを開き、カーソルをスパンの始点に移動します。
path/to/file.js:2:2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
1 │ function name() {
> 2 │ return 'lorem'
│ ^^^^^^^^^^^^^^
3 │ }
診断のアドバイス
Section titled “診断のアドバイス”加えて、診断はアドバイスを持つこともあります。アドバイスは元のメッセージの後に付加される追加のメッセージです。
アドバイスにはさまざまな種類と形式があります。通常、アドバイスは 詳細なアドバイス でない限りは常に表示されます。
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
✖ This log is an error.
ℹ This log is a warning
ℹ This log is an information
This log doesn't have any category. Below, you'll have a command
$ biome command
Below, a group.
I am a group
ℹ First message of a group.
ℹ Second message of a group.
Below, a list.
- First item
- Second item
Below, a diff.
- Old·code
+ New·code
Below, a code frame.
> 1 │ Lorem
│ ^^^
2 │ Ipsum