Diagnostics
このコンテンツはまだ日本語訳がありません。
Biome’s diagnostics are full of information, and they usually provide all the information you need to understand errors, and fix them.
Diagnostics aren’t only used for errors, but they are also used to provide structured information, warnings and tips.information
This page provide a break down of all the information that a diagnostic can contain. Learning all the different parts of a diagnostic can help you to identify the important parts, and some “secrets” behind them.
Diagnostic severity
Section titled Diagnostic severityThe severity of the diagnostic can affect the CLI. For example, error diagnostics will force the CLI to exit with an error code.
Fatal
Section titled FatalError diagnostics have red text. Fatal diagnostics are usually emitted when an unexpected error occurred inside Biome. Compared to errors, they have the fatal tag.
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 ErrorError diagnostics have red text. Usually, they should be addressed because they will emit an error code when encountered by the CLI.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Warning
Section titled WarningWarning diagnostics have yellow text. Usually, they should be addressed. Warnings are not blockers, and they won’t stop the CLI from working.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Information
Section titled InformationInformation diagnostics have green text. They provide useful information and they aren’t meant to block the CLI.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Diagnostic tags
Section titled Diagnostic tagsTags can be seen as metadata attached to a diagnostic, and they can affect the clients in different ways.
Verbose
Section titled VerboseVerbose diagnostics are usually hidden. Via CLI, you can show these diagnostics using the --verbose
option.
VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Internal
Section titled InternalInternal diagnostics are emitted when an internal error occurred. Users are usually encourage to file a bug when they see one.
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 FixableFixable diagnostics are emitted for those particular situations that can be fixed by the user. They are usually used for lint diagnostics that have a code action.
FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Deprecated
Section titled DeprecatedDiagnostics that contain code that is deprecated
DEPRECATED ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Diagnostic category
Section titled Diagnostic categoryThe category serves the group diagnostics. Optionally, a category can a have a link, for example for categories that belong to lint rules, like in the example below.
Simple category
Section titled Simple categoryThis diagnostic belongs to the category “check
”, which means that it is emitted when executing the check
command:
check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Category with link
Section titled Category with linkThis diagnostics belongs to the category “lint/a11y/noAccessKey
”. The link takes the user to the webpage of the lint rule noAccessKey
.
lint/a11y/noAccessKey ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Diagnostic location
Section titled Diagnostic locationDiagnostics can have a “location”. A location is made by three, optional, parts:
- a resource, which is the origin that emitted the diagnostic;
- source code of the file;
- a span (or text range), usually the line and column inside the file.
Diagnostic file path
Section titled Diagnostic file pathThe file path is usually the first information you see, at the top left of the diagnostic.
path/to/file.js ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Diagnostic source code
Section titled Diagnostic source codeThis shows how the source code associated to a file is shown. Notice that the line and columns aren’t shown.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
> 1 │ Some source code
│ ^^^^^
Diagnostic line and column
Section titled Diagnostic line and columnLine and column is usually printed beside the file path, and it’s shown only when there’s some source code associated to it.
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
│ ^^^^^^
When the diagnostics are printed inside the terminal of an IDE, you can click path/to/file.js:2:2
, and the IDE will open the relative file, and place cursor at the beginning of the span.
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 │ }
Diagnostic advices
Section titled Diagnostic advicesAdditionally, our diagnostics can store advices. Advices are additionally messages that can be appended after the original message.
These advices comes with different kinds and shapes. Usually, advices are always printed, unless they are verbose advices.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ 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