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
Section titled Gravedad del diagnósticoLa 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.
Fatal
Section titled FatalLos 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.
Error
Section titled ErrorLos 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
Section titled AdvertenciaLos 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
Section titled InformaciónLos 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
Section titled Etiquetas de diagnósticoLas etiquetas pueden verse como metadatos adjuntos a un diagnóstico, y pueden afectar a los clientes de diferentes maneras.
Verbose
Section titled VerboseLos 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
Section titled InternoLos 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
Section titled ReparableLos 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
Section titled ObsoletoDiagnó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
Section titled Categoría de diagnósticoLa 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
Section titled Categoría simpleEste 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
Section titled Categoría con enlaceEste 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
Section titled Localización del diagnósticoLos 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
Section titled Ruta del archivo de diagnósticoLa 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
Section titled Código fuente de diagnósticoEsto 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
Section titled Línea y columna de diagnósticoLine 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
Section titled Consejos de diagnósticoAdemá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