コンテンツにスキップ

診断

Biomeの診断結果には多くの情報が含まれており、通常エラーを理解して修正するために必要なすべての情報を提供します。

診断はエラーだけでなく、構造的な情報、警告、ヒントも提供します。

このページでは診断が含むすべての情報について詳しく説明します。 診断のさまざまな箇所について知ることで、重要な部分や “秘密” を見つけることに役立ちます。

診断の重要度はCLIに影響します。例えば、エラーの診断はCLIをエラーコードで終了させます。

エラーの診断は赤色のテキストです。深刻な診断は通常、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.
  

エラーの診断は赤色のテキストです。通常、CLIが検知した場合エラーコードを出力するため、エラーを解決するべきです。


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
  

警告の診断は黄色のテキストです。通常、これらは解決されるべきです。警告はブロッカではなく、CLIの動作を停止させません。


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
  

情報の診断は緑色のテキストです。これらは通常有用な情報を提供し、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.

詳細な診断は通常表示されません。CLIでは、--verbose オプションでこうした診断を表示できます。


 VERBOSE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
  

内部の診断は内部的なエラーが発生したときに出力されます。これに遭遇した場合は、バグを報告することが推奨されます。


 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  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
  

非推奨なコードを含む場合の診断です。


 DEPRECATED  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
  

カテゴリは診断をグループ化します。以下の例のように、リントのルールが属するカテゴリによってはリンクが付く場合があります。

この診断は “check” カテゴリに属し、check コマンドを実行したときに出力されます:


check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
  

この診断は “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つの任意な部分からなります:

  • 診断が出力された元のリソース
  • ファイルのソースコード
  • スパン(またはテキストの範囲)。通常、ファイル内のです。

ファイルパスは通常、最初に目に入る情報で、診断の左上にあります。


path/to/file.js ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
  

これはソースコードがどのようにファイルに紐づけられるかを示します。行と列は表示されません。


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
  
  > 1 │ Some source code
        ^^^^^
  

は通常、ソースコードが紐づいている場合にファイルパスと一緒に表示されます。


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 │ }
  

加えて、診断はアドバイスを持つこともあります。アドバイスは元のメッセージの後に付加される追加のメッセージです。

アドバイスにはさまざまな種類と形式があります。通常、アドバイスは 詳細なアドバイス でない限りは常に表示されます。


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   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