Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda