Diagnostics
Biome diagnostics explain errors, warnings, and other events in a structured format. They usually provide the context you need to understand and resolve an issue.
This page explains each part of a diagnostic and how to interpret it.
Diagnostic severity
Section titled “Diagnostic severity”A diagnostic’s severity determines how Biome reports it and can also affect the CLI. For example, an error causes the CLI to exit with a non-zero status code.
Fatal diagnostics use red text and indicate that an unexpected error occurred inside Biome. Unlike error diagnostics, they include the fatal tag.
FATAL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
⚠ Biome exited as this error could not be handled and resulted in a fatal error. Please report it if necessary.
Error diagnostics use red text and should generally be addressed. The CLI will fail and exit when raised.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
Warning
Section titled “Warning”Warning diagnostics use yellow text and should generally be addressed. By default, they do not cause the CLI to fail.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ This diagnostic message is displayed in a color that reflects its severity.
Information
Section titled “Information”Information diagnostics use green text. They provide useful context and do not cause the CLI to fail.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ This diagnostic message is displayed in a color that reflects its severity.
Diagnostic tags
Section titled “Diagnostic tags”Tags are metadata attached to a diagnostic. They can change how clients display or handle it.
Verbose
Section titled “Verbose”Verbose diagnostics are hidden by default. To display them in the CLI, pass the --verbose option.
VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
Internal
Section titled “Internal”Internal diagnostics indicate that an unexpected error occurred inside Biome. If you encounter one, please file a bug report on GitHub.
INTERNAL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
⚠ This diagnostic was derived from an internal Biome error. Potential bug, please report it if necessary.
Fixable
Section titled “Fixable”Fixable diagnostics indicate that a fix is available. They are commonly used for lint diagnostics that offer a code action the user can review and apply.
FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
Deprecated
Section titled “Deprecated”Deprecated diagnostics identify code or configuration that is obsolete and should no longer be used.
DEPRECATED ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
Diagnostic category
Section titled “Diagnostic category”A diagnostic category is a identifier for the type of issue being reported. It appears in the diagnostic header and can identify a command, subsystem, or rule.
check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
Some categories can also include a link. For example, lint/a11y/noAccessKey links to the documentation for that lint rule:
lint/a11y/noAccessKey ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
Diagnostic location
Section titled “Diagnostic location”A diagnostic can include a file path, source code, and a highlighted range to show where an issue occurred. Each part is optional, so Biome displays whatever context is available.
A file path identifies which file the diagnostic refers to, even when no source code or exact position is available:
path/to/file.js ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
When source code and a highlighted range are available, Biome displays a code frame that points to the relevant text. This can appear without a file path, in which case the header does not include a line and column:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
> 1 │ Some source code
│ ^^^^^
When all three parts are available, Biome adds the line and column where the highlighted range begins to the file path:
path/to/file.txt:1:6 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
> 1 │ Some source code
│ ^^^^^^
A highlighted range can cover multiple lines. In terminals embedded in many IDEs, you can click a location such as path/to/file.js:2:2 to open the file and place the cursor at the beginning of that range:
path/to/file.js:2:2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
1 │ function name() {
> 2 │ return 'lorem'
│ ^^^^^^^^^^^^^^
3 │ }
Diagnostic advice
Section titled “Diagnostic advice”Diagnostics can include advice after the primary message. Advice can take several forms and is displayed by default. Verbose advice is displayed only when you pass the --verbose option.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This diagnostic message is displayed in a color that reflects its severity.
✖ An error message.
⚠ A warning message.
ℹ An informational message.
An unstyled message can introduce a command:
$ biome command
Messages can be grouped under a heading:
Related information
ℹ First message of a group.
ℹ Second message of a group.
Messages can also be displayed as a list:
- First item
- Second item
A diff can show a suggested change:
- Old·code
+ New·code
A code frame can highlight a source range:
> 1 │ Lorem
│ ^^^
2 │ Ipsum
Copyright (c) 2023-present Biome Developers and Contributors.