Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

152
Vistas
How do I interpret Prettier --debug-check output?

I am using prettier --debug-check and it is producing the following error information...

[error] my.js: ast(input) !== ast(prettier(input))
[error] Index:
[error] ===================================================================
[error] ---
[error] +++
[error] @@ -3497,8 +3497,6 @@
[error]                                "argument": {
[error]                                  "type": "LogicalExpression",
[error] -                                "operator": "&&",
[error]                                  "left": {
[error]                                    "type": "LogicalExpression",
[error] -                                  "operator": "&&",
[error]                                    "left": {
[error]                                      "type": "LogicalExpression",
[error] @@ -3529,4 +3527,5 @@
[error]                                      }
[error]                                    },
[error] +                                  "operator": "&&",
[error]                                    "right": {
[error]                                      "type": "Identifier",
[error] @@ -3534,4 +3533,5 @@
[error]                                    }
[error]                                  },
[error] +                                "operator": "&&",
[error]                                  "right": {
[error]                                    "type": "BinaryExpression",
[error]
[error] Index:
[error] ===================================================================
...
... below this appears to be a diff between the original file and the 
... prettier output...there is a huge difference between them.

I am having a hard time determining what in the original file is resulting in this error being produced. I assume that the error information is trying to tell me where to look...is it?

How can I resolve this error so prettier can be used to format the file?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Perhaps someone else will be able to provide a better answer.

The error output provided by --debug-check is uninterpretable.

To resolve the issue, a method that worked was to comment out code until I was able to narrow it down to the line that Pettier was complaining about.

The line had the form:

return (a && a.length > 0) && (b && b.length > 0);

Now, clearly the parenthesis are not needed, but including them leads to two different ASTs.

The solution was to write the line without the parenthesis:

return a && a.length > 0 && b && b.length > 0;

Doing so stops Prettier from complaining.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda