Diagnósticos
Los diagnósticos de Biome están llenos de información, y normalmente proporcionan toda la información que necesita para entender los errores, y solucionarlos.
Los diagnósticos no sólo sirven para detectar errores, sino también para proporcionar información estructurada, advertencias y consejos.
Esta página ofrece un desglose de toda la información que puede contener un diagnóstico. Aprender todas las partes de un diagnóstico puede ayudarle a identificar las partes importantes y algunos “secretos” que se esconden tras ellas.
Gravedad del diagnóstico
Sección titulada «Gravedad del diagnóstico»La gravedad del diagnóstico puede afectar a la CLI. Por ejemplo, los diagnósticos de error obligarán a la CLI a salir con un código de error.
Los diagnósticos de error tienen texto en rojo. Los diagnósticos fatales suelen emitirse cuando se produce un error inesperado dentro de Biome. En comparación con los errores, tienen la etiqueta 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.
Los diagnósticos de error tienen texto en rojo. Por lo general, deben ser abordados porque emitirán un código de error cuando se encuentran por la CLI.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Advertencia
Sección titulada «Advertencia»Los diagnósticos de advertencia tienen texto amarillo. Por lo general, deben ser atendidos. Las advertencias no son bloqueos y no impedirán que la CLI funcione.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Información
Sección titulada «Información»Los diagnósticos de información tienen texto verde. Proporcionan información útil y no están destinados a bloquear la CLI.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Etiquetas de diagnóstico
Sección titulada «Etiquetas de diagnóstico»Las etiquetas pueden verse como metadatos adjuntos a un diagnóstico, y pueden afectar a los clientes de diferentes maneras.
Verbose
Sección titulada «Verbose»Los diagnósticos detallados suelen estar ocultos. A través de la CLI, puede mostrar estos diagnósticos utilizando la opción --verbose
.
VERBOSE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Interno
Sección titulada «Interno»Los diagnósticos internos se emiten cuando se produce un error interno. Normalmente se anima a los usuarios a presentar un error cuando ven uno.
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.
Reparable
Sección titulada «Reparable»Los diagnósticos reparables se emiten para aquellas situaciones particulares que pueden ser reparadas por el usuario. Suelen utilizarse para diagnósticos de pelusa que tienen una acción de código.
FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Obsoleto
Sección titulada «Obsoleto»Diagnósticos que contienen código obsoleto
DEPRECATED ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Categoría de diagnóstico
Sección titulada «Categoría de diagnóstico»La categoría sirve para el diagnóstico del grupo. Opcionalmente, una categoría puede tener un enlace, por ejemplo para categorías que pertenecen a reglas de lint, como en el ejemplo siguiente.
Categoría simple
Sección titulada «Categoría simple»Este diagnóstico pertenece a la categoría “check
”, lo que significa que se emite al ejecutar el comando check
:
check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Categoría con enlace
Sección titulada «Categoría con enlace»Este diagnóstico pertenece a la categoría “lint/a11y/noAccessKey
”. El enlace lleva al usuario a la página web de la regla lint noAccessKey
.
lint/a11y/noAccessKey ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Localización del diagnóstico
Sección titulada «Localización del diagnóstico»Los diagnósticos pueden tener una “localización”. Una ubicación se compone de tres partes opcionales:
- un recurso, que es el origen que emitió el diagnóstico;
- código fuente del archivo;
- un span (o rango de texto), normalmente la línea y la columna dentro del archivo.
Ruta del archivo de diagnóstico
Sección titulada «Ruta del archivo de diagnóstico»La ruta del archivo suele ser la primera información que aparece, en la parte superior izquierda del diagnóstico.
path/to/file.js ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
Código fuente de diagnóstico
Sección titulada «Código fuente de diagnóstico»Esto muestra cómo se muestra el código fuente asociado a un archivo. Observa que la línea y las columnas no se muestran.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This is the message of the diagnostic. It will appear in different colours based on the severity of the diagnostic.
> 1 │ Some source code
│ ^^^^^
Línea y columna de diagnóstico
Sección titulada «Línea y columna de diagnóstico»Line y column suele imprimirse junto a la ruta del archivo, y sólo se muestra cuando hay algún código fuente asociado.
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
│ ^^^^^^
Cuando los diagnósticos se imprimen dentro de la terminal de un IDE, puede hacer clic en ruta/al/archivo.js:2:2
, y el IDE abrirá el archivo relativo, y colocará el cursor al principio del tramo.
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 │ }
Consejos de diagnóstico
Sección titulada «Consejos de diagnóstico»Además, nuestros diagnósticos pueden almacenar avisos. Los avisos son mensajes adicionales que pueden añadirse al mensaje original.
Estos consejos son de diferentes tipos y formas. Normalmente, los consejos siempre se imprimen, a menos que sean consejos verbales.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ 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